更新用户管理的租户数据源
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
updateUser,
|
||||
addUser,
|
||||
} from '@/api/system/user';
|
||||
import { deptTreeSelect } from '@/api/system/tenant';
|
||||
import { listDept } from '@/api/system/tenant';
|
||||
|
||||
import { saveAs } from 'file-saver';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
@@ -34,6 +34,8 @@ import useDictStore from '@/store/modules/dict';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { parseDataToTree } from '@/utils/parse-tree-utils';
|
||||
|
||||
const { getDict } = useDictStore();
|
||||
const userStore = useUserStore();
|
||||
const { t } = useI18n();
|
||||
@@ -767,9 +769,19 @@ let deptTreeData = ref<DataNode[]>([]);
|
||||
/**查询部门下拉树结构 */
|
||||
function fnGetDeptTree() {
|
||||
if (deptTreeData.value.length > 0) return;
|
||||
deptTreeSelect().then(res => {
|
||||
listDept({ parentId: 0 }).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
deptTreeData.value = res.data;
|
||||
res.data.forEach((item: any) => {
|
||||
if (item.parentId === '0') {
|
||||
deptTreeData.value.push({
|
||||
childern: undefined,
|
||||
title: item.tenantName,
|
||||
key: item.tenantId,
|
||||
...item,
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log(deptTreeData.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -816,11 +828,11 @@ onMounted(() => {
|
||||
:tree-data="deptTreeData"
|
||||
:field-names="{
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
label: 'tenantName',
|
||||
value: 'tenantId',
|
||||
}"
|
||||
tree-node-label-prop="label"
|
||||
tree-node-filter-prop="label"
|
||||
tree-node-label-prop="tenantName"
|
||||
tree-node-filter-prop="tenantName"
|
||||
style="width: 100%"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
@@ -1236,8 +1248,8 @@ onMounted(() => {
|
||||
:tree-data="deptTreeData"
|
||||
:field-names="{
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
label: 'tenantName',
|
||||
value: 'tenantId',
|
||||
}"
|
||||
tree-node-label-prop="label"
|
||||
style="width: 100%"
|
||||
@@ -1443,11 +1455,11 @@ onMounted(() => {
|
||||
:tree-data="deptTreeData"
|
||||
:field-names="{
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
label: 'tenantName',
|
||||
value: 'tenantId',
|
||||
}"
|
||||
tree-node-label-prop="label"
|
||||
tree-node-filter-prop="label"
|
||||
tree-node-label-prop="tenantName"
|
||||
tree-node-filter-prop="tenantName"
|
||||
style="width: 100%"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
|
||||
Reference in New Issue
Block a user