2024-09-19 11:09:33 +08:00
|
|
|
import{a1 as O,w as V,M as P,N as z,J as S,O as G}from"./element-plus.6b125791.js";import{M as h,f as J,b as Q}from"./index.8eb121a3.js";import{e as W,a as j}from"./menu.f927f040.js";import{u as q}from"./usePaging.fff444fa.js";import{_ as H}from"./edit.vue_vue_type_script_setup_true_lang.736ec5fc.js";import{d as N,s as x,r as I,ap as K,o as i,c as v,W as n,Q as t,a as T,R as c,P as r,U as m,u as p,T as E,n as D}from"./@vue.340249d8.js";import"./lodash-es.edba6135.js";import"./@vueuse.e3650918.js";import"./@element-plus.558a564d.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.6b964ca4.js";import"./axios.ebd1d4d0.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.ab1d8f92.js";import"./vue-router.9ddb0e92.js";import"./pinia.97fe9b12.js";import"./css-color-function.7a4c1284.js";import"./color.10b8b3bd.js";import"./clone.623e4e2d.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.518a19eb.js";import"./vue-clipboard3.c098b37d.js";import"./clipboard.a67a48a7.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.309a94da.js";import"./picker.vue_vue_type_script_setup_true_lang.988ce2f6.js";import"./index.7acb2098.js";const X={class:"menu-lists"},Y={key:0},Z={key:1},ee={key:2},te={class:"flex"},oe=N({name:"menu"}),Ge=N({...oe,setup(ae){const b=x(),d=x();let y=!1;const _=I(!1),{pager:k,getLists:C}=q({fetchFun:j,params:{page_type:0}}),g=async a=>{var o,s;_.value=!0,await D(),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 D(),(o=d.value)==null||o.open("edit"),(s=d.value)==null||s.getDetail(a)},$=async a=>{await J.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await W({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=V,u=P,B=O,U=z,L=S,f=K("perms"),M=G;return i(),v("div",X,[n(L,{class:"!border-none",shadow:"never"},{default:t(()=>[T("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(U,{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})=>[T("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,["o
|