import{X as k,O as B}from"./index.373e4c1e.js";import M from"./index.7edd5c9f.js";import{_ as R}from"./index.vue_vue_type_script_setup_true_lang.d3401616.js";import V from"./index.753323a3.js";import{G as N,D as E}from"./api.86e14906.js";import{E as F}from"./elementPlus.c5b0e04f.js";import{d as U,r as n,j as G,a9 as u,o as v,E as w,G as s,M as r,a as C,u as l,J as j,t as O}from"./vue.65d9dadc.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.278ff746.js";import"./crud.a4691789.js";const z={class:"menu-box menu-left-box"},A={class:"menu-box menu-right-box"},I=U({__name:"index",setup(J){let m=n([]),_=n([]),o=n(!1),i=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});m.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],i.value=e}o.value=!0},h=a=>{a==="submit"&&d(),o.value=!1,i.value={}},y=(a,e)=>{F.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const t=await E(a);e(),(t==null?void 0:t.code)===2e3&&(B(t.msg),d())})};return G(()=>{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(M,{ref_key:"menuTreeRef",ref:p,treeData:l(m),onTreeClick:T,onUpdateDept:b,onDeleteDept:y},null,8,["treeData"])])]),_:1}),r(t,{span:18},{default:s(()=>[C("div",A,[r(R,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1})]),_:1}),r(f,{modelValue:l(o),"onUpdate:modelValue":e[0]||(e[0]=x=>O(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(i),cacheData:l(_),treeData:l(m),onDrawerClose:h},null,8,["initFormData","cacheData","treeData"])):j("",!0)]),_:1},8,["modelValue"])]),_:1})}}});const te=X(I,[["__scopeId","data-v-c53f5a09"]]);export{te as default};
