import{u as S,G as z,X as G,J as I,F as O,M as J}from"./element-plus.33d6376e.js";import{M as C,f as K,b as P}from"./index.80c2a703.js";import{m as X,c as j}from"./menu.95a3e0c2.js";import{_ as q}from"./edit.vue_vue_type_script_setup_true_lang.9832e154.js";import{d as H,s as x,r as E,ad as Q,o as n,c as v,U as s,L as t,a as D,M as p,K as r,u as b,R as N,S as m,n as R}from"./@vue.230e89ba.js";import"./@vueuse.88988742.js";import"./dayjs.66926594.js";import"./axios.2d915936.js";import"./@element-plus.739f7923.js";import"./lodash-es.29c53eac.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.b68d77aa.js";import"./vue-router.c0281831.js";import"./pinia.1d1aade0.js";import"./vue-demi.bfae2336.js";import"./css-color-function.a8f9466d.js";import"./color.903ca10f.js";import"./clone.9d64bb7a.js";import"./color-convert.69e17089.js";import"./color-string.e356f5de.js";import"./color-name.e7a4e1d3.js";import"./nprogress.a96d99f2.js";import"./echarts.6ad8c478.js";import"./zrender.f91f2f01.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.b3d01323.js";import"./index.vue_vue_type_script_setup_true_lang.b3f5bb6c.js";import"./index.4107e0ad.js";const W={class:"menu-lists"},Y=m(" \u65B0\u589E "),Z=m(" \u5C55\u5F00/\u6298\u53E0 "),ee={key:0},te={key:1},oe={key:2},ae={class:"flex"},ne=m("\u6B63\u5E38"),se=m("\u505C\u7528"),ie=m(" \u65B0\u589E "),le=m(" \u7F16\u8F91 "),ue=m(" \u5220\u9664 "),Oe=H({__name:"index",setup(re){const w=x(),d=x();let h=!1;const c=E(!1),_=E(!1),y=E([]),k=async()=>{c.value=!0;try{const e=await X();y.value=e,c.value=!1}catch{c.value=!1}},F=async e=>{var o,i;_.value=!0,await R(),e&&((o=d.value)==null||o.setFormData({pid:e})),(i=d.value)==null||i.open("add")},$=async e=>{var o,i;_.value=!0,await R(),(o=d.value)==null||o.open("edit"),(i=d.value)==null||i.setFormData(e)},A=async e=>{await K.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await j({id:e}),k()},L=()=>{h=!h,B(y.value,h)},B=(e,o=!0)=>{var i;for(const l in e)(i=w.value)==null||i.toggleRowExpansion(e[l],o),e[l].children&&B(e[l].children,o)};return k(),(e,o)=>{const i=P,l=S,u=z,g=G,M=I,U=O,f=Q("perms"),V=J;return n(),v("div",W,[s(U,{class:"!border-none",shadow:"never"},{default:t(()=>[D("div",null,[p((n(),r(l,{type:"primary",onClick:o[0]||(o[0]=a=>F())},{icon:t(()=>[s(i,{name:"el-icon-Plus"})]),default:t(()=>[Y]),_:1})),[[f,["system:menu:add"]]]),s(l,{onClick:L},{default:t(()=>[Z]),_:1})]),p((n(),r(M,{ref_key:"tableRef",ref:w,class:"mt-4",size:"large",data:y.value,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:t(()=>[s(u,{label:"\u83DC\u5355\u540D\u79F0",prop:"menuName","min-width":"150","show-overflow-tooltip":""}),s(u,{label:"\u7C7B\u578B",prop:"menuType","min-width":"80"},{default:t(({row:a})=>[a.menuType==b(C).CATALOGUE?(n(),v("div",ee,"\u76EE\u5F55")):a.menuType==b(C).MENU?(n(),v("div",te,"\u83DC\u5355")):a.menuType==b(C).BUTTON?(n(),v("div",oe,"\u6309\u94AE")):N("",!0)]),_:1}),s(u,{label:"\u56FE\u6807",prop:"menuIcon","min-width":"80"},{default:t(({row:a})=>[D("div",ae,[s(i,{name:a.menuIcon,size:20},null,8,["name"])])]),_:1}),s(u,{label:"\u6743\u9650\u6807\u8BC6",prop:"perms","min-width":"150","show-overflow-tooltip":""}),s(u,{label:"\u72B6\u6001",prop:"isDisable","min-width":"100"},{default:t(({row:a})=>[a.isDisable==0?(n(),r(g,{key:0},{default:t(()=>[ne]),_:1})):(n(),r(g,{key:1,type:"danger"},{default:t(()=>[se]),_:1}))]),_:1}),s(u,{label:"\u6392\u5E8F",prop:"menuSort","min-width":"100"}),s(u,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"updateTime","min-width":"180"}),s(u,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:t(({row:a})=>[p((n(),r(l,{type:"primary",link:"",onClick:T=>F(a.id)},{default:t(()=>[ie]),_:2},1032,["onClick"])),[[f,["system:menu:add"]]]),p((n(),r(l,{type:"primary",link:"",onClick:T=>$(a)},{default:t(()=>[le]),_:2},1032,["onClick"])),[[f,["system:menu:edit"]]]),p((n(),r(l,{type:"danger",link:"",onClick:T=>A(a.id)},{default:t(()=>[ue]),_:2},1032,["onClick"])),[[f,["system:menu:del"]]])]),_:1})]),_:1},8,["data"])),[[V,c.value]])]),_:1}),_.value?(n(),r(q,{key:0,ref_key:"editRef",ref:d,onSuccess:k,onClose:o[1]||(o[1]=a=>_.value=!1)},null,512)):N("",!0)])}}});export{Oe as default};
