mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-12 14:39:07 +00:00
perf: 优化用户中角色显示问题
This commit is contained in:
parent
2274b65d83
commit
dd4aed9cf4
@ -9,7 +9,6 @@
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
import UserPassword from '@/components/UserPassword'
|
||||
import RoleCheckbox from '@/views/users/User/components/RoleCheckbox'
|
||||
import { mapGetters } from 'vuex'
|
||||
import rules from '@/components/DataForm/rules'
|
||||
|
||||
export default {
|
||||
@ -82,7 +81,7 @@ export default {
|
||||
role: {
|
||||
label: this.$t('users.SuperRole'),
|
||||
hidden: () => {
|
||||
return !this.currentOrgIsRoot && this.publicSettings.role === 'Admin'
|
||||
return !this.$store.getters.currentUserIsSuperAdmin
|
||||
}
|
||||
},
|
||||
org_roles: {
|
||||
@ -90,10 +89,10 @@ export default {
|
||||
label: this.$t('users.OrgRole'),
|
||||
component: RoleCheckbox,
|
||||
hidden: () => {
|
||||
return !this.publicSettings.XPACK_LICENSE_IS_VALID
|
||||
return !this.$store.getters.hasValidLicense
|
||||
},
|
||||
el: {
|
||||
disabled: false,
|
||||
disabled: this.$store.getters.currentOrgIsRoot,
|
||||
rule: []
|
||||
},
|
||||
helpText: this.$t('users.HelpText.OrgRoleHelpText')
|
||||
@ -110,14 +109,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['publicSettings', 'currentOrgIsRoot'])
|
||||
},
|
||||
mounted() {
|
||||
if (this.currentOrgIsRoot) {
|
||||
this.fieldsMeta.org_roles.el.disabled = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cleanFormValue(value) {
|
||||
const method = this.getMethod()
|
||||
|
Loading…
Reference in New Issue
Block a user