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-BkgeZpOO.js";import{l as E,C as G,f as k,g as z}from"./menu.data-DYgGjxvl.js";import{u as H,B as J}from"./index-qSr7C5NQ.js";import{useDrawerAdaptiveWidth as Q}from"./useAdaptiveWidth-Bn089Ulv.js";import{K as X}from"./index-CYriLmQo.js";import{u as Y,B as Z}from"./useForm-8o5KRzWo.js";import"./componentMap-7D1QIeNI.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";import"./renderUtils-CGtepdOw.js";const ee=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{ee as default};
