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-BN26Feep.js";import{l as E,C as G,f as k,g as z}from"./menu.data-CAIGSiyj.js";import{u as H,B as J}from"./index-CJ4Xt1FM.js";import{useDrawerAdaptiveWidth as Q}from"./useAdaptiveWidth-Bz6tJGsL.js";import{K as X}from"./index-Cy4uayzW.js";import{u as Y,B as Z}from"./useForm-DfoT2G6J.js";import"./componentMap-0iK4HQBq.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.js";import"./renderUtils-BcsccCoe.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};
