var E=Object.defineProperty;var d=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var f=(e,t,o)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))P.call(t,o)&&f(e,o,t[o]);if(d)for(var o of d(t))y.call(t,o)&&f(e,o,t[o]);return e};var c=(e,t,o)=>new Promise((l,a)=>{var s=r=>{try{u(o.next(r))}catch(i){a(i)}},p=r=>{try{u(o.throw(r))}catch(i){a(i)}},u=r=>r.done?l(r.value):Promise.resolve(r.value).then(s,p);u((o=o.apply(e,t)).next())});import{B as C}from"./BasicForm.d11b68fd.js";import{u as S}from"./useForm.868c8e81.js";import{aP as R,a as _,r as k,k as F,f as I,aQ as w,o as V,aR as G,p as M,j as N,aU as A}from"./index.0d073eaa.js";import"./index.e317a008.js";import{B as $,a as q}from"./index.c4338a98.js";import{d as L}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.7075e2b7.js";import"./index.04f7e044.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";const T=e=>e==="0",B=e=>e==="1",m=e=>e==="2",U=[{field:"type",label:"\u83DC\u5355\u7C7B\u578B",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u76EE\u5F55",value:"0"},{label:"\u83DC\u5355",value:"1"},{label:"\u6309\u94AE",value:"2"}]},colProps:{lg:24,md:24}},{field:"menuName",label:"\u83DC\u5355\u540D\u79F0",component:"Input",required:!0},{field:"parentMenu",label:"\u4E0A\u7EA7\u83DC\u5355",component:"TreeSelect",componentProps:{fieldNames:{label:"menuName",key:"id",value:"id"},getPopupContainer:()=>document.body}},{field:"orderNo",label:"\u6392\u5E8F",component:"InputNumber",required:!0},{field:"icon",label:"\u56FE\u6807",component:"IconPicker",required:!0,ifShow:({values:e})=>!m(e.type)},{field:"routePath",label:"\u8DEF\u7531\u5730\u5740",component:"Input",required:!0,ifShow:({values:e})=>!m(e.type)},{field:"component",label:"\u7EC4\u4EF6\u8DEF\u5F84",component:"Input",ifShow:({values:e})=>B(e.type)},{field:"permission",label:"\u6743\u9650\u6807\u8BC6",component:"Input",ifShow:({values:e})=>!T(e.type)},{field:"status",label:"\u72B6\u6001",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u7981\u7528",value:"1"}]}},{field:"isExt",label:"\u662F\u5426\u5916\u94FE",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u5426",value:"0"},{label:"\u662F",value:"1"}]},ifShow:({values:e})=>!m(e.type)},{field:"keepalive",label:"\u662F\u5426\u7F13\u5B58",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u5426",value:"0"},{label:"\u662F",value:"1"}]},ifShow:({values:e})=>B(e.type)},{field:"show",label:"\u662F\u5426\u663E\u793A",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u662F",value:"0"},{label:"\u5426",value:"1"}]},ifShow:({values:e})=>!m(e.type)}],O=_({name:"MenuDrawer",components:{BasicDrawer:$,BasicForm:C},emits:["success","register"],setup(e,{emit:t}){const o=k(!0),[l,{resetFields:a,setFieldsValue:s,updateSchema:p,validate:u}]=S({labelWidth:100,schemas:U,showActionButtonGroup:!1,baseColProps:{lg:12,md:24}}),[r,{setDrawerProps:i,closeDrawer:D}]=q(n=>c(this,null,function*(){a(),i({confirmLoading:!1}),o.value=!!(n!=null&&n.isUpdate),F(o)&&s(b({},n.record));const v=yield L();p({field:"parentMenu",componentProps:{treeData:v}})})),g=I(()=>F(o)?"\u7F16\u8F91\u83DC\u5355":"\u65B0\u589E\u83DC\u5355");function h(){return c(this,null,function*(){try{const n=yield u();i({confirmLoading:!0}),console.log(n),D(),t("success")}finally{i({confirmLoading:!1})}})}return{registerDrawer:r,registerForm:l,getTitle:g,handleSubmit:h}}});function j(e,t,o,l,a,s){const p=w("BasicForm"),u=w("BasicDrawer");return V(),G(u,A(e.$attrs,{onRegister:e.registerDrawer,showFooter:"",title:e.getTitle,width:"50%",onOk:e.handleSubmit}),{default:M(()=>[N(p,{onRegister:e.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}var Ve=R(O,[["render",j]]);export{Ve as default};
