import{X as M,F as V,A as N}from"./index.CN1lNsL-.js";import U from"./index.BeQAzHPb.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang.BFqcJrON.js";import A from"./index.vu8MmDC5.js";import E from"./index.HaSW-Pbv.js";import{G,D as K}from"./api.C415_aSo.js";import{a as T,r,q as X,aj as s,J as y,o as C,K as n,S as o,b as _,u,y as q,M as z}from"./vue.YrNK8sx4.js";import{_ as I}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.BalDsBES.js";import"./crud.BqlcgaS-.js";import"./authFunction.qG4aq-Mj.js";import"./crud.DtrroeMH.js";import"./api.BwLAftdI.js";const J={class:"menu-box menu-left-box"},L={style:{height:"72vh"}},O={style:{height:"72vh"}},P=T({name:"menuPages"}),S=T({...P,setup(H){let m=r([]),p=r([]),l=r(!1),i=r({}),h=r(null),D=r(null),b=r(null);const f=()=>{G({}).then(a=>{const t=a.data,e=M.toArrayTree(t,{parentKey:"parent",children:"children",strict:!0});m.value=e})},x=a=>{var t,e;(t=D.value)==null||t.handleRefreshTable(a),(e=b.value)==null||e.handleRefreshTable(a)},R=(a,t)=>{var e,c;if(a==="update"&&t){const d=((c=(e=h.value)==null?void 0:e.treeRef)==null?void 0:c.currentNode.parent.data)||{};p.value=[d],i.value=t}l.value=!0},v=a=>{a==="submit"&&f(),l.value=!1,i.value={}},g=(a,t)=>{V.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const e=await K(a);t(),(e==null?void 0:e.code)===2e3&&(N(e.msg),f())})};return X(()=>{f()}),(a,t)=>{const e=s("el-col"),c=s("el-tab-pane"),d=s("el-tabs"),k=s("el-row"),B=s("el-drawer"),F=s("fs-page");return C(),y(F,null,{default:n(()=>[o(k,{class:"menu-el-row"},{default:n(()=>[o(e,{span:6},{default:n(()=>[_("div",J,[o(U,{ref_key:"menuTreeRef",ref:h,treeData:u(m),onTreeClick:x,onUpdateDept:R,onDeleteDept:g},null,8,["treeData"])])]),_:1}),o(e,{span:18},{default:n(()=>[o(d,{type:"border-card"},{default:n(()=>[o(c,{label:"按钮权限配置"},{default:n(()=>[_("div",L,[o(j,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1}),o(c,{label:"列权限配置"},{default:n(()=>[_("div",O,[o(E,{ref_key:"menuFieldRef",ref:b},null,512)])]),_:1})]),_:1})]),_:1})]),_:1}),o(B,{modelValue:u(l),"onUpdate:modelValue":t[0]||(t[0]=w=>q(l)?l.value=w:l=w),title:"菜单配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":v},{default:n(()=>[u(l)?(C(),y(A,{key:0,initFormData:u(i),cacheData:u(p),treeData:u(m),onDrawerClose:v},null,8,["initFormData","cacheData","treeData"])):z("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),ce=I(S,[["__scopeId","data-v-9655b33c"]]);export{ce as default};
