2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
|
import{a6 as O,w as V,O as P,P as z,I as Q,Q as S}from"./element-plus.10e48c93.js";import{M as h,f as G,b as I}from"./index.8f8edf86.js";import{e as K,a as j}from"./menu.0d2cce12.js";import{u as q}from"./usePaging.60d02673.js";import{_ as H}from"./edit.vue_vue_type_script_setup_true_lang.e0116257.js";import{d as N,s as x,r as J,af as W,o as i,c as v,U as n,L as o,a as D,M as c,K as r,R as m,u as p,Q as E,n as T}from"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.c80b8015.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.vue_vue_type_script_setup_true_lang.d1a762b5.js";import"./index.6302064d.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";const X={class:"menu-lists"},Y={key:0},Z={key:1},ee={key:2},te={class:"flex"},oe=N({name:"menu"}),Ie=N({...oe,setup(ae){const b=x(),d=x();let y=!1;const _=J(!1),{pager:k,getLists:C}=q({fetchFun:j,params:{page_type:0}}),g=async e=>{var a,s;_.value=!0,await T(),e&&((a=d.value)==null||a.setFormData({pid:e})),(s=d.value)==null||s.open("add")},R=async e=>{var a,s;_.value=!0,await T(),(a=d.value)==null||a.open("edit"),(s=d.value)==null||s.getDetail(e)},$=async e=>{await G.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await K({id:e}),C()},A=()=>{y=!y,w(k.lists,y)},w=(e,a=!0)=>{var s;for(const l in e)(s=b.value)==null||s.toggleRowExpansion(e[l],a),e[l].children&&w(e[l].children,a)};return C().then(e=>{console.log(e)}),(e,a)=>{const s=I,l=V,u=P,B=O,L=z,U=Q,f=W("perms"),M=S;return i(),v("div",X,[n(U,{class:"!border-none",shadow:"never"},{default:o(()=>[D("div",null,[c((i(),r(l,{type:"primary",onClick:a[0]||(a[0]=t=>g())},{icon:o(()=>[n(s,{name:"el-icon-Plus"})]),default:o(()=>[m(" \u65B0\u589E ")]),_:1})),[[f,["auth.menu/add"]]]),n(l,{onClick:A},{default:o(()=>[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: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(h).CATALOGUE?(i(),v("div",Y,"\u76EE\u5F55")):t.type==p(h).MENU?(i(),v("div",Z,"\u83DC\u5355")):t.type==p(h).BUTTON?(i(),v("div",ee,"\u6309\u94AE")):E("",!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?(i(),r(B,{key:0},{default:o(()=>[m("\u6B63\u5E38")]),_:1})):(i(),r(B,{key:1,type:"danger"},{default:o(()=>[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(h).BUTTON?c((i(),r(l,{key:0,type:"primary",link:"",onClick:F=>g(t.id)},{default:o(()=>[m(" \u65B0\u589E ")]),_:2},1032,["onClick"])),[[f,["auth.menu
|