import{X as V,E as M,R as N}from"./index.lP_uh0LI.js";import F from"./index.D7tEqb2B.js";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang.CdFVZ52x.js";import E from"./index.DVEv7A6j.js";import{G as j,D as G}from"./api.CMIu0bJC.js";import{d as C,a as r,o as X,b as s,h as v,f as w,w as l,g as o,s as x,u as c,$ as z,j as A}from"./vue.BxlDVA1H.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.DrINYQVe.js";import"./crud.CMhx-STq.js";import"./authFunction.z5AMEiSQ.js";const K={class:"menu-box menu-left-box"},L={style:{height:"72vh"}},O=C({name:"menuPages"}),P=C({...O,setup($){let m=r([]),f=r([]),n=r(!1),i=r({}),p=r(null),D=r(null);const d=()=>{j({}).then(a=>{const e=a.data,t=V.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,u;if(a==="update"&&e){const _=((u=(t=p.value)==null?void 0:t.treeRef)==null?void 0:u.currentNode.parent.data)||{};f.value=[_],i.value=e}n.value=!0},h=a=>{a==="submit"&&d(),n.value=!1,i.value={}},y=(a,e)=>{M.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const t=await G(a);e(),(t==null?void 0:t.code)===2e4&&(N(t.msg),d())})};return X(()=>{d()}),(a,e)=>{const t=s("el-col"),u=s("el-tab-pane"),_=s("el-tabs"),k=s("el-row"),B=s("el-drawer"),R=s("fs-page");return w(),v(R,null,{default:l(()=>[o(k,{class:"menu-el-row"},{default:l(()=>[o(t,{span:6},{default:l(()=>[x("div",K,[o(F,{ref_key:"menuTreeRef",ref:p,treeData:c(m),onTreeClick:T,onUpdateDept:g,onDeleteDept:y},null,8,["treeData"])])]),_:1}),o(t,{span:18},{default:l(()=>[o(_,{type:"border-card"},{default:l(()=>[o(u,{label:"按钮权限配置"},{default:l(()=>[x("div",L,[o(U,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1})]),_:1})]),_:1})]),_:1}),o(B,{modelValue:c(n),"onUpdate:modelValue":e[0]||(e[0]=b=>z(n)?n.value=b:n=b),title:"菜单配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":h},{default:l(()=>[c(n)?(w(),v(E,{key:0,initFormData:c(i),cacheData:c(f),treeData:c(m),onDrawerClose:h},null,8,["initFormData","cacheData","treeData"])):A("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),oe=I(P,[["__scopeId","data-v-dbbc5d61"]]);export{oe as default};
