import{_ as I,w as z,L as G,M as P,I as j,N as q}from"./element-plus.fa1aa32c.js";import{M as v,f as x,b as H}from"./index.0abf9e5c.js";import{m as J,d as K}from"./menu.0a1fab25.js";import{_ as Q}from"./edit.vue_vue_type_script_setup_true_lang.529ab7e7.js";import{d as R,s as N,r as b,ag as W,o as n,c as h,V as s,M as o,a as $,O as p,L as r,u as y,S as w,T as m,n as L}from"./@vue.cab01781.js";import"./@vueuse.724ed0af.js";import"./@element-plus.92b4185f.js";import"./lodash-es.29c53eac.js";import"./dayjs.22a46fd8.js";import"./axios.8058589d.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.bbe6f09f.js";import"./vue-router.5046cc50.js";import"./pinia.e85e8286.js";import"./vue-demi.bfae2336.js";import"./css-color-function.5bd363c0.js";import"./color.232115c1.js";import"./clone.8f44c0eb.js";import"./color-convert.69e17089.js";import"./color-string.e356f5de.js";import"./color-name.e7a4e1d3.js";import"./nprogress.404eaa9c.js";import"./vue-clipboard3.19ab9072.js";import"./clipboard.6fb7c109.js";import"./echarts.6ad8c478.js";import"./zrender.f91f2f01.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.0ab41b7b.js";import"./picker.vue_vue_type_script_setup_true_lang.a0b1a8b8.js";import"./index.082aefea.js";const X={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 "),re=R({name:"menu"}),qe=R({...re,setup(me){const g=N(),d=N();let k=!1;const c=b(!1),_=b(!1),C=b([]),E=async()=>{c.value=!0;try{const e=await J();C.value=e,c.value=!1}catch{c.value=!1}},T=async e=>{var a,i;_.value=!0,await L(),e&&((a=d.value)==null||a.setFormData({pid:e})),(i=d.value)==null||i.open("add")},A=async e=>{var a,i;_.value=!0,await L(),(a=d.value)==null||a.open("edit"),(i=d.value)==null||i.getDetail(e)},M=async e=>{await x.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await K({id:e}),x.msgSuccess("\u5220\u9664\u6210\u529F"),E()},V=()=>{k=!k,B(C.value,k)},B=(e,a=!0)=>{var i;for(const l in e)(i=g.value)==null||i.toggleRowExpansion(e[l],a),e[l].children&&B(e[l].children,a)};return E(),(e,a)=>{const i=H,l=z,u=G,F=I,O=P,S=j,f=W("perms"),U=q;return n(),h("div",X,[s(S,{class:"!border-none",shadow:"never"},{default:o(()=>[$("div",null,[p((n(),r(l,{type:"primary",onClick:a[0]||(a[0]=t=>T())},{icon:o(()=>[s(i,{name:"el-icon-Plus"})]),default:o(()=>[Y]),_:1})),[[f,["system:menu:add"]]]),s(l,{onClick:V},{default:o(()=>[Z]),_:1})]),p((n(),r(O,{ref_key:"tableRef",ref:g,class:"mt-4",size:"large",data:C.value,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:o(()=>[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:o(({row:t})=>[t.menuType==y(v).CATALOGUE?(n(),h("div",ee,"\u76EE\u5F55")):t.menuType==y(v).MENU?(n(),h("div",te,"\u83DC\u5355")):t.menuType==y(v).BUTTON?(n(),h("div",oe,"\u6309\u94AE")):w("",!0)]),_:1}),s(u,{label:"\u56FE\u6807",prop:"menuIcon","min-width":"80"},{default:o(({row:t})=>[$("div",ae,[s(i,{name:t.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:o(({row:t})=>[t.isDisable==0?(n(),r(F,{key:0},{default:o(()=>[ne]),_:1})):(n(),r(F,{key:1,type:"danger"},{default:o(()=>[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:o(({row:t})=>[t.menuType!==y(v).BUTTON?p((n(),r(l,{key:0,type:"primary",link:"",onClick:D=>T(t.id)},{default:o(()=>[ie]),_:2},1032,["onClick"])),[[f,["system:menu:add"]]]):w("",!0),p((n(),r(l,{type:"primary",link:"",onClick:D=>A(t)},{default:o(()=>[le]),_:2},1032,["onClick"])),[[f,["system:menu:edit"]]]),p((n(),r(l,{type:"danger",link:"",onClick:D=>M(t.id)},{default:o(()=>[ue]),_:2},1032,["onClick"])),[[f,["system:menu:del"]]])]),_:1})]),_:1},8,["data"])),[[U,c.value]])]),_:1}),_.value?(n(),r(Q,{key:0,ref_key:"editRef",ref:d,onSuccess:E,onClose:a[1]||(a[1]=t=>_.value=!1)},null,512)):w("",!0)])}}});export{qe as default};
