-
+
{{ data.orgInfo?.orgName }}
-
-
+
{{ data.deptInfo?.deptName }}
@@ -87,7 +74,7 @@
import { formConfig, formConfig2 } from './config';
import { origanizemanage } from '/@/api/origanizemanage';
- defineOptions({ name: 'OrderListIndex' });
+ defineOptions({ name: 'UserManageIndex' });
const mainRef = ref();
const data = reactive({});
@@ -113,19 +100,21 @@
const casData = ref([]);
const formSchema2 = formConfig2(casData);
const treeData = ref([]);
+ const treeDataDept = ref([]);
const treeData2 = ref([]);
const userAuthList = ref([]);
- const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
+ // const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
+ const orgId = JSON.parse(sessionStorage.getItem('ORGID')!);
const orgTreeConfig = ref({
selectedKeys: ['0-0'],
defaultExpandAll: true,
api: origanizemanage.queryOrgTree,
- defaultParams: { orgId },
+ params: { orgId },
transform: (data) => {
- const otherOrg = data[0].listOrg;
+ const otherOrg = data[0]?.listOrg;
let treeData = [];
// 特殊处理
- if (data[0].orgInfo) {
+ if (data[0]?.orgInfo) {
treeData = data;
}
otherOrg?.map((item) => {
@@ -153,7 +142,7 @@
const deptTreeConfig = ref({
defaultExpandAll: true,
api: origanizemanage.queryDeptTree,
- defaultParams: { orgId },
+ params: { orgId },
header: {
title: '关联部门',
@@ -192,11 +181,11 @@
});
});
};
- getOrgTree();
+ // getOrgTree();
// 部门树
- fetch(origanizemanage.queryDeptTree).then((res) => {
- treeData2.value = res.data;
- });
+ // fetch(origanizemanage.queryDeptTree).then((res) => {
+ // treeData2.value = res.data;
+ // });
const onSearch = () => {
console.log(searchValue.value);
@@ -225,8 +214,10 @@
};
const handleSelect = (selectedKeys: any, info: any) => {
+ console.log(info);
+
fetch(origanizemanage.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => {
- treeData2.value = res.data;
+ treeDataDept.value = res.data;
});
tableFetch({ orgId: info.node?.orgInfo.orgId });
};
@@ -298,6 +289,7 @@
opMap.value.type = 'add';
setTimeout(() => {
formData.value = {
+ sex: '男',
orgName: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
};
userAuthList.value.splice(0);
@@ -350,30 +342,23 @@
customRender: (text: any) => {
return text.index + 1;
},
- sorter: {
- compare: (a, b) => a.address - b.address,
- },
+ sorter: true,
},
{
title: '账号',
dataIndex: 'accountNo',
- sorter: {
- compare: (a, b) => a.accountNo - b.accountNo,
- },
+ sorter: true,
},
{
title: '姓名',
dataIndex: 'realName',
- sorter: {
- compare: (a, b) => a.realName - b.realName,
- },
+ sorter: true,
},
{
title: '性别',
dataIndex: 'sex',
- sorter: {
- compare: (a, b) => a.name - b.name,
- },
+ sorter: true,
+ textNumber: 4,
},
{
title: '手机号',
@@ -381,11 +366,15 @@
},
{
title: '邮箱',
+ textNumber: 5,
+ textEllipsis: true,
dataIndex: 'email',
},
{
title: '组织关系',
dataIndex: 'orgName',
+ // textNumber: 9,
+ // textEllipsis: true,
},
{
title: '部门/角色',
diff --git a/lib/component/tree/props.ts b/lib/component/tree/props.ts
index 3b73358..a040b37 100644
--- a/lib/component/tree/props.ts
+++ b/lib/component/tree/props.ts
@@ -14,6 +14,7 @@ export const treeProps = {
type: [String, Object, Function] as PropType,
default: undefined,
},
+ treeData: PropTypes.array.def([]),
params: PropTypes.object.def(() => ({})),
dynamicParams: PropTypes.oneOfType([
PropTypes.string,
diff --git a/lib/component/tree/tree-api.vue b/lib/component/tree/tree-api.vue
index 4a859ea..4226722 100644
--- a/lib/component/tree/tree-api.vue
+++ b/lib/component/tree/tree-api.vue
@@ -21,7 +21,7 @@