var T=Object.defineProperty;var C=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var _=(p,r,e)=>r in p?T(p,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):p[r]=e,b=(p,r)=>{for(var e in r||(r={}))L.call(r,e)&&_(p,e,r[e]);if(C)for(var e of C(r))M.call(r,e)&&_(p,e,r[e]);return p};var g=(p,r,e)=>new Promise((h,u)=>{var l=n=>{try{c(e.next(n))}catch(f){u(f)}},a=n=>{try{c(e.throw(n))}catch(f){u(f)}},c=n=>n.done?h(n.value):Promise.resolve(n.value).then(l,a);c((e=e.apply(p,r)).next())});import{d as V,K as $,f as P,u as m,e as x,a2 as K,ad as N,af as O,k as j,ag as q}from"./vue-vendor-CxLCUzY4.js";import"./index-ByX9XNkE.js";import{l as E,C as G,f as k,g as z}from"./menu.data-BtesGXIY.js";import{u as H,B as J}from"./index-BjHivc1K.js";import{useDrawerAdaptiveWidth as Q}from"./useAdaptiveWidth-CuheMf5X.js";import{K as X}from"./index-CLZzJyTP.js";import{u as Y,B as Z}from"./useForm-Dx3lJ3DG.js";import"./componentMap-DpsJvoqz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";import"./renderUtils-BgFeePLc.js";const re=V({__name:"MenuDrawer",emits:["success","register"],setup(p,{emit:r}){const e=r,{adaptiveWidth:h}=Q(),u=$(),l=P(!0),a=P(0),c=t=>t===2,[n,{setProps:f,resetFields:A,setFieldsValue:w,updateSchema:v,validate:U,clearValidate:W}]=Y({labelCol:{md:{span:4},sm:{span:6}},wrapperCol:{md:{span:20},sm:{span:18}},schemas:z,showActionButtonGroup:!1}),[y,{setDrawerProps:d,closeDrawer:I}]=H(t=>g(this,null,function*(){var i;yield A(),d({confirmLoading:!1}),l.value=!!(t!=null&&t.isUpdate),a.value=(i=t==null?void 0:t.record)==null?void 0:i.menuType;const o=yield E();if(v([{field:"parentId",componentProps:{treeData:D(o,"name")}},{field:"name",label:c(m(a))?"按钮/权限":"菜单名称"},{field:"url",required:!c(m(a)),componentProps:{onChange:s=>F(s.target.value)}}]),typeof t.record=="object"){let s=b({},t.record);w(s),F(s.url)}a.value==2&&W(),f({disabled:!u.showFooter})})),R=x(()=>m(l)?"编辑菜单":"新增菜单");function S(){return g(this,null,function*(){try{const t=yield U();G.IFrame===t.component&&(t.component=t.frameSrc),d({confirmLoading:!0}),yield k(t,m(l)),I(),e("success")}finally{d({confirmLoading:!1})}})}function F(t){let o="",i=t;t!=null&&t!=""?(t.startsWith("/")&&(t=t.substring(1)),t=t.replaceAll("/","-"),t=t.replaceAll(":","@"),o=`${t}`):o="请输入组件名称",v([{field:"componentName",componentProps:{placeholder:o}}]),i!=null&&i!=""&&(i.startsWith("http://")||i.startsWith("https://"))&&w({component:i})}function D(t,o){if(t!=null&&t.length){const{t:i}=X();t.forEach(s=>{var B;s[o]&&s[o].includes("t('")&&i&&(s[o]=new Function("t",`return ${s[o]}`)(i)),(B=s.children)!=null&&B.length&&D(s.children,o)})}return t}return(t,o)=>(K(),N(m(J),q(t.$attrs,{onRegister:m(y),showFooter:"",width:m(h),title:R.value,onOk:S}),{default:O(()=>[j(m(Z),{onRegister:m(n),class:"menuForm"},null,8,["onRegister"])]),_:1},16,["onRegister","width","title"]))}});export{re as default};
