fix: bug修改

This commit is contained in:
xuziqiang
2024-07-05 17:26:31 +08:00
parent b2a200486f
commit 40d93e74aa
8 changed files with 104 additions and 96 deletions

View File

@@ -4,30 +4,17 @@
<div class="main">
<div class="left">
<div class="top">
<ns-tree-api v-bind="orgTreeConfig" @select="handleSelect">
<ns-tree-api v-bind="orgTreeConfig" @select="handleSelect" v-model:treeData="treeData">
<template #title="data">
{{ data.orgInfo?.orgName }}
</template>
</ns-tree-api>
</div>
<div class="top">
<!-- <div class="ns-table-title">关联部门</div>
<a-input-search
v-model:value="searchValue2"
style="margin-bottom: 8px"
placeholder="请输入关联部门"
@search="onSearch2" />
<a-tree
v-if="treeData2?.length"
:tree-data="treeData2"
defaultExpandAll
@select="handleSelect2">
<template #title="data">
{{ data.deptInfo?.deptName }}
</template>
</a-tree> -->
<ns-tree-api v-bind="deptTreeConfig" @select="handleSelect2">
<ns-tree-api
v-bind="deptTreeConfig"
@select="handleSelect2"
v-model:treeData="treeDataDept">
<template #title="data">
{{ data.deptInfo?.deptName }}
</template>
@@ -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: '部门/角色',