var v=Object.defineProperty;var g=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var B=(o,r,e)=>r in o?v(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,w=(o,r)=>{for(var e in r||(r={}))k.call(r,e)&&B(o,e,r[e]);if(g)for(var e of g(r))C.call(r,e)&&B(o,e,r[e]);return o};var f=(o,r,e)=>new Promise((s,n)=>{var u=t=>{try{i(e.next(t))}catch(a){n(a)}},p=t=>{try{i(e.throw(t))}catch(a){n(a)}},i=t=>t.done?s(t.value):Promise.resolve(t.value).then(u,p);i((e=e.apply(o,r)).next())});import{B as R}from"./BasicForm.d11b68fd.js";import{u as T}from"./useForm.868c8e81.js";import{aP as $,a as y,r as _,k as d,f as I,aQ as D,o as P,aR as U,p as b,j as F,aU as L}from"./index.0d073eaa.js";import"./index.04f7e044.js";import{B as N,a as V}from"./index.c4338a98.js";import{_ as S}from"./index.9d5559d9.js";import{d as q}from"./system.d37449cd.js";/* empty css              *//* empty css              */import"./index.0fb15725.js";import"./index.965098be.js";import"./Checkbox.476f6e92.js";import"./index.1491cab6.js";import"./index.e317a008.js";import"./index.7075e2b7.js";import"./index.e8daa066.js";import"./get.49a42f2e.js";import"./index.e8b360cf.js";import"./eagerComputed.156e81ff.js";import"./index.2b5ea4f6.js";import"./_baseIteratee.3919e7cf.js";import"./DeleteOutlined.247d1f35.js";import"./index.a8c197b8.js";import"./useRefs.e81831e2.js";import"./Form.48352728.js";import"./Col.a2eadc78.js";import"./useFlexGapSupport.474c31b7.js";import"./useSize.bb4e5ce5.js";import"./index.81899e8a.js";import"./index.c05f9254.js";import"./useWindowSizeFn.ef20ece8.js";import"./FullscreenOutlined.401a7bcd.js";import"./index.ffb8ac7d.js";import"./index.dd1f987c.js";import"./uuid.2b29000c.js";import"./download.bb4c9304.js";import"./base64Conver.08b9f4ec.js";import"./index.31930d74.js";import"./index.1d29734e.js";import"./uniqBy.ac0f9c38.js";import"./index.c9bfdeac.js";import"./ArrowLeftOutlined.90d2e05e.js";import"./fromPairs.84aabb58.js";import"./useContextMenu.cd4142a5.js";const A=[{field:"roleName",label:"\u89D2\u8272\u540D\u79F0",required:!0,component:"Input"},{field:"roleValue",label:"\u89D2\u8272\u503C",required:!0,component:"Input"},{field:"status",label:"\u72B6\u6001",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u505C\u7528",value:"1"}]}},{label:"\u5907\u6CE8",field:"remark",component:"InputTextArea"},{label:" ",field:"menu",slot:"menu",component:"Input"}],E=y({name:"RoleDrawer",components:{BasicDrawer:N,BasicForm:R,BasicTree:S},emits:["success","register"],setup(o,{emit:r}){const e=_(!0),s=_([]),[n,{resetFields:u,setFieldsValue:p,validate:i}]=T({labelWidth:90,baseColProps:{span:24},schemas:A,showActionButtonGroup:!1}),[t,{setDrawerProps:a,closeDrawer:l}]=V(m=>f(this,null,function*(){u(),a({confirmLoading:!1}),d(s).length===0&&(s.value=yield q()),e.value=!!(m!=null&&m.isUpdate),d(e)&&p(w({},m.record))})),c=I(()=>d(e)?"\u7F16\u8F91\u89D2\u8272":"\u65B0\u589E\u89D2\u8272");function h(){return f(this,null,function*(){try{const m=yield i();a({confirmLoading:!0}),console.log(m),l(),r("success")}finally{a({confirmLoading:!1})}})}return{registerDrawer:t,registerForm:n,getTitle:c,handleSubmit:h,treeData:s}}});function G(o,r,e,s,n,u){const p=D("BasicTree"),i=D("BasicForm"),t=D("BasicDrawer");return P(),U(t,L(o.$attrs,{onRegister:o.registerDrawer,showFooter:"",title:o.getTitle,width:"500px",onOk:o.handleSubmit}),{default:b(()=>[F(i,{onRegister:o.registerForm},{menu:b(({model:a,field:l})=>[F(p,{value:a[l],"onUpdate:value":c=>a[l]=c,treeData:o.treeData,fieldNames:{title:"menuName",key:"id"},checkable:"",toolbar:"",title:"\u83DC\u5355\u5206\u914D"},null,8,["value","onUpdate:value","treeData"])]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}var Ue=$(E,[["render",G]]);export{Ue as default};
