import{a0 as V,w as O,G as z,H as G,K,I as P}from"./element-plus.8e273e86.js";import{M as v,f as S,b as H}from"./index.2078eb25.js";import{e as I,a as Q}from"./menu.50e2dfb4.js";import{u as j}from"./usePaging.f8c888e4.js";import{_ as q}from"./edit.vue_vue_type_script_setup_true_lang.0f354011.js";import{d as N,s as x,r as J,ap as W,o as a,c as y,U as n,L as o,a as D,M as f,K as r,R as m,u as p,Q as b,n as T}from"./@vue.76ce7aa3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.41b9567d.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./index.8afed1db.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";const X={class:"menu-lists"},Y={key:0},Z={key:1},ee={key:2},te={class:"flex"},oe=N({name:"menu"}),Se=N({...oe,setup(ie){const g=x(),d=x();let k=!1;const _=J(!1),{pager:C,getLists:E}=j({fetchFun:Q,params:{page_type:0}}),w=async i=>{var e,s;_.value=!0,await T(),i&&((e=d.value)==null||e.setFormData({pid:i})),(s=d.value)==null||s.open("add")},R=async i=>{var e,s;_.value=!0,await T(),(e=d.value)==null||e.open("edit"),(s=d.value)==null||s.getDetail(i)},$=async i=>{await S.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await I({id:i}),E()},A=()=>{k=!k,h(C.lists,k)},h=(i,e=!0)=>{var s;for(const l in i)(s=g.value)==null||s.toggleRowExpansion(i[l],e),i[l].children&&h(i[l].children,e)};return E(),(i,e)=>{const s=H,l=O,u=z,B=V,L=G,U=K,c=W("perms"),M=P;return a(),y("div",X,[n(U,{class:"!border-none",shadow:"never"},{default:o(()=>[D("div",null,[f((a(),r(l,{type:"primary",onClick:e[0]||(e[0]=t=>w())},{icon:o(()=>[n(s,{name:"el-icon-Plus"})]),default:o(()=>[e[2]||(e[2]=m(" \u65B0\u589E "))]),_:1})),[[c,["auth.menu/add"]]]),n(l,{onClick:A},{default:o(()=>e[3]||(e[3]=[m(" \u5C55\u5F00/\u6298\u53E0 ")])),_:1})]),f((a(),r(L,{ref_key:"tableRef",ref:g,class:"mt-4",size:"large",data:p(C).lists,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:o(()=>[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:o(({row:t})=>[t.type==p(v).CATALOGUE?(a(),y("div",Y,"\u76EE\u5F55")):t.type==p(v).MENU?(a(),y("div",Z,"\u83DC\u5355")):t.type==p(v).BUTTON?(a(),y("div",ee,"\u6309\u94AE")):b("",!0)]),_:1}),n(u,{label:"\u56FE\u6807",prop:"icon","min-width":"80"},{default:o(({row:t})=>[D("div",te,[n(s,{name:t.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:o(({row:t})=>[t.is_disable==0?(a(),r(B,{key:0},{default:o(()=>e[4]||(e[4]=[m("\u6B63\u5E38")])),_:1})):(a(),r(B,{key:1,type:"danger"},{default:o(()=>e[5]||(e[5]=[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:o(({row:t})=>[t.type!==p(v).BUTTON?f((a(),r(l,{key:0,type:"primary",link:"",onClick:F=>w(t.id)},{default:o(()=>e[6]||(e[6]=[m(" \u65B0\u589E ")])),_:2},1032,["onClick"])),[[c,["auth.menu/add"]]]):b("",!0),f((a(),r(l,{type:"primary",link:"",onClick:F=>R(t)},{default:o(()=>e[7]||(e[7]=[m(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[c,["auth.menu/edit"]]]),f((a(),r(l,{type:"danger",link:"",onClick:F=>$(t.id)},{default:o(()=>e[8]||(e[8]=[m(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[c,["auth.menu/delete"]]])]),_:1})]),_:1},8,["data"])),[[M,p(C).loading]])]),_:1}),p(_)?(a(),r(q,{key:0,ref_key:"editRef",ref:d,onSuccess:p(E),onClose:e[1]||(e[1]=t=>_.value=!1)},null,8,["onSuccess"])):b("",!0)])}}});export{Se as default};
