修改权限bug
This commit is contained in:
@@ -4,16 +4,18 @@
|
||||
<el-container>
|
||||
<el-main class="nopadding">
|
||||
<el-menu class="menu mainMenu" :default-active="page">
|
||||
<el-menu-item-group v-for="group in menu" :key="group.groupName" :title="group.groupName">
|
||||
<div v-for="item in group.list" :key="item.component">
|
||||
<el-menu-item v-authSetup="item.actions" :index="item.component" @click="openPage">
|
||||
<el-icon v-if="item.icon"><component :is="item.icon"/></el-icon>
|
||||
<template #title>
|
||||
<span>{{item.title}}</span>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</div>
|
||||
</el-menu-item-group>
|
||||
<div v-for="group in menu" :key="group.groupName">
|
||||
<el-menu-item-group v-if="group.show" :title="group.groupName">
|
||||
<div v-for="item in group.list" :key="item.component">
|
||||
<el-menu-item v-authSetup="item.actions" :index="item.component" @click="openPage">
|
||||
<el-icon v-if="item.icon"><component :is="item.icon"/></el-icon>
|
||||
<template #title>
|
||||
<span>{{item.title}}</span>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</div>
|
||||
</el-menu-item-group>
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-main>
|
||||
</el-container>
|
||||
@@ -51,12 +53,13 @@ export default {
|
||||
menu: [
|
||||
{
|
||||
groupName: "账号设置",
|
||||
show:true,
|
||||
list: [
|
||||
{
|
||||
icon: "sc-icon-MachineRoom",
|
||||
title: "机房配置",
|
||||
component: "account",
|
||||
actions:'roomConfig'
|
||||
actions:'roomConfig',
|
||||
},
|
||||
{
|
||||
icon: "sc-icon-CostAllocation",
|
||||
@@ -68,6 +71,7 @@ export default {
|
||||
},
|
||||
{
|
||||
groupName: "数据管理",
|
||||
show:true,
|
||||
list: [
|
||||
{
|
||||
icon: "sc-icon-DataSource",
|
||||
@@ -110,6 +114,16 @@ export default {
|
||||
created() {
|
||||
const userInfo = this.$TOOL.data.get('USER_INFO');
|
||||
this.user.role = userInfo.user_roles && userInfo.user_roles.role_names.length>0?userInfo.user_roles.role_names[0]:'';
|
||||
const permissions = this.$TOOL.data.get("PERMISSIONS");
|
||||
this.menu.forEach(item=>{
|
||||
item.show = false;
|
||||
item.list.forEach(em=>{
|
||||
if(permissions.auth.indexOf(em.actions)!=-1){
|
||||
item.show = true;
|
||||
this.page = item.list[0].component
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
openPage(item){
|
||||
|
||||
Reference in New Issue
Block a user