import{X as B,O as M}from"./index.8a64ecdf.js";import R from"./index.ee358350.js";import{_ as V}from"./index.vue_vue_type_script_setup_true_lang.23cf194b.js";import N from"./index.0eac22e0.js";import{G as E,D as F}from"./api.0445a2ba.js";import{E as U}from"./elementPlus.58179425.js";import{d as C,r as n,j as G,a8 as u,o as v,E as b,G as s,M as r,a as w,u as l,J as j,t as O}from"./vue.95e072e2.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.f34cd23f.js";import"./crud.103329fb.js";const z={class:"menu-box menu-left-box"},A={class:"menu-box menu-right-box"},I=C({name:"menuPages"}),J=C({...I,setup(K){let m=n([]),d=n([]),o=n(!1),i=n({}),p=n(null),D=n(null);const _=()=>{E({}).then(a=>{const e=a.data,t=B.toArrayTree(e,{parentKey:"parent",children:"children",strict:!0});m.value=t})},T=a=>{var e;(e=D.value)==null||e.handleRefreshTable(a)},g=(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)||{};d.value=[f],i.value=e}o.value=!0},h=a=>{a==="submit"&&_(),o.value=!1,i.value={}},y=(a,e)=>{U.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const t=await F(a);e(),(t==null?void 0:t.code)===2e3&&(M(t.msg),_())})};return G(()=>{_()}),(a,e)=>{const t=u("el-col"),c=u("el-row"),f=u("el-drawer"),k=u("fs-page");return v(),b(k,null,{default:s(()=>[r(c,{class:"menu-el-row"},{default:s(()=>[r(t,{span:6},{default:s(()=>[w("div",z,[r(R,{ref_key:"menuTreeRef",ref:p,treeData:l(m),onTreeClick:T,onUpdateDept:g,onDeleteDept:y},null,8,["treeData"])])]),_:1}),r(t,{span:18},{default:s(()=>[w("div",A,[r(V,{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(),b(N,{key:0,initFormData:l(i),cacheData:l(d),treeData:l(m),onDrawerClose:h},null,8,["initFormData","cacheData","treeData"])):j("",!0)]),_:1},8,["modelValue"])]),_:1})}}});const ae=X(J,[["__scopeId","data-v-1bbf2676"]]);export{ae as default};
