import{G as M,w as U,O as P,P as S,N as z,Q as G}from"./element-plus.55d71530.js";import{M as h,f as q,b as Q}from"./index.e2bd5212.js";import{e as j,a as H}from"./menu.8b334c77.js";import{u as I}from"./usePaging.af60c1ec.js";import{_ as J}from"./edit.vue_vue_type_script_setup_true_lang.4d014c52.js";import{d as N,s as x,r as K,aq as W,o as i,c as v,V as n,M as t,a as D,O as c,L as r,S as m,u as p,R as E,n as T}from"./@vue.96c135a1.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.f4694335.js";import"./@element-plus.07bd0514.js";import"./dayjs.37feae28.js";import"./@amap.8a62addd.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.d6737109.js";import"./axios.c6b9fe3d.js";import"./vue-router.64fdcd9a.js";import"./pinia.aebd7275.js";import"./css-color-function.7f53c13d.js";import"./color.4952d479.js";import"./clone.dd01d7ea.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.80787eb0.js";import"./tslib.60310f1a.js";import"./zrender.6f33727c.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.3d7ee361.js";import"./picker.vue_vue_type_script_setup_true_lang.33863854.js";import"./index.e651cfa0.js";const X={class:"menu-lists"},Y={key:0},Z={key:1},ee={key:2},te={class:"flex"},oe=N({name:"menu"}),ze=N({...oe,setup(ae){const b=x(),d=x();let y=!1;const _=K(!1),{pager:k,getLists:C}=I({fetchFun:H,params:{page_type:0}}),g=async a=>{var o,s;_.value=!0,await T(),a&&((o=d.value)==null||o.setFormData({pid:a})),(s=d.value)==null||s.open("add")},R=async a=>{var o,s;_.value=!0,await T(),(o=d.value)==null||o.open("edit"),(s=d.value)==null||s.getDetail(a)},$=async a=>{await q.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await j({id:a}),C()},A=()=>{y=!y,w(k.lists,y)},w=(a,o=!0)=>{var s;for(const l in a)(s=b.value)==null||s.toggleRowExpansion(a[l],o),a[l].children&&w(a[l].children,o)};return C(),(a,o)=>{const s=Q,l=U,u=P,B=M,L=S,O=z,f=W("perms"),V=G;return i(),v("div",X,[n(O,{class:"!border-none",shadow:"never"},{default:t(()=>[D("div",null,[c((i(),r(l,{type:"primary",onClick:o[0]||(o[0]=e=>g())},{icon:t(()=>[n(s,{name:"el-icon-Plus"})]),default:t(()=>[m(" \u65B0\u589E ")]),_:1})),[[f,["auth.menu/add"]]]),n(l,{onClick:A},{default:t(()=>[m(" \u5C55\u5F00/\u6298\u53E0 ")]),_:1})]),c((i(),r(L,{ref_key:"tableRef",ref:b,class:"mt-4",size:"large",data:p(k).lists,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:t(()=>[n(u,{label:"\u83DC\u5355\u540D\u79F0",prop:"name","min-width":"150","show-overflow-tooltip":""}),n(u,{label:"\u7C7B\u578B",prop:"type","min-width":"80"},{default:t(({row:e})=>[e.type==p(h).CATALOGUE?(i(),v("div",Y,"\u76EE\u5F55")):e.type==p(h).MENU?(i(),v("div",Z,"\u83DC\u5355")):e.type==p(h).BUTTON?(i(),v("div",ee,"\u6309\u94AE")):E("",!0)]),_:1}),n(u,{label:"\u56FE\u6807",prop:"icon","min-width":"80"},{default:t(({row:e})=>[D("div",te,[n(s,{name:e.icon,size:20},null,8,["name"])])]),_:1}),n(u,{label:"\u6743\u9650\u6807\u8BC6",prop:"perms","min-width":"150","show-overflow-tooltip":""}),n(u,{label:"\u72B6\u6001",prop:"is_disable","min-width":"100"},{default:t(({row:e})=>[e.is_disable==0?(i(),r(B,{key:0},{default:t(()=>[m("\u6B63\u5E38")]),_:1})):(i(),r(B,{key:1,type:"danger"},{default:t(()=>[m("\u505C\u7528")]),_:1}))]),_:1}),n(u,{label:"\u6392\u5E8F",prop:"sort","min-width":"100"}),n(u,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),n(u,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:t(({row:e})=>[e.type!==p(h).BUTTON?c((i(),r(l,{key:0,type:"primary",link:"",onClick:F=>g(e.id)},{default:t(()=>[m(" \u65B0\u589E ")]),_:2},1032,["onClick"])),[[f,["auth.menu/add"]]]):E("",!0),c((i(),r(l,{type:"primary",link:"",onClick:F=>R(e)},{default:t(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[f,["auth.menu/edit"]]]),c((i(),r(l,{type:"danger",link:"",onClick:F=>$(e.id)},{default:t(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[f,["auth.menu/delete"]]])]),_:1})]),_:1},8,["data"])),[[V,p(k).loading]])]),_:1}),p(_)?(i(),r(J,{key:0,ref_key:"editRef",ref:d,onSuccess:p(C),onClose:o[1]||(o[1]=e=>_.value=!1)},null,8,["onSuccess"])):E("",!0)])}}});export{ze as default};
