From d4c58a19df4f806641e85215350741186874eadb Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 26 Jun 2025 10:47:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B9=A8=EC=9E=85=EC=88=98=EB=B6=84?= =?UTF-8?q?=EC=84=9D=EA=B2=B0=EA=B3=BC,=20RDII=20=EB=B6=84=EC=84=9D?= =?UTF-8?q?=EA=B2=B0=EA=B3=BC=20=ED=8C=8C=EC=9D=BC=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EC=8B=9C=20=ED=97=A4=EB=8D=94=EB=AA=85=20?= =?UTF-8?q?=EC=98=81=EC=96=B4=20->=20=ED=95=9C=EA=B8=80=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ii/rdii_result/page.tsx | 19 ++++++++++++++----- .../app/(with-base-layout)/ii/result/page.tsx | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/apps/sn/app/(with-base-layout)/ii/rdii_result/page.tsx b/apps/sn/app/(with-base-layout)/ii/rdii_result/page.tsx index 95397a13c..4bbfd0619 100644 --- a/apps/sn/app/(with-base-layout)/ii/rdii_result/page.tsx +++ b/apps/sn/app/(with-base-layout)/ii/rdii_result/page.tsx @@ -1,6 +1,6 @@ 'use client' import { deleteData, getData } from '@/components/lib/api' -import { UiTable, downloadExcel } from '@common/business_components/ui' +import { UiTable, downloadExcelWithKoreanHeaders } from '@common/business_components/ui' import { zodResolver } from '@hookform/resolvers/zod' import { useState } from 'react' import { useForm } from 'react-hook-form' @@ -138,14 +138,23 @@ const Result = () => { // 선택된 행 데이터를 Excel 다운로드 형식으로 변환 const excelData = data.content; // 배열로 감싸서 전달 - // 파일명 생성 (분석번호 기반) - const fileName = `RDII분석결과_${selectedRowData.rainInfwtAnlsSn}_${selectedRowData.aplcnYm}`; + // 헤더 매핑 정의 + const headerMapping: { [key: string]: string } = { + 'rainInfwtAnlsSn': 'RDII분석\n일련번호', + 'pplMngNo': '관로\n관리번호', + 'anlsTm': '분석시각', + 'predcOilq': '예측유량' + }; - downloadExcel({ + // 파일명 생성 (분석번호 기반) + const fileName = `RDII분석결과_${selectedRowData.swageTmplntNm}_${selectedRowData.aplcnYm}_${selectedRowData.rainInfwtAnlsSn}`; + + await downloadExcelWithKoreanHeaders({ data: excelData as JSON[], fileName: fileName, sheetNameArray: ["RDII 분석결과"], - headerRange: "A1:D1" // 테이블 컬럼 수에 맞춰 조정 + headerRange: "A1:D1", + headerMapping: headerMapping }); setIsLoadingResult(false); } catch (error) { diff --git a/apps/sn/app/(with-base-layout)/ii/result/page.tsx b/apps/sn/app/(with-base-layout)/ii/result/page.tsx index ecdce6566..ee2bbe905 100644 --- a/apps/sn/app/(with-base-layout)/ii/result/page.tsx +++ b/apps/sn/app/(with-base-layout)/ii/result/page.tsx @@ -1,6 +1,6 @@ 'use client' import { deleteData, getData } from '@/components/lib/api' -import { UiTable, downloadExcel } from '@common/business_components/ui' +import { UiTable, downloadExcelWithKoreanHeaders } from '@common/business_components/ui' import { zodResolver } from '@hookform/resolvers/zod' import { useState } from 'react' import { useForm } from 'react-hook-form' @@ -137,14 +137,23 @@ const Result = () => { // 선택된 행 데이터를 Excel 다운로드 형식으로 변환 const excelData = data.content; // 배열로 감싸서 전달 - // 파일명 생성 (분석번호 기반) - const fileName = `침입수분석결과_${selectedRowData.inftwtAnlsSn}_${selectedRowData.aplcnYm}`; + // 헤더 매핑 정의 + const headerMapping: { [key: string]: string } = { + 'inftwtAnlsSn': '침입수분석\n일련번호', + 'pplMngNo': '관로\n관리번호', + 'anlsTm': '분석시각', + 'predcOilq': '예측유량' + }; - downloadExcel({ + // 파일명 생성 (분석번호 기반) + const fileName = `침입수분석결과_${selectedRowData.swageTmplntNm}_${selectedRowData.aplcnYm}_${selectedRowData.inftwtAnlsSn}`; + + await downloadExcelWithKoreanHeaders({ data: excelData as JSON[], fileName: fileName, sheetNameArray: ["침입수 분석결과"], - headerRange: "A1:D1" // 테이블 컬럼 수에 맞춰 조정 + headerRange: "A1:D1", + headerMapping: headerMapping }); setIsLoadingResult(false); } catch (error) {