fix: 修复编辑考勤组人员展示bug
Some checks failed
/ Explore-Gitea-Actions (push) Failing after 5m22s

This commit is contained in:
fyy 2025-08-19 11:50:57 +08:00
parent 1a9927e60a
commit 87fc96500a
2 changed files with 10 additions and 11 deletions

View File

@ -77,7 +77,7 @@ const columns = [
},
{
title: '部门',
dataIndex: ['dept', 'unitName'],
dataIndex: ['dept', 'deptName'],
key: 'dept',
width: 120,
customRender: ({
@ -443,7 +443,7 @@ onMounted(() => {});
:columns="columns"
:dataSource="tableData"
:pagination="false"
rowKey="dept.unitId"
rowKey="dept.deptId"
bordered
/>
</div>

View File

@ -44,7 +44,7 @@ const groupOptions = ref<any[]>([]); //考勤组
const areaOptions = ref<any[]>([]); //
const groupMap = ref<Record<string, any>>({}); //
let tableData = reactive<
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
>([]); //
const columns = [
{
@ -56,10 +56,10 @@ const columns = [
},
{
title: '部门',
dataIndex: ['dept', 'unitName'],
dataIndex: ['dept', 'deptName'],
key: 'dept',
width: 120,
customRender: ({ record }: { record: any }) => record.dept.unitName,
customRender: ({ record }: { record: any }) => record.dept.deptName,
},
{
title: '已选人数',
@ -124,12 +124,11 @@ function handleTableData(newTableData: any) {
if (newTableData.length === 0) {
return;
}
//
for (const newItem of newTableData) {
//
const existingDeptIndex = tableData.findIndex(
(item) => item.dept.unitId === newItem.dept.unitId,
(item) => item.dept.deptId === newItem.dept.deptId,
);
if (existingDeptIndex !== -1) {
@ -191,7 +190,7 @@ const [BasicModal, modalApi] = useVbenModal({
if (!deptMap.has(deptId)) {
deptMap.set(deptId, {
dept: { unitId: deptId, unitName: deptName },
dept: { deptId: deptId, deptName: deptName },
users: [],
});
}
@ -252,8 +251,8 @@ async function handleConfirm() {
const data = formModal;
data.userGroupList = tableData.flatMap((item) =>
item.users.map((user) => ({
deptId: item.dept.unitId,
deptName: item.dept.unitName,
deptId: item.dept.deptId,
deptName: item.dept.deptName,
employeeId: user.userId,
employeeName: user.userName,
})),
@ -351,7 +350,7 @@ onMounted(() => {});
:columns="columns"
:dataSource="tableData"
:pagination="false"
rowKey="dept.unitId"
rowKey="dept.deptId"
bordered
/>
</div>