You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.6 KiB
JavaScript

var l=(h,p,r)=>new Promise((s,u)=>{var c=e=>{try{o(r.next(e))}catch(i){u(i)}},f=e=>{try{o(r.throw(e))}catch(i){u(i)}},o=e=>e.done?s(e.value):Promise.resolve(e.value).then(c,f);o((r=r.apply(h,p)).next())});import{a as N,B as v}from"./index-COQSZY7c.js";import{u as L,_ as T}from"./useForm-koea_hsc.js";import"./BasicForm.vue_vue_type_style_index_0_lang-CUDTou-T.js";import{bu as B,bv as F,i as R,b as S}from"./entry/index-CT2bBVPU-1724922878694.js";import"./componentMap-CWMsMsGY.js";import{a as k,m as x,b as A,c as C}from"./index-CPW5WZn2.js";import{m as P}from"./menu.data-CDGVts4C.js";import{d as D,f as E,c as U,_ as V,a8 as $,a9 as G,k as H,u as n,ad as K}from"./vue-aEZWZQSa.js";import"./antd-BY-1PcYE.js";import"./useWindowSizeFn-BWwSyuoE.js";import"./FormItem.vue_vue_type_script_lang-fyvFSOLP.js";import"./helper-BqaPddWo.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-RC179q1_.js";import"./index-BRqXDmQx.js";import"./useSortable-CKONboZ0.js";import"./download-Dzju1Gbo.js";import"./useLoading-CR9OIhwN.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-Cslz80qp.js";import"./useRender-DwBE0jb3.js";import"./index-C4J1QZTF.js";import"./dict-CrNwQRtO.js";import"./dictEnum-DeC8h6ZR.js";const he=D({name:"MenuModal",__name:"MenuModal",emits:["reload","register"],setup(h,{emit:p}){const r=p,s=E(!1),u=U(()=>s.value?"修改菜单":"添加菜单"),[c,{validate:f,setFieldsValue:o,resetForm:e,updateSchema:i}]=L({schemas:P,showActionButtonGroup:!1,labelWidth:100,name:"menu_modal"}),[w,{modalLoading:d,closeModal:I}]=N(a=>l(this,null,function*(){d(!0);const{record:t,update:m}=a;if(s.value=m,t&&t.parentId&&(yield o({parentId:t.parentId})),m&&t){const y=yield k(t.menuId);yield o(y)}yield M(),d(!1)}));function M(){return l(this,null,function*(){const a=yield x(),m=[{menuName:"根目录",menuId:0,children:B(a,{id:"menuId",pid:"parentId"})}];F(m,"menuName"," / "),yield i({field:"parentId",componentProps:{treeData:m,fieldNames:{label:"menuName",value:"menuId"},treeDefaultExpandAll:!1,treeNodeLabelProp:"fullName",treeLine:{showLeafIcon:!1},treeDefaultExpandedKeys:[0],listHeight:300}})})}const{refreshMenu:_}=R(),g=S("refreshMenu",!0);function b(){return l(this,null,function*(){try{d(!0);const a=yield f();n(s)?yield A(a):yield C(a),yield e(),r("reload",()=>l(this,null,function*(){I(),g.value&&(yield _())}))}catch(a){}finally{d(!1)}})}return(a,t)=>(V(),$(n(v),K(a.$attrs,{title:u.value,width:700,onRegister:n(w),onOk:b,onCancel:n(e)}),{default:G(()=>[H(n(T),{onRegister:n(c)},null,8,["onRegister"])]),_:1},16,["title","onRegister","onCancel"]))}});export{he as default};