import{X as k,O as B}from"./index.ad3efb29.js";import R from"./index.975bd9f7.js";import{_ as M}from"./index.vue_vue_type_script_setup_true_lang.72748ead.js";import V from"./index.2a5e4491.js";import{G as N,D as U}from"./api.23bb9b70.js";import{j as F}from"./elementPlus.4833989a.js";import{d as j,r as n,j as O,ai as u,o as v,M as w,O as s,U as r,a as C,u as l,R as E,D as G}from"./vue.adf17aba.js";import{_ as X}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";import"./index.es.d2375c1e.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import"./crud.3c942071.js";const z={class:"menu-box menu-left-box"},A={class:"menu-box menu-right-box"},I=j({__name:"index",setup(K){let i=n([]),_=n([]),o=n(!1),m=n({}),p=n(null),D=n(null);const d=()=>{N({}).then(a=>{const e=a.data,t=k.toArrayTree(e,{parentKey:"parent",children:"children",strict:!0});i.value=t})},T=a=>{var e;(e=D.value)==null||e.handleRefreshTable(a)},b=(a,e)=>{var t,c;if(a==="update"&&e){const f=((c=(t=p.value)==null?void 0:t.treeRef)==null?void 0:c.currentNode.parent.data)||{};_.value=[f],m.value=e}o.value=!0},h=a=>{a==="submit"&&d(),o.value=!1,m.value={}},y=(a,e)=>{F.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const t=await U(a);e(),(t==null?void 0:t.code)===2e3&&(B(t.msg),d())})};return O(()=>{d()}),(a,e)=>{const t=u("el-col"),c=u("el-row"),f=u("el-drawer"),g=u("fs-page");return v(),w(g,null,{default:s(()=>[r(c,{class:"menu-el-row"},{default:s(()=>[r(t,{span:6},{default:s(()=>[C("div",z,[r(R,{ref_key:"menuTreeRef",ref:p,treeData:l(i),onTreeClick:T,onUpdateDept:b,onDeleteDept:y},null,8,["treeData"])])]),_:1}),r(t,{span:18},{default:s(()=>[C("div",A,[r(M,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1})]),_:1}),r(f,{modelValue:l(o),"onUpdate:modelValue":e[0]||(e[0]=x=>G(o)?o.value=x:o=x),title:"菜单配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":h},{default:s(()=>[l(o)?(v(),w(V,{key:0,initFormData:l(m),cacheData:l(_),treeData:l(i),onDrawerClose:h},null,8,["initFormData","cacheData","treeData"])):E("",!0)]),_:1},8,["modelValue"])]),_:1})}}});const te=X(I,[["__scopeId","data-v-c53f5a09"]]);export{te as default};
