import{a7 as M,F as V,ai as N}from"./index.CL7yl-Wb.js";import U from"./index.C7WUEdVh.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang.BtYDoOiO.js";import E from"./index.DAE09PME.js";import G from"./index.PUa6SqXg.js";import{G as K,D as q}from"./api.DoQpOlE2.js";import{a as T,r,q as z,aj as s,J as y,o as C,K as n,S as o,b as _,u,y as A,M as I}from"./vue.D1BjjNmv.js";import{_ as J}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.ewMaC2f9.js";import"./crud.uOtil7zh.js";import"./authFunction.D75vbqds.js";import"./crud.r49Jyexl.js";import"./api.Bo5_6aVX.js";const L={class:"menu-box menu-left-box"},O={style:{height:"72vh"}},P={style:{height:"72vh"}},S=T({name:"menuPages"}),X=T({...S,setup(H){let m=r([]),p=r([]),l=r(!1),i=r({}),h=r(null),D=r(null),b=r(null);const f=()=>{K({}).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 q(a);t(),(e==null?void 0:e.code)===2e3&&(N(e.msg),f())})};return z(()=>{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",L,[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",O,[o(j,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1}),o(c,{label:"列权限配置"},{default:n(()=>[_("div",P,[o(G,{ref_key:"menuFieldRef",ref:b},null,512)])]),_:1})]),_:1})]),_:1})]),_:1}),o(B,{modelValue:u(l),"onUpdate:modelValue":t[0]||(t[0]=w=>A(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(E,{key:0,initFormData:u(i),cacheData:u(p),treeData:u(m),onDrawerClose:v},null,8,["initFormData","cacheData","treeData"])):I("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),ce=J(X,[["__scopeId","data-v-29f7b6c6"]]);export{ce as default};
