2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
import{$ as O,w as V,M as z,N as P,L as S,O as G}from"./element-plus.91c68cc0.js";import{M as v,f as K,b as Q}from"./index.3110f7ca.js";import{e as j,a as q}from"./menu.8ea580dc.js";import{u as H}from"./usePaging.f8c888e4.js";import{_ as I}from"./edit.vue_vue_type_script_setup_true_lang.59621c2f.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.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.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.3a4b27f9.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"}),Ke=N({...oe,setup(ie){const g=x(),d=x();let k=!1;const _=J(!1),{pager:C,getLists:E}=H({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")},$=async i=>{var e,s;_.value=!0,await T(),(e=d.value)==null||e.open("edit"),(s=d.value)==null||s.getDetail(i)},R=async i=>{await K.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await j({id:i}),E()},L=()=>{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=Q,l=V,u=z,B=O,A=P,M=S,c=W("perms"),U=G;return a(),y("div",X,[n(M,{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:L},{default:o(()=>e[3]||(e[3]=[m(" \u5C55\u5F00/\u6298\u53E0 ")])),_:1})]),f((a(),r(A,{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=>$(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=>R(t.id)},{default:o(()=>e[8]||(e[8]=[m(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[c,["auth.menu/delete"]]])]),_:1})]),_:1},8,["data"])),[[U,p(C).loading]])]),_:1}),p(_)?(a(),r(I,{key:0,ref_key:"editRef",ref:d,onSuccess:p(E),onClose:e[1]||(e[1]=t=>_.value=!1)},null,8,["onSuccess"])):b("",!0)])}}});export{Ke as default};
|