mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
fix: 切换组织组件修改判断,有创建或者查看权限时才显示组织管理分组
This commit is contained in:
@@ -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' })
|
||||
|
Reference in New Issue
Block a user