From 0a109111cbf2cae77a348bddb2116a56950852e8 Mon Sep 17 00:00:00 2001 From: jyha00 Date: Tue, 22 Jul 2025 20:55:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=ED=86=B5=EA=B3=84?= =?UTF-8?q?=20=EC=83=81=EC=84=B8=20=EC=97=91=EC=85=80=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/stats/rswtStat/page.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/wr/app/stats/rswtStat/page.tsx b/apps/wr/app/stats/rswtStat/page.tsx index e693cafec..99a8bc4f3 100644 --- a/apps/wr/app/stats/rswtStat/page.tsx +++ b/apps/wr/app/stats/rswtStat/page.tsx @@ -72,7 +72,7 @@ export default function RswtStat() { return { ...item, ctpvCd: item.cityText === '전체' ? '전국' : item.cityText, - cityText: item.cityText === '전체' ? '전국' : item.cityText + cityText: item.cityText === '전체' ? '전국' : item.cityText }; }) : []; @@ -80,12 +80,15 @@ export default function RswtStat() { }, [code, rswtStatList]); const excelDetailDownLoad = () => { + const sidoList = new Set(); const sidoDataMap = new Map(); // 시도별 데이터를 저장할 Map const sidoDetailMap = new Map(); // 시도별 상세 데이터를 저장할 Map // 먼저 시도별 상세 데이터를 그룹화 - rswtDetailList.forEach((item: RswtStatProps[]) => { + const transformedRswtDetailList = rswtDetailList.map((originItem: RswtStatProps[]) => { + // rswtDetailList.forEach((item: RswtStatProps[]) => { + const item = [...originItem]; // 원본 복사 const sidoVal = item.at(0)?.toString().trim(); const sigunVal = item.at(1)?.toString().trim(); let sidoText = ''; @@ -127,10 +130,11 @@ export default function RswtStat() { } sidoDataMap.set(sidoText, initialData); } + return item; }); // 시도별 합계 계산 - rswtDetailList.forEach((item: RswtStatProps[]) => { + transformedRswtDetailList.forEach((item: RswtStatProps[]) => { const sidoText = item[0]?.toString(); if (sidoText && sidoDataMap.has(sidoText)) { const sidoData = sidoDataMap.get(sidoText)!;