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-DVEqH4Di.js";import{u as L,_ as T}from"./useForm-Ca7JThS8.js";import"./BasicForm.vue_vue_type_style_index_0_lang-D34fDasZ.js";import{bu as B,bv as F,i as R,b as S}from"./entry/index-CwTXVJ2d-1723001953242.js";import"./componentMap-S705cJLS.js";import{a as k,m as x,b as A,c as C}from"./index-Bv8q_Kfd.js";import{m as P}from"./menu.data-SrOt7Xmv.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-C93ItSr2.js";import"./FormItem.vue_vue_type_script_lang-DhGC9etS.js";import"./helper-BPjqq6ZQ.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-Cx2YeHC7.js";import"./index-B4wZYO02.js";import"./useSortable-BAwH_r98.js";import"./download-Da_OLLnH.js";import"./useLoading-B4X4QuoY.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-DTWqfx8n.js";import"./useRender-BJHJeiBI.js";import"./index-4SGburFo.js";import"./dict-yGEj6H2j.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};