mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-26 15:07:04 +00:00
fix: 切换组织组件修改判断,有创建或者查看权限时才显示组织管理分组
This commit is contained in:
@@ -59,8 +59,11 @@ export default {
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.orgOption = [
|
this.init()
|
||||||
{
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
const actionObject = {
|
||||||
label: this.$t('xpack.Organization.OrganizationList'),
|
label: this.$t('xpack.Organization.OrganizationList'),
|
||||||
options: [{
|
options: [{
|
||||||
id: 'create',
|
id: 'create',
|
||||||
@@ -73,14 +76,16 @@ export default {
|
|||||||
disabled: !this.$hasPerm('orgs.view_organization'),
|
disabled: !this.$hasPerm('orgs.view_organization'),
|
||||||
name: this.$t('xpack.Organization.OrganizationLists')
|
name: this.$t('xpack.Organization.OrganizationLists')
|
||||||
}]
|
}]
|
||||||
},
|
}
|
||||||
|
const hasPerms = this.$hasPerm('orgs.view_organization') || this.$hasPerm('xpack.Organization.OrganizationCreate')
|
||||||
|
this.orgOption = [
|
||||||
|
(hasPerms && actionObject),
|
||||||
{
|
{
|
||||||
label: this.$t('xpack.Organization.AllOrganization'),
|
label: this.$t('xpack.Organization.AllOrganization'),
|
||||||
options: this.orgs
|
options: this.orgs
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
changeOrg(orgId) {
|
changeOrg(orgId) {
|
||||||
if (orgId === 'create') {
|
if (orgId === 'create') {
|
||||||
this.$router.push({ name: 'OrganizationCreate' })
|
this.$router.push({ name: 'OrganizationCreate' })
|
||||||
|
Reference in New Issue
Block a user