马宇豪
2024-01-05 6a33c71f381aec0dbc778f80527b62d343fd0146
1
var z=Object.defineProperty;var y=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var w=(u,e,l)=>e in u?z(u,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[e]=l,h=(u,e)=>{for(var l in e||(e={}))S.call(e,l)&&w(u,l,e[l]);if(y)for(var l of y(e))T.call(e,l)&&w(u,l,e[l]);return u};import{_ as V,b as x,d as N,c as k,E as _,S as v,i as A}from"./index.1683511265143.js";import O from"./menuDialog.1683511265143.js";import{u as G}from"./index.16835112651437.js";import{J,f as Q,a1 as U,k as W,a4 as X,a as b,Y as t,R as a,a5 as s,o as B,b as E,F as Y,a8 as q,Q as H,X as m,W as c}from"./vue.1683511265143.js";import"./index.168351126514341.js";const K=J({name:"systemMenu",components:{menuDialog:O},filters:{parseRole:u=>["1","2"]},setup(){const u=Q();x();const e=U({projectId:"1",menuData:[],roleList:[],menuTableData:[],projectList:[{id:"1",name:"\u5B89\u5168\u57FA\u7840\u4FE1\u606F\u7CFB\u7EDF",key:0},{id:"2",name:"\u667A\u80FD\u5B89\u5168\u53CC\u91CD\u9884\u9632\u7CFB\u7EDF",key:1},{id:"3",name:"\u667A\u80FD\u5B89\u5168\u7279\u6B8A\u4F5C\u4E1A\u7CFB\u7EDF",key:2},{id:"4",name:"\u667A\u80FD\u5B89\u5168\u5DE1\u68C0\u7CFB\u7EDF",key:3},{id:"5",name:"\u667A\u80FD\u5B89\u5168\u98CE\u9669\u7EFC\u5408\u9884\u8B66\u9884\u62A5\u5E73\u53F0",key:4},{id:"6",name:"\u5E94\u6025\u7BA1\u7406\u7CFB\u7EDF",key:5},{id:"7",name:"\u5B89\u5168\u76EE\u6807\u8D23\u4EFB\u7BA1\u7406\u7CFB\u7EDF",key:6},{id:"8",name:"\u5B89\u5168\u4E8B\u6545\u7BA1\u7406\u7CFB\u7EDF",key:7},{id:"9",name:"\u8BBE\u5907\u7EFC\u5408\u7BA1\u63A7\u7CFB\u7EDF",key:8},{id:"10",name:"\u5B89\u5168\u77E5\u8BC6\u56FE\u8C31\u7CFB\u7EDF",key:9},{id:"11",name:"\u667A\u80FD\u5B89\u5168\u5371\u9669\u5316\u5B66\u54C1\u5168\u751F\u547D\u5468\u671F\u7BA1\u63A7\u7CFB\u7EDF",key:10}]}),l=(n,r)=>{u.value.openDialog(n,r,e.projectList,e.projectId,e.roleList)},D=n=>{N.confirm(`\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u8DEF\u7531\uFF1A${n.path}, \u662F\u5426\u7EE7\u7EED?`,"\u63D0\u793A",{confirmButtonText:"\u5220\u9664",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{let r=await k().deleteMenu({id:n.id});r.data.code==="200"?(_({type:"success",duration:2e3,message:"\u5220\u9664\u6210\u529F"}),await p(),v.get("projectId")==e.projectId&&await A()):_({type:"warning",message:r.data.msg})}).catch(()=>{})},p=async()=>{let n=await k().getMenuAdmin(e.projectId);n.data.code==="200"?(e.menuTableData=n.data.data,v.get("projectId")==e.projectId&&await A()):_({type:"warning",message:n.data.msg})},C=async()=>{let n=await G().getRoleList();n.data.code==="200"?e.roleList=n.data.data:_({type:"warning",message:n.data.msg})},f=n=>n.map(F=>{for(let i in e.roleList)if(e.roleList[i].roleCode===F)return e.roleList[i].roleName});return W(()=>{p(),C(),console.log(1)}),h({parseRole:f,getMenuList:p,menuDialog:u,onOpenMenuDialog:l,deleteMenu:D},X(e))}}),P={class:"system-menu-container"},Z={class:"system-menu-search mb15"},ee=c(" \u67E5\u8BE2 "),ue=c(" \u65B0\u589E\u83DC\u5355 "),te={class:"ml10"},oe=c("\u65B0\u589E"),ae=c("\u4FEE\u6539"),ne=c("\u5220\u9664");function le(u,e,l,D,p,C){const f=s("el-option"),n=s("el-select"),r=s("ele-Search"),F=s("el-icon"),i=s("el-button"),L=s("ele-FolderAdd"),M=s("SvgIcon"),d=s("el-table-column"),j=s("el-tag"),I=s("el-table"),$=s("el-card"),R=s("menuDialog");return B(),b("div",P,[t($,{shadow:"hover"},{default:a(()=>[E("div",Z,[t(n,{size:"default",modelValue:u.projectId,"onUpdate:modelValue":e[0]||(e[0]=o=>u.projectId=o),placeholder:"\u8BF7\u9009\u62E9\u9879\u76EE\u540D\u79F0",style:{"min-width":"350px"},onChange:e[1]||(e[1]=o=>u.getMenuList())},{default:a(()=>[(B(!0),b(Y,null,q(u.projectList,o=>(B(),H(f,{key:o.key,value:o.id,label:o.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),t(i,{size:"default",type:"primary",class:"ml10",onClick:u.getMenuList},{default:a(()=>[t(F,null,{default:a(()=>[t(r)]),_:1}),ee]),_:1},8,["onClick"]),t(i,{size:"default",type:"success",class:"ml10",onClick:e[2]||(e[2]=o=>u.onOpenMenuDialog("\u65B0\u589E"))},{default:a(()=>[t(F,null,{default:a(()=>[t(L)]),_:1}),ue]),_:1})]),t(I,{data:u.menuTableData,style:{width:"100%"},"row-key":"path","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:a(()=>[t(d,{label:"\u83DC\u5355\u540D\u79F0","show-overflow-tooltip":""},{default:a(o=>[t(M,{name:o.row.meta.icon},null,8,["name"]),E("span",te,m(o.row.meta.title),1)]),_:1}),t(d,{prop:"path",label:"\u8DEF\u7531\u8DEF\u5F84","show-overflow-tooltip":""}),t(d,{label:"\u7EC4\u4EF6\u8DEF\u5F84","show-overflow-tooltip":""},{default:a(o=>[E("span",null,m(o.row.component),1)]),_:1}),t(d,{label:"\u6743\u9650\u6807\u8BC6","show-overflow-tooltip":""},{default:a(o=>[E("span",null,m(u.parseRole(o.row.meta.roles)),1)]),_:1}),t(d,{label:"\u6392\u5E8F","show-overflow-tooltip":"",width:"80"},{default:a(o=>[c(m(o.$index),1)]),_:1}),t(d,{label:"\u7C7B\u578B","show-overflow-tooltip":"",width:"80"},{default:a(o=>[t(j,{type:"success",size:"small"},{default:a(()=>[c(m(o.row.xx)+"\u83DC\u5355",1)]),_:2},1024)]),_:1}),t(d,{label:"\u64CD\u4F5C","show-overflow-tooltip":"",width:"140"},{default:a(o=>[t(i,{size:"small",text:"",type:"primary",onClick:e[3]||(e[3]=g=>u.onOpenMenuDialog("\u65B0\u589E"))},{default:a(()=>[oe]),_:1}),t(i,{size:"small",text:"",type:"primary",onClick:g=>u.onOpenMenuDialog("\u4FEE\u6539",o.row)},{default:a(()=>[ae]),_:2},1032,["onClick"]),t(i,{size:"small",style:{color:"red"},text:"",type:"primary",onClick:g=>u.deleteMenu(o.row)},{default:a(()=>[ne]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1}),t(R,{ref:"menuDialog",onGetMenuList:u.getMenuList},null,8,["onGetMenuList"])])}var pe=V(K,[["render",le]]);export{pe as default};