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) {