import{X as x,n as V,F as N}from"./index.Df8UJ10K.js";import U from"./index.XmmzYDn0.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang.DJNFANiQ.js";import E from"./index.2KJ_s0mw.js";import G from"./index.DbFRwAKk.js";import{G as K,D as S}from"./api.BAkXIhOZ.js";import{a as R,r as s,q as X,aj as c,J as y,o as C,K as n,S as o,b as p,u,y as q,M as z}from"./vue.D1BjjNmv.js";import{_ as A}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.ewMaC2f9.js";import"./crud.B9q20KIE.js";import"./authFunction.Cmg2kwFe.js";import"./crud.RUUU56YY.js";import"./api.BsmDgisK.js";const I={class:"menu-box menu-left-box"},J={style:{height:"72vh"}},L={style:{height:"72vh"}},O=R({name:"menuPages"}),P=R({...O,setup(H){let m=s([]),h=s([]),l=s(!1),d=s({}),D=s(null),b=s(null),v=s(null);const f=()=>{K({}).then(a=>{const t=a.data,e=x.toArrayTree(t,{parentKey:"parent",children:"children",strict:!0}),r=new Set(["商户列表","商户账号"]),i=x.filterTree(e,_=>!r.has(_.name),{children:"children"});m.value=i})},g=a=>{var t,e;(t=b.value)==null||t.handleRefreshTable(a),(e=v.value)==null||e.handleRefreshTable(a)},k=(a,t)=>{var e,r;if(a==="update"&&t){const i=((r=(e=D.value)==null?void 0:e.treeRef)==null?void 0:r.currentNode.parent.data)||{};h.value=[i],d.value=t}l.value=!0},w=a=>{a==="submit"&&f(),l.value=!1,d.value={}},B=(a,t)=>{V.confirm("您确认删除该菜单项吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const e=await S(a);t(),(e==null?void 0:e.code)===2e3&&(N(e.msg),f())})};return X(()=>{f()}),(a,t)=>{const e=c("el-col"),r=c("el-tab-pane"),i=c("el-tabs"),_=c("el-row"),F=c("el-drawer"),M=c("fs-page");return C(),y(M,null,{default:n(()=>[o(_,{class:"menu-el-row"},{default:n(()=>[o(e,{span:6},{default:n(()=>[p("div",I,[o(U,{ref_key:"menuTreeRef",ref:D,treeData:u(m),onTreeClick:g,onUpdateDept:k,onDeleteDept:B},null,8,["treeData"])])]),_:1}),o(e,{span:18},{default:n(()=>[o(i,{type:"border-card"},{default:n(()=>[o(r,{label:"按钮权限配置"},{default:n(()=>[p("div",J,[o(j,{ref_key:"menuButtonRef",ref:b},null,512)])]),_:1}),o(r,{label:"列权限配置"},{default:n(()=>[p("div",L,[o(G,{ref_key:"menuFieldRef",ref:v},null,512)])]),_:1})]),_:1})]),_:1})]),_:1}),o(F,{modelValue:u(l),"onUpdate:modelValue":t[0]||(t[0]=T=>q(l)?l.value=T:l=T),title:"菜单配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":w},{default:n(()=>[u(l)?(C(),y(E,{key:0,initFormData:u(d),cacheData:u(h),treeData:u(m),onDrawerClose:w},null,8,["initFormData","cacheData","treeData"])):z("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),ue=A(P,[["__scopeId","data-v-ec87a2af"]]);export{ue as default};
