지도점검 현황 작업중

This commit is contained in:
leedj312
2025-05-19 09:47:23 +09:00
parent 1466e04638
commit 7da488dbbf
19 changed files with 735 additions and 416 deletions
+11 -7
View File
@@ -21,7 +21,6 @@ export const rainChkTableData = (chkData: rainChkZodType[]) => {
return acc;
}, {});
return selectTotal; // 모든 키: `${chkgdnFk}_${utztnUsgCd}` 형태
});
@@ -56,12 +55,12 @@ export const rswtChkTableData = (chkData: rswtChkZodType[]) => {
// 1. chkgdnFk + utztnUsgCd 기준 누계 정보 만들기
const makeRswtData: any[] = [];
chkData.forEach((root) => {
root.rswtrDetail.forEach((detail) => {
root.rswtrDetails.forEach((detail) => {
let flatRswtChk = {};
const findGuide = root.guideDetails.find(
(guide) => guide.utztnUsgCd === detail.utztnUsgCd
);
const findPoluttion = root.rswtrPollution.find(
const findPoluttion = root.rswtrPollutions.find(
(polution) => polution.utztnUsgCd === detail.utztnUsgCd
);
const operMngCd = root?.reuseBuilding.operMngCd;
@@ -79,7 +78,6 @@ export const rswtChkTableData = (chkData: rswtChkZodType[]) => {
return makeRswtData;
};
export const chRowspanTable = (
makeTableData: any[],
headList: TableUpperProps[],
@@ -92,6 +90,7 @@ export const chRowspanTable = (
selectedIds: number[],
handleCellClick: (index: number, headId: string) => void
) => {
let order =0
// rowspan된 셀 렌더링 여부 추적용
const renderedMap = new Map<string, Set<number>>();
return (
@@ -102,11 +101,13 @@ export const chRowspanTable = (
const key = head.id;
const isMerged = head.rowSpan;
const value = row[key];
// 병합 대상이면 중복 렌더링 여부 판단
if (isMerged) {
const renderedSet = renderedMap.get(key) ?? new Set<number>();
if (renderedSet.has(rowIndex)) return null; // 이미 렌더링된 셀은 skip
if (renderedSet.has(rowIndex)) {
return null; // 이미 렌더링된 셀은 skip
}
const rowspan = row.rowspan ?? 1;
for (let i = 0; i < rowspan; i++) {
@@ -119,13 +120,15 @@ export const chRowspanTable = (
rowSpan={rowspan}
className="align-middle text-center whitespace-nowrap"
>
{key === "order" ? (
{key === "chekcBox" ? (
<Checkbox
checked={selectedIds.includes(row.chkgdnPk)}
onCheckedChange={(checked) =>
toggleSelection(row.chkgdnPk, checked === true)
}
></Checkbox>
) : key === "order" ? (
++order
) : (
value
)}
@@ -154,6 +157,7 @@ export const chRowspanTable = (
)}
</TableCell>
);
})}
</TableRow>
))}