import{_ as O,w as V,O as z,Q as P,T as Q,R as S}from"./element-plus.bccb9376.js";import{M as h,f as G,b as K}from"./index.6230d3f0.js";import{e as j,a as q}from"./menu.007612fb.js";import{u as H}from"./usePaging.6a6670f9.js";import{_ as I}from"./edit.vue_vue_type_script_setup_true_lang.72e096da.js";import{d as R,s as x,r as J,ap as W,o as a,c as v,U as n,L as t,a as T,M as c,K as p,R as m,u,Q as E,n as D}from"./@vue.18505fe0.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.a6528143.js";import"./@babel.16688d44.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.466e9fe4.js";import"./axios.4905d81f.js";import"./jspdf.54afd842.js";import"./fflate.fca59393.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.29b71fa4.js";import"./color.87d313dc.js";import"./clone.a63396d9.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"./vue-plugin-hiprint.a2d84e76.js";import"./jquery.c3f97e49.js";import"./jsbarcode.39151b53.js";import"./socket.io-client.0b5a7289.js";import"./engine.io-client.81030771.js";import"./engine.io-parser.c748e159.js";import"./@socket.io.77accf6a.js";import"./debug.b392f131.js";import"./socket.io-parser.b7256298.js";import"./html2canvas.0f5947bc.js";import"./canvg.a673c4b2.js";import"./core-js.97b94d69.js";import"./raf.407ad6ad.js";import"./performance-now.a710f6e4.js";import"./rgbcolor.20c71161.js";import"./svg-pathdata.eba17832.js";import"./stackblur-canvas.0fb5df18.js";import"./nprogress.3461658b.js";import"./vue-clipboard3.c63182fd.js";import"./clipboard.dd2c63d0.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.5030068c.js";const X={class:"menu-lists"},Y={key:0},Z={key:1},ee={key:2},te={class:"flex"},oe=R({name:"menu"}),nt=R({...oe,setup(ie){const b=x(),d=x();let y=!1;const _=J(!1),{pager:k,getLists:C}=H({fetchFun:q,params:{page_type:0}}),g=async i=>{var o,r;_.value=!0,await D(),i&&((o=d.value)==null||o.setFormData({pid:i})),(r=d.value)==null||r.open("add")},N=async i=>{var o,r;_.value=!0,await D(),(o=d.value)==null||o.open("edit"),(r=d.value)==null||r.getDetail(i)},$=async i=>{await G.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await j({id:i}),C()},A=()=>{y=!y,w(k.lists,y)},w=(i,o=!0)=>{var r;for(const s in i)(r=b.value)==null||r.toggleRowExpansion(i[s],o),i[s].children&&w(i[s].children,o)};return C(),(i,o)=>{const r=K,s=V,l=z,B=O,L=P,U=Q,f=W("perms"),M=S;return a(),v("div",X,[n(U,{class:"!border-none",shadow:"never"},{default:t(()=>[T("div",null,[c((a(),p(s,{type:"primary",onClick:o[0]||(o[0]=e=>g())},{icon:t(()=>[n(r,{name:"el-icon-Plus"})]),default:t(()=>[m(" \u65B0\u589E ")]),_:1})),[[f,["auth.menu/add"]]]),n(s,{onClick:A},{default:t(()=>[m(" \u5C55\u5F00/\u6298\u53E0 ")]),_:1})]),c((a(),p(L,{ref_key:"tableRef",ref:b,class:"mt-4",size:"large",data:u(k).lists,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:t(()=>[n(l,{label:"\u83DC\u5355\u540D\u79F0",prop:"name","min-width":"150","show-overflow-tooltip":""}),n(l,{label:"\u7C7B\u578B",prop:"type","min-width":"80"},{default:t(({row:e})=>[e.type==u(h).CATALOGUE?(a(),v("div",Y,"\u76EE\u5F55")):e.type==u(h).MENU?(a(),v("div",Z,"\u83DC\u5355")):e.type==u(h).BUTTON?(a(),v("div",ee,"\u6309\u94AE")):E("",!0)]),_:1}),n(l,{label:"\u56FE\u6807",prop:"icon","min-width":"80"},{default:t(({row:e})=>[T("div",te,[n(r,{name:e.icon,size:20},null,8,["name"])])]),_:1}),n(l,{label:"\u6743\u9650\u6807\u8BC6",prop:"perms","min-width":"150","show-overflow-tooltip":""}),n(l,{label:"\u72B6\u6001",prop:"is_disable","min-width":"100"},{default:t(({row:e})=>[e.is_disable==0?(a(),p(B,{key:0},{default:t(()=>[m("\u6B63\u5E38")]),_:1})):(a(),p(B,{key:1,type:"danger"},{default:t(()=>[m("\u505C\u7528")]),_:1}))]),_:1}),n(l,{label:"\u6392\u5E8F",prop:"sort","min-width":"100"}),n(l,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),n(l,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:t(({row:e})=>[e.type!==u(h).BUTTON?c((a(),p(s,{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((a(),p(s,{type:"primary",link:"",onClick:F=>N(e)},{default:t(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[f,["auth.menu/edit"]]]),c((a(),p(s,{type:"danger",link:"",onClick:F=>$(e.id)},{default:t(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[f,["auth.menu/delete"]]])]),_:1})]),_:1},8,["data"])),[[M,u(k).loading]])]),_:1}),u(_)?(a(),p(I,{key:0,ref_key:"editRef",ref:d,onSuccess:u(C),onClose:o[1]||(o[1]=e=>_.value=!1)},null,8,["onSuccess"])):E("",!0)])}}});export{nt as default};