fix: 修复2个tab只给其中一个tab权限接口提示报错问题

This commit is contained in:
“huailei000”
2022-03-18 17:05:21 +08:00
committed by Jiangjie.Bai
parent 26ba2c091e
commit b22b01529a
3 changed files with 20 additions and 39 deletions

View File

@@ -1,21 +1,14 @@
<template>
<TabPage :active-menu.sync="config.activeMenu" :submenu="config.submenu">
<keep-alive>
<component :is="config.activeMenu" />
</keep-alive>
</TabPage>
<TabPage :active-menu.sync="config.activeMenu" :submenu="config.submenu" />
</template>
<script>
import { TabPage } from '@/layout/components'
import AssetChangeAuthPlanList from './AssetChangeAuthPlan/ChangeAuthPlanList'
import AppChangeAuthPlanList from './AppChangeAuthPlan/AppChangeAuthPlanList'
export default {
name: 'Index',
components: {
TabPage,
AssetChangeAuthPlanList,
AppChangeAuthPlanList
TabPage
},
data() {
return {
@@ -25,13 +18,14 @@ export default {
{
title: this.$t('xpack.ChangeAuthPlan.AssetChangeAuthPlan'),
name: 'AssetChangeAuthPlanList',
hidden: () => !this.$hasPerm('xpack.view_changeauthplan')
hidden: () => !this.$hasPerm('xpack.view_changeauthplan'),
component: () => import('@/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanList.vue')
},
{
title: this.$t('xpack.ChangeAuthPlan.AppChangeAuthPlan'),
name: 'AppChangeAuthPlanList',
hidden: () => !this.$hasPerm('xpack.view_applicationchangeauthplan')
hidden: () => !this.$hasPerm('xpack.view_applicationchangeauthplan'),
component: () => import('@/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanList.vue')
}
]
}

View File

@@ -1,21 +1,14 @@
<template>
<TabPage :active-menu.sync="config.activeMenu" :submenu="config.submenu">
<keep-alive>
<component :is="config.activeMenu" />
</keep-alive>
</TabPage>
<TabPage :active-menu.sync="config.activeMenu" :submenu="config.submenu" />
</template>
<script>
import { TabPage } from '@/layout/components'
import GatheredUserList from './GatheredUserList'
import TaskList from './TaskList'
export default {
name: 'Index',
components: {
TabPage,
GatheredUserList,
TaskList
TabPage
},
data() {
return {
@@ -25,12 +18,14 @@ export default {
{
title: this.$t('xpack.GatherUser.GatherUserList'),
name: 'GatheredUserList',
hidden: !this.$hasPerm('assets.view_gathereduser')
hidden: !this.$hasPerm('assets.view_gathereduser'),
component: () => import('@/views/accounts/GatheredUser/GatheredUserList.vue')
},
{
title: this.$t('xpack.GatherUser.GatherUserTaskList'),
name: 'TaskList',
hidden: !this.$hasPerm('xpack.view_gatherusertask')
hidden: !this.$hasPerm('xpack.view_gatherusertask'),
component: () => import('@/views/accounts/GatheredUser/TaskList.vue')
}
]
}

View File

@@ -3,22 +3,16 @@
<div slot="title">
{{ Title }}
</div>
<keep-alive exclude="SysRoleList,OrgRoleList">
<component :is="config.activeMenu" />
</keep-alive>
</TabPage>
</template>
<script>
import { TabPage } from '@/layout/components'
import OrgRoleList from './OrgRoleList'
import SysRoleList from './SysRoleList'
export default {
name: 'Index',
components: {
TabPage,
SysRoleList,
OrgRoleList
TabPage
},
data() {
return {
@@ -28,16 +22,14 @@ export default {
{
title: this.$t('route.SystemRole'),
name: 'SysRoleList',
hidden: () => {
return !this.$hasPerm('rbac.view_systemrole')
}
hidden: () => !this.$hasPerm('rbac.view_systemrole'),
component: () => import('@/views/users/Role/RoleList/SysRoleList.vue')
},
{
title: this.$t('route.OrgRole'),
name: 'OrgRoleList',
hidden: () => {
return !this.$store.getters.hasValidLicense || !this.$hasPerm('rbac.view_orgrole')
}
hidden: () => !this.$store.getters.hasValidLicense || !this.$hasPerm('rbac.view_orgrole'),
component: () => import('@/views/users/Role/RoleList/OrgRoleList.vue')
}
]
}