fix: 切换组织组件修改判断,有创建或者查看权限时才显示组织管理分组

This commit is contained in:
“huailei000”
2022-03-09 16:23:56 +08:00
committed by 老广
parent c63a4fc672
commit d27d0f1e1a

View File

@@ -59,8 +59,11 @@ export default {
])
},
created() {
this.orgOption = [
{
this.init()
},
methods: {
init() {
const actionObject = {
label: this.$t('xpack.Organization.OrganizationList'),
options: [{
id: 'create',
@@ -73,14 +76,16 @@ export default {
disabled: !this.$hasPerm('orgs.view_organization'),
name: this.$t('xpack.Organization.OrganizationLists')
}]
},
{
label: this.$t('xpack.Organization.AllOrganization'),
options: this.orgs
}
]
},
methods: {
const hasPerms = this.$hasPerm('orgs.view_organization') || this.$hasPerm('xpack.Organization.OrganizationCreate')
this.orgOption = [
(hasPerms && actionObject),
{
label: this.$t('xpack.Organization.AllOrganization'),
options: this.orgs
}
]
},
changeOrg(orgId) {
if (orgId === 'create') {
this.$router.push({ name: 'OrganizationCreate' })