import{X as M,H as V,F as N}from"./index.BKEMpsLA.js";import U from"./index.Dmpm-1xl.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang.BunxYZzJ.js";import E from"./index.lU1zZKxJ.js";import G from"./index.DJ_EnsFp.js";import{G as K,D as X}from"./api.DmodAW71.js";import{a as T,r,q,aj as s,J as y,o as C,K as n,S as o,b as _,u,y as z,M as A}from"./vue.YrNK8sx4.js";import{_ as H}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.BalDsBES.js";import"./crud.QxPWid0y.js";import"./authFunction.DqglRaEG.js";import"./crud.9ZZ-VNyV.js";import"./api.BUJM_Ai1.js";const I={class:"menu-box menu-left-box"},J={style:{height:"72vh"}},L={style:{height:"72vh"}},O=T({name:"menuPages"}),P=T({...O,setup(S){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 X(a);t(),(e==null?void 0:e.code)===2e3&&(N(e.msg),f())})};return q(()=>{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",I,[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",J,[o(j,{ref_key:"menuButtonRef",ref:D},null,512)])]),_:1}),o(c,{label:"列权限配置"},{default:n(()=>[_("div",L,[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=>z(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"])):A("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),ce=H(P,[["__scopeId","data-v-9655b33c"]]);export{ce as default};
