@@ -414,7 +419,7 @@ export default function RTKForm() {
}}
// className을 직접 사용하거나, DatePicker 내부에서 selectClass를 처리하도록 수정 필요
// 여기서는 DatePicker의 selectClass prop을 사용하고, date-picker.css의 스타일을 적용
- selectClass="ml-5 date-picker-trigger"
+ selectClass="ml-5 date-picker-trigger"
/>
diff --git a/apps/sn/app/ii/rdii_result/page.tsx b/apps/sn/app/ii/rdii_result/page.tsx
index ada7f4c56..dba3a1232 100644
--- a/apps/sn/app/ii/rdii_result/page.tsx
+++ b/apps/sn/app/ii/rdii_result/page.tsx
@@ -1,5 +1,5 @@
'use client'
-import { getData, deleteData } from '@/components/lib/api'
+import { deleteData, getData } from '@/components/lib/api'
import { UiTable, downloadExcel } from '@common/business_components/ui'
import { zodResolver } from '@hookform/resolvers/zod'
import { useState } from 'react'
@@ -101,13 +101,13 @@ const Result = () => {
setTotalData(tableData.length);
console.log("response:", data);
console.log("response data:", data.content || []);
+ setIsLoadingResult(false);
} catch (error) {
+ setIsLoadingResult(false);
console.error("Error fetching analysis result data:", error);
alert("분석결과 조회 중 오류가 발생했습니다.");
setTableData([]);
setTotalData(0);
- } finally {
- setIsLoadingResult(false);
}
};
@@ -122,8 +122,10 @@ const Result = () => {
// Excel 다운로드 핸들러 추가
const handleExcelDownload = async () => {
+ setIsLoadingResult(true);
console.log("Selected row data for download:", selectedRowData);
if (!selectedRowData || selectedRowData.rainInfwtAnlsSn === undefined) {
+ setIsLoadingResult(false);
alert('다운로드할 데이터를 선택해주세요.');
return;
}
@@ -143,7 +145,9 @@ const Result = () => {
sheetNameArray: ["RDII 분석결과"],
headerRange: "A1:D1" // 테이블 컬럼 수에 맞춰 조정
});
+ setIsLoadingResult(false);
} catch (error) {
+ setIsLoadingResult(false);
console.error("Excel 다운로드 중 오류 발생:", error);
alert("Excel 다운로드 중 오류가 발생했습니다. 다시 시도해주세요.");
}
@@ -151,6 +155,7 @@ const Result = () => {
// 파일 삭제 핸들러 추가
const handleFileDelete = async () => {
+ setIsLoadingResult(true);
console.log("Selected row data for deletion:", selectedRowData);
if (!selectedRowData || selectedRowData.rainInfwtAnlsSn === undefined) {
alert('삭제할 파일을 선택해주세요.');
@@ -188,6 +193,7 @@ const Result = () => {
console.error("분석결과 파일 삭제 중 오류 발생:", error);
alert("분석결과 파일 삭제 중 오류가 발생했습니다. 다시 시도해주세요.");
}
+ setIsLoadingResult(false);
};
return (
@@ -216,6 +222,7 @@ const Result = () => {
form.setValue("aplcnYm", new Date(val))
}
}}
+ isLoading={isLoadingResult}
// Excel 다운로드 핸들러 추가
onExcelDownload={handleExcelDownload}
onDeleteFile={handleFileDelete}
diff --git a/apps/sn/app/ii/result/page.tsx b/apps/sn/app/ii/result/page.tsx
index 552504e0b..99f0f902a 100644
--- a/apps/sn/app/ii/result/page.tsx
+++ b/apps/sn/app/ii/result/page.tsx
@@ -1,5 +1,5 @@
'use client'
-import { getData, deleteData } from '@/components/lib/api'
+import { deleteData, getData } from '@/components/lib/api'
import { UiTable, downloadExcel } from '@common/business_components/ui'
import { zodResolver } from '@hookform/resolvers/zod'
import { useState } from 'react'
@@ -100,13 +100,13 @@ const Result = () => {
setTotalData(tableData.length);
console.log("response:", data);
console.log("response data:", data.content || []);
+ setIsLoadingResult(false);
} catch (error) {
+ setIsLoadingResult(false);
console.error("Error fetching analysis result data:", error);
alert("분석결과 조회 중 오류가 발생했습니다.");
setTableData([]);
setTotalData(0);
- } finally {
- setIsLoadingResult(false);
}
};
@@ -121,8 +121,10 @@ const Result = () => {
// Excel 다운로드 핸들러 추가
const handleExcelDownload = async () => {
+ setIsLoadingResult(true);
console.log("Selected row data for download:", selectedRowData);
if (!selectedRowData || selectedRowData.inftwtAnlsSn === undefined) {
+ setIsLoadingResult(false);
alert('다운로드할 데이터를 선택해주세요.');
return;
}
@@ -142,7 +144,9 @@ const Result = () => {
sheetNameArray: ["침입수 분석결과"],
headerRange: "A1:D1" // 테이블 컬럼 수에 맞춰 조정
});
+ setIsLoadingResult(false);
} catch (error) {
+ setIsLoadingResult(false);
console.error("Excel 다운로드 중 오류 발생:", error);
alert("Excel 다운로드 중 오류가 발생했습니다. 다시 시도해주세요.");
}
@@ -150,8 +154,10 @@ const Result = () => {
// 파일 삭제 핸들러 추가
const handleFileDelete = async () => {
+ setIsLoadingResult(true);
console.log("Selected row data for deletion:", selectedRowData);
if (!selectedRowData || selectedRowData.inftwtAnlsSn === undefined) {
+ setIsLoadingResult(false);
alert('삭제할 파일을 선택해주세요.');
return;
}
@@ -181,9 +187,11 @@ const Result = () => {
// 선택된 행 초기화
setSelectedRowData(null);
setSelectedRowIndex(undefined);
+ setIsLoadingResult(false);
alert('삭제가 완료되었습니다.');
} catch (error) {
+ setIsLoadingResult(false);
console.error("분석결과 파일 삭제 중 오류 발생:", error);
alert("분석결과 파일 삭제 중 오류가 발생했습니다. 다시 시도해주세요.");
}
@@ -215,6 +223,7 @@ const Result = () => {
form.setValue("aplcnYm", new Date(val))
}
}}
+ isLoading={isLoadingResult} // 로딩 상태 전달
// Excel 다운로드 핸들러 추가
onExcelDownload={handleExcelDownload}
onDeleteFile={handleFileDelete}