feat: 开源版用户列表隐藏角色和组织

This commit is contained in:
fit2cloud-chenyw 2021-11-01 14:09:41 +08:00
parent ab28111e18
commit 1d6467f54f
2 changed files with 18 additions and 7 deletions

View File

@ -32,7 +32,7 @@
<el-radio :label="0">{{ $t('commons.disable') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('commons.organization')" prop="deptId">
<el-form-item v-show="isPluginLoaded" :label="$t('commons.organization')" prop="deptId">
<treeselect
ref="deptTreeSelect"
v-model="form.deptId"
@ -43,7 +43,7 @@
@open="filterData"
/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-form-item v-show="isPluginLoaded" :label="$t('commons.role')" prop="roleIds">
<el-select
ref="roleSelect"
v-model="form.roleIds"
@ -76,6 +76,7 @@ import LayoutContent from '@/components/business/LayoutContent'
import { PHONE_REGEX } from '@/utils/validate'
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
import { addUser, editUser, allRoles } from '@/api/system/user'
import { pluginLoaded } from '@/api/user'
export default {
components: { LayoutContent },
@ -155,7 +156,8 @@ export default {
roles: [],
roleDatas: [],
userRoles: [],
formType: 'add'
formType: 'add',
isPluginLoaded: false
}
},
@ -174,6 +176,11 @@ export default {
destroyed() {
this.unBindKey()
},
beforeCreate() {
pluginLoaded().then(res => {
this.isPluginLoaded = res.success && res.data
})
},
methods: {
entryKey(event) {
const keyCode = event.keyCode

View File

@ -27,12 +27,12 @@
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" sortable="custom" :label="$t('commons.organization')">
<el-table-column v-if="isPluginLoaded" :show-overflow-tooltip="true" prop="dept" sortable="custom" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept && scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="roles" :label="$t('commons.role')">
<el-table-column v-if="isPluginLoaded" prop="roles" :label="$t('commons.role')">
<template slot-scope="scope">
<div v-if="scope.row.roles && scope.row.roles.length <= 2">
<div v-for="role in scope.row.roles" :key="role.roleId">{{ role.roleName }}</div>
@ -174,7 +174,7 @@ import { PHONE_REGEX } from '@/utils/validate'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { ldapStatus } from '@/api/user'
import { ldapStatus, pluginLoaded } from '@/api/user'
import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user'
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
@ -306,7 +306,8 @@ export default {
},
orderConditions: [],
last_condition: null,
openLdap: false
openLdap: false,
isPluginLoaded: false
}
},
mounted() {
@ -317,6 +318,9 @@ export default {
ldapStatus().then(res => {
this.openLdap = res.success && res.data
})
pluginLoaded().then(res => {
this.isPluginLoaded = res.success && res.data
})
},
methods: {
sortChange({ column, prop, order }) {