forked from github/dataease
feat: 开源版用户列表隐藏角色和组织
This commit is contained in:
parent
ab28111e18
commit
1d6467f54f
@ -32,7 +32,7 @@
|
|||||||
<el-radio :label="0">{{ $t('commons.disable') }}</el-radio>
|
<el-radio :label="0">{{ $t('commons.disable') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</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
|
<treeselect
|
||||||
ref="deptTreeSelect"
|
ref="deptTreeSelect"
|
||||||
v-model="form.deptId"
|
v-model="form.deptId"
|
||||||
@ -43,7 +43,7 @@
|
|||||||
@open="filterData"
|
@open="filterData"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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
|
<el-select
|
||||||
ref="roleSelect"
|
ref="roleSelect"
|
||||||
v-model="form.roleIds"
|
v-model="form.roleIds"
|
||||||
@ -76,6 +76,7 @@ import LayoutContent from '@/components/business/LayoutContent'
|
|||||||
import { PHONE_REGEX } from '@/utils/validate'
|
import { PHONE_REGEX } from '@/utils/validate'
|
||||||
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
|
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
|
||||||
import { addUser, editUser, allRoles } from '@/api/system/user'
|
import { addUser, editUser, allRoles } from '@/api/system/user'
|
||||||
|
import { pluginLoaded } from '@/api/user'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { LayoutContent },
|
components: { LayoutContent },
|
||||||
@ -155,7 +156,8 @@ export default {
|
|||||||
roles: [],
|
roles: [],
|
||||||
roleDatas: [],
|
roleDatas: [],
|
||||||
userRoles: [],
|
userRoles: [],
|
||||||
formType: 'add'
|
formType: 'add',
|
||||||
|
isPluginLoaded: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -174,6 +176,11 @@ export default {
|
|||||||
destroyed() {
|
destroyed() {
|
||||||
this.unBindKey()
|
this.unBindKey()
|
||||||
},
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
pluginLoaded().then(res => {
|
||||||
|
this.isPluginLoaded = res.success && res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
entryKey(event) {
|
entryKey(event) {
|
||||||
const keyCode = event.keyCode
|
const keyCode = event.keyCode
|
||||||
|
@ -27,12 +27,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column :show-overflow-tooltip="true" prop="email" :label="$t('commons.email')" />
|
<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">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.dept && scope.row.dept.deptName }}</div>
|
<div>{{ scope.row.dept && scope.row.dept.deptName }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.roles && scope.row.roles.length <= 2">
|
<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>
|
<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 { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
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 { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user'
|
||||||
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
|
import { getDeptTree, treeByDeptId } from '@/api/system/dept'
|
||||||
|
|
||||||
@ -306,7 +306,8 @@ export default {
|
|||||||
},
|
},
|
||||||
orderConditions: [],
|
orderConditions: [],
|
||||||
last_condition: null,
|
last_condition: null,
|
||||||
openLdap: false
|
openLdap: false,
|
||||||
|
isPluginLoaded: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -317,6 +318,9 @@ export default {
|
|||||||
ldapStatus().then(res => {
|
ldapStatus().then(res => {
|
||||||
this.openLdap = res.success && res.data
|
this.openLdap = res.success && res.data
|
||||||
})
|
})
|
||||||
|
pluginLoaded().then(res => {
|
||||||
|
this.isPluginLoaded = res.success && res.data
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sortChange({ column, prop, order }) {
|
sortChange({ column, prop, order }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user