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-ARbUvvsq.js";import{l as E,C as G,f as k,g as z}from"./menu.data-DH-zNTQM.js";import{u as H,B as J}from"./index-CC3OF1BO.js";import{useDrawerAdaptiveWidth as Q}from"./useAdaptiveWidth-B-GcgPBd.js";import{K as X}from"./index-B_2CoVdl.js";import{u as Y,B as Z}from"./useForm-CcjrODHR.js";import"./componentMap-CzCGDP7x.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.js";import"./renderUtils-Cbe4E0PZ.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};
