import{X as F,n as M}from"./index.K_MFulpu.js";import V from"./index.Hp3PO79u.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang.D9xxkumd.js";import U from"./index.BsQgYPKW.js";import E from"./index.-JJNgFTc.js";import{G as j,D as G}from"./api.B3q9cCdU.js";import{E as O}from"./elementPlus.CSBdF9Zt.js";import{d as X,r,j as z,ai as s,o as w,M as y,O as n,U as o,a as p,u as i,R as A,D as I}from"./vue.1RczIYhx.js";import{_ as K}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.EO34UlUs.js";import"./crud.BHmhUJKm.js";import"./authFunction.CJG6xplX.js";import"./crud.7mG3Jv9z.js";import"./api.B0_75WU1.js";const L={class:"menu-box menu-left-box",style:{border:"1px solid #DDDFE6"}},q={style:{height:"80vh"}},H={style:{height:"80vh"}},J=X({__name:"index",setup(P){let c=r([]),_=r([]),l=r(!1),m=r({}),D=r(null),h=r(null),b=r(null);const d=()=>{j({}).then(a=>{const t=a.data,e=F.toArrayTree(t,{parentKey:"parent",children:"children",strict:!0});c.value=e})},C=a=>{var t,e;(t=h.value)==null||t.handleRefreshTable(a),(e=b.value)==null||e.handleRefreshTable(a)},T=(a,t)=>{var e,u;if(a==="update"&&t){const f=((u=(e=D.value)==null?void 0:e.treeRef)==null?void 0:u.currentNode.parent.data)||{};_.value=[f],m.value=t}l.value=!0},v=a=>{a==="submit"&&d(),l.value=!1,m.value={}},R=(a,t)=>{O.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const e=await G(a);t(),(e==null?void 0:e.code)===2e3&&(M(e.msg),d())})};return z(()=>{d()}),(a,t)=>{const e=s("el-col"),u=s("el-tab-pane"),f=s("el-tabs"),k=s("el-row"),g=s("el-drawer"),B=s("fs-page");return w(),y(B,null,{default:n(()=>[o(k,{class:"menu-el-row p-5"},{default:n(()=>[o(e,{span:6},{default:n(()=>[p("div",L,[o(V,{ref_key:"menuTreeRef",ref:D,treeData:i(c),onDeleteDept:R,onTreeClick:C,onUpdateDept:T},null,8,["treeData"])])]),_:1}),o(e,{span:18},{default:n(()=>[o(f,{style:{"border-radius":"8px",overflow:"hidden"},type:"border-card"},{default:n(()=>[o(u,{label:"按钮权限配置"},{default:n(()=>[p("div",q,[o(N,{ref_key:"menuButtonRef",ref:h},null,512)])]),_:1}),o(u,{label:"列权限配置"},{default:n(()=>[p("div",H,[o(E,{ref_key:"menuFieldRef",ref:b},null,512)])]),_:1})]),_:1})]),_:1})]),_:1}),o(g,{modelValue:i(l),"onUpdate:modelValue":t[0]||(t[0]=x=>I(l)?l.value=x:l=x),"before-close":v,"close-on-click-modal":!1,direction:"rtl",size:"500px",title:"菜单配置"},{default:n(()=>[i(l)?(w(),y(U,{key:0,cacheData:i(_),initFormData:i(m),treeData:i(c),onDrawerClose:v},null,8,["cacheData","initFormData","treeData"])):A("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),ue=K(J,[["__scopeId","data-v-9eeaa872"]]);export{ue as default};
