fix: 修改角色详情区分系统角色、组织角色;修改邀请用户时的用户名称显示

This commit is contained in:
Jiangjie.Bai
2022-03-07 15:05:06 +08:00
committed by Jiangjie.Bai
parent c93b1a6769
commit 69d963f2a9
3 changed files with 21 additions and 5 deletions

View File

@@ -37,6 +37,11 @@ export default {
type: Object,
required: true
},
titlePrefix: {
type: String,
required: false,
default: ''
},
title: {
type: String,
default: ''
@@ -66,12 +71,11 @@ export default {
getTitle: {
type: Function,
default: function(obj) {
const objectType = this.$route.meta.title
.replace('Detail', '')
.replace('详情', '')
const objectType = this.$route.meta.title.replace('Detail', '').replace('详情', '')
this.$log.debug('Object is: ', obj)
const titlePrefix = this.titlePrefix || objectType
const objectName = this.getObjectName(obj)
let title = `${objectType}: ${objectName}`
let title = `${titlePrefix}: ${objectName}`
if (title.length > 80) {
title = title.slice(0, 80) + '...'
}

View File

@@ -26,11 +26,18 @@ export default {
const vm = this
const scope = this.$route.query['scope']
const scopeRole = `${scope}role`
let titlePrefix = ''
if (scope === 'org') {
titlePrefix = vm.$t('route.OrgRole')
} else if (scope === 'system') {
titlePrefix = vm.$t('route.SystemRole')
}
return {
scope: scope,
scopeRole: scope + 'role',
role: { name: '', comment: '', users: [] },
config: {
titlePrefix: titlePrefix,
url: `/api/v1/rbac/${scope}-roles`,
activeMenu: 'RoleInfo',
actions: {

View File

@@ -19,6 +19,7 @@ import Dialog from '@/components/Dialog'
import { Select2 } from '@/components'
import { GenericCreateUpdateForm } from '@/layout/components'
import { mapGetters } from 'vuex'
import rules from '@/components/DataForm/rules'
export default {
components: {
Dialog,
@@ -48,11 +49,15 @@ export default {
component: Select2,
el: {
ajax: {
url: '/api/v1/users/users/suggestions/?oid=root'
url: '/api/v1/users/users/suggestions/?oid=root',
transformOption: (item) => {
return { label: `${item.name}(${item.username})`, value: item.id }
}
}
}
},
org_roles: {
rules: [rules.RequiredChange],
component: Select2,
el: {
ajax: {