From 4ef86a3e6ad7276b2f5b2fa246e30201046094f6 Mon Sep 17 00:00:00 2001 From: ljpark Date: Tue, 22 Jul 2025 21:48:37 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EB=B3=B8=EA=B3=84=ED=9A=8D=20download?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/(map-layout)/map/SearchModal.tsx | 3 ++- .../components/popupComponent/chart/infilChart.tsx | 4 ++-- .../components/popupComponent/chart/rdiiChart.tsx | 6 +++--- .../map/components/searchModalReportApi.ts | 14 ++++++++------ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/SearchModal.tsx b/apps/sn/app/(map-layout)/map/SearchModal.tsx index e893fc036..3897352b9 100644 --- a/apps/sn/app/(map-layout)/map/SearchModal.tsx +++ b/apps/sn/app/(map-layout)/map/SearchModal.tsx @@ -184,8 +184,9 @@ const SearchModal: React.FC = ({ console.log(index); const reportData = tableData[index]; const fileName = reportData.fileName; + const filePath = reportData.filePath; if (reportData.fileSn !== "") { - getFileDownload(reportData.fileSn, fileName); + getFileDownload(reportData.fileSn, fileName, filePath); } }; diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/chart/infilChart.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/chart/infilChart.tsx index 72e521d33..345aade49 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/chart/infilChart.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/chart/infilChart.tsx @@ -152,7 +152,7 @@ const InfilChart = ({ pplMngNo }: ModalOpenProp) => {
● 상수사용량 적용연월
- + {(selectedAplcnYm) ? moment(selectedAplcnYm, "YYYYMM").format("YYYY-MM") : ""}
@@ -161,7 +161,7 @@ const InfilChart = ({ pplMngNo }: ModalOpenProp) => {
● 침입수량 산정결과
- 침입수량 : + 침입수량 : {inftwtQty} m³/d
diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/chart/rdiiChart.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/chart/rdiiChart.tsx index bbf11a3f8..9735c772f 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/chart/rdiiChart.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/chart/rdiiChart.tsx @@ -129,7 +129,7 @@ const RdiiChart = ({ pplMngNo }: ModalOpenProp) => {
● 상수사용량 적용연월
- + {(aplcnYm)? moment(aplcnYm, "YYYYMM").format("YYYY-MM"):""}
@@ -139,12 +139,12 @@ const RdiiChart = ({ pplMngNo }: ModalOpenProp) => {
● 강우유입수량 분석결과
- 평균RDII : + 평균RDII : {rdiiQty} m³/d
- 강우량대비RDII : + 강우량대비RDII : {totalVolume} m³/mm
diff --git a/apps/sn/app/(map-layout)/map/components/searchModalReportApi.ts b/apps/sn/app/(map-layout)/map/components/searchModalReportApi.ts index 9d1ae43e0..8cb349056 100644 --- a/apps/sn/app/(map-layout)/map/components/searchModalReportApi.ts +++ b/apps/sn/app/(map-layout)/map/components/searchModalReportApi.ts @@ -110,7 +110,8 @@ export const addFileName = async (data:FlattenedFolder[]) => { data.map(async (item) => { const filenameArr:ReportDataFile[] = await getDcFile(String(item.clsfSystmSn)); const f = filenameArr[0]; - const result = {...item, fileName:f?.fileTitle, regDate:f?.regDt, fileSn:f?.fileSn, filePath:""}; + //console.log("clsfSystmSn:", item.clsfSystmSn, "f:", f); + const result = {...item, fileName:f?.fileTitle, regDate:f?.regDt, fileSn:f?.fileSn, filePath:f?.filePath}; // if (f !== undefined && f.fileSn !== "") { // const fprcs = await getDcFileprcs(f?.fileSn); // if (fprcs.length>0) @@ -149,11 +150,12 @@ export const fileDownload = (data:Blob, fileName:string) => { // Blob데이터 link.remove(); window.URL.revokeObjectURL(url); } -export const getFileDownload = async (fileSn:string, fileName:string) => { - const fileprcsData = await getDcFileprcs(fileSn); // filePath 조회 - if (fileprcsData?.length === 0 ) { alert("filePath 조회 오류"); } - if (fileprcsData[0].filePath === "") alert("filePath 정보 없으므로 다운로드 불가"); - const blobData = await getDcFileDownload(fileprcsData[0].filePath); // 실제 다운로드 API +export const getFileDownload = async (fileSn:string, fileName:string, filePath:string) => { + //const fileprcsData = await getDcFileprcs(fileSn); // filePath 조회 + //if (fileprcsData?.length === 0 ) { alert("filePath 조회 오류"); } + //if (fileprcsData[0].filePath === "") alert("filePath 정보 없으므로 다운로드 불가"); + if (filePath === "") alert("filePath 정보 없으므로 다운로드 불가:filesn"+ fileSn); + const blobData = await getDcFileDownload(filePath); // 실제 다운로드 API fileDownload(blobData, fileName); } // 시도 데이터