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
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-B6biQger.js";import{u as L,_ as T}from"./useForm-CdUGloRq.js";import"./BasicForm.vue_vue_type_style_index_0_lang-C-Cj0P69.js";import{bu as B,bv as F,i as R,b as S}from"./entry/index-CruxN-Hs-1723019140439.js";import"./componentMap-uxp1OCze.js";import{a as k,m as x,b as A,c as C}from"./index-Cr9gInYA.js";import{m as P}from"./menu.data-CuCmseI-.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--jCT5E3A.js";import"./FormItem.vue_vue_type_script_lang-B_ueKfdL.js";import"./helper-CuUont7-.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-D6-xDLMZ.js";import"./index-BYFe0x3M.js";import"./useSortable-CSRkxIlp.js";import"./download-BageIVpd.js";import"./useLoading-C0EEZ3ab.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-Bwlk8Loa.js";import"./useRender-CuBarcLn.js";import"./index-VnRLIvr7.js";import"./dict-B_9qLt7l.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};
|