From 20d44c09ff1ddd95c6dc2353a9ed5e61461a7b19 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 3 Jul 2025 14:04:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20-=20=EC=98=A4=EC=88=98=EC=A0=84?= =?UTF-8?q?=ED=99=98=EC=9C=A8=200~1=20=EC=82=AC=EC=9D=B4=EA=B0=92=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EA=B5=AC=ED=98=84=20-=20=EC=98=A4?= =?UTF-8?q?=EC=88=98=EA=B4=80=EB=A7=9D=EB=8F=84=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=EC=8B=9C=20.inp=20=ED=99=95=EC=9E=A5?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=EB=A7=8C=20=ED=95=9C=EC=A0=95=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(with-base-layout)/ii/irsetting/page.tsx | 19 +++++++++++++++++- .../app/(with-base-layout)/ii/rdii/page.tsx | 20 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx b/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx index 91d1361c9..edeb9e87b 100644 --- a/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx +++ b/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx @@ -137,6 +137,23 @@ const IrSetting = () => { // 침입수 분석 실행 버튼 클릭 핸들러 const handleAnalysisClick = async () => { setIsLoadingResult(true); // 로딩 상태 시작 + + // 오수전환율 값 0 ~ 1 사이인지 검증 + if (input1 === '' || input1 === null || input1 === undefined) { + setIsLoadingResult(false); + console.error('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + alert('오수전환율을 입력해주세요.'); + return; + } + + const numericInput1 = parseFloat(input1); + if (isNaN(numericInput1) || numericInput1 < 0 || numericInput1 > 1) { + setIsLoadingResult(false); + console.error('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + alert('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + return; + } + console.log(uploadedFilesData); const file1 = uploadedFilesData[0]; // 오수관망도 const file2 = uploadedFilesData[1]; // 수용가-맨홀 매칭결과 @@ -275,7 +292,7 @@ const IrSetting = () => { onFileSelect={(file, cd, id) => handleFileSelection(0, file, cd, id)} showButton={false} showPreview={true} - accept={""} + accept={".inp"} fileIdx={0} /> diff --git a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx index 705b243c8..3269f31b5 100644 --- a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx +++ b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx @@ -163,6 +163,24 @@ export default function RTKForm() { // 침입수 분석 실행 버튼 클릭 핸들러 const handleAnalysisClick = async () => { setIsLoadingResult(true); // 로딩 상태 시작 + + // 오수전환율 값 0 ~ 1 사이인지 검증 + const rateValue = form.getValues().rate; + if (rateValue === '' || rateValue === null || rateValue === undefined) { + setIsLoadingResult(false); + console.error('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + alert('오수전환율을 입력해주세요.'); + return; + } + + const numericInput1 = parseFloat(rateValue); + if (isNaN(numericInput1) || numericInput1 < 0 || numericInput1 > 1) { + setIsLoadingResult(false); + console.error('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + alert('오수전환율은 0에서 1 사이의 값으로 입력해야 합니다.'); + return; + } + const formData = form.getValues(); console.log(uploadedFilesData); const file1 = uploadedFilesData[0]; // 오수관망도 @@ -378,7 +396,7 @@ export default function RTKForm() { onFileSelect={(file, cd, id) => handleFileSelection(0, file, cd, id)} showButton={false} showPreview={true} - accept={""} + accept={".inp"} fileIdx={0} />