perf: 优化全局组织 (#621)

* feat: 默认组织改为实体组织

* perf: 优化在root组织下,应不能创建

* perf: 优化全局组织

* perf: 优化组织选择

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2021-03-03 14:47:44 +08:00
committed by GitHub
parent 4ee32dd51b
commit 6fde735cbd
28 changed files with 170 additions and 90 deletions

View File

@@ -29,7 +29,10 @@ export default {
},
fields: [
[this.$t('users.Account'), ['name', 'username', 'email', 'groups']],
[this.$t('users.Authentication'), ['password_strategy', 'update_password', 'password', 'set_public_key', 'public_key', 'mfa_level', 'source']],
[this.$t('users.Authentication'), [
'password_strategy', 'update_password', 'password', 'set_public_key',
'public_key', 'mfa_level', 'source'
]],
[this.$t('users.Secure'), ['role', 'org_roles', 'date_expired']],
[this.$t('common.Other'), ['phone', 'wechat', 'comment']]
],
@@ -80,7 +83,7 @@ export default {
role: {
label: this.$t('users.SuperRole'),
hidden: () => {
return !this.currentOrgIsDefault && this.publicSettings.role === 'Admin'
return !this.currentOrgIsRoot && this.publicSettings.role === 'Admin'
}
},
org_roles: {
@@ -88,7 +91,7 @@ export default {
label: this.$t('users.OrgRole'),
component: RoleCheckbox,
hidden: () => {
return (!this.publicSettings.XPACK_LICENSE_IS_VALID)
return !this.publicSettings.XPACK_LICENSE_IS_VALID
},
el: {
disabled: false,
@@ -109,13 +112,10 @@ export default {
}
},
computed: {
...mapGetters(['publicSettings', 'currentOrg']),
currentOrgIsDefault() {
return this.currentOrg.id === 'DEFAULT' || this.currentOrg.id === ''
}
...mapGetters(['publicSettings', 'currentOrgIsRoot'])
},
mounted() {
if (this.currentOrgIsDefault) {
if (this.currentOrgIsRoot) {
this.fieldsMeta.org_roles.el.disabled = true
}
},