diff --git a/apps/sn/app/ii/BaseLayout.tsx b/apps/sn/app/ii/BaseLayout.tsx index b08fdcbe4..544802744 100644 --- a/apps/sn/app/ii/BaseLayout.tsx +++ b/apps/sn/app/ii/BaseLayout.tsx @@ -36,6 +36,7 @@ type BaseLayout = { form: any onSubmitEvent: Function graphBtn?: boolean + analysisBtn?: string firstDivBtn?: boolean selectBox?: SelectBox showDatePicker?: boolean; @@ -55,6 +56,7 @@ type BaseLayout = { // Excel 다운로드 관련 props 추가 onExcelDownload?: () => void; onDeleteFile?: () => void; + onAnalysis?: () => void; selectedRowData?: any; } // TODO: 나중에 이벤트 추가되면 파라미터 추가 필요 ? @@ -73,6 +75,7 @@ const BaseLayout = ({ form, onSubmitEvent, graphBtn = false, + analysisBtn, selectBox, showDatePicker = false, enoCd, @@ -91,6 +94,7 @@ const BaseLayout = ({ // Excel 다운로드 관련 props 추가 onExcelDownload, onDeleteFile, + onAnalysis, selectedRowData }: BaseLayout) => { @@ -228,16 +232,18 @@ const BaseLayout = ({ onSwageTreatmentPlantChange?.(val)} /> onSwageProcessingZoneChange?.(val)} /> - {selectBox?.searchChk ? : null} + {selectBox?.searchChk ? : null}

{titleName.firstCardTitle}

- {graphBtn ? : null} + {graphBtn ? : null} {/* 그래프 있을 시 */} - {graphBtn ? : null} + {graphBtn ? : null} + {/* 분석 버튼 */} + {analysisBtn ? : null}
@@ -254,9 +260,9 @@ const BaseLayout = ({

{titleName?.secondCardTitle}

- {graphBtn ? : null} + {graphBtn ? : null} {/* 그래프 있을 시 */} - {graphBtn ? : null} + {graphBtn ? : null}
{children?.[1]}
diff --git a/apps/sn/app/ii/irsetting/page.tsx b/apps/sn/app/ii/irsetting/page.tsx index 162cb9e3f..2944af9c0 100644 --- a/apps/sn/app/ii/irsetting/page.tsx +++ b/apps/sn/app/ii/irsetting/page.tsx @@ -3,7 +3,8 @@ import { postData } from '@/components/lib/api' import FileUploadForm from '@/components/ui/fileUploadForm' import FormSection from '@/components/ui/formSection' import { DatePicker, filePicked } from '@common/business_components/ui' -import { Button, Input } from '@common/components/ui' +import ListDiv from '@common/business_components/ui/list_div' +import { Input } from '@common/components/ui' import { zodResolver } from '@hookform/resolvers/zod' import { useState } from 'react' import { useForm } from 'react-hook-form' @@ -147,6 +148,7 @@ const IrSetting = () => { // 모든 필수 파일이 선택되었는지 확인 (UploadedFileInfo 객체와 그 안의 file 객체 모두 확인) // 유량자료는 선택값 if (!file1?.file || !file2?.file || !file3?.file) { + setIsLoadingResult(false); alert('모든 분석용 파일을 선택해주세요.'); return; } @@ -240,10 +242,11 @@ const IrSetting = () => { return ( <> { }} graphBtn={false} + analysisBtn={'침입수분석 실행'} selectBox={{ title: '분석 대상지역 선택' }} enoCd={select1} setEnoCd={setSelect1} @@ -256,8 +259,9 @@ const IrSetting = () => { selectedSwageProcessingZone={select5} onSwageProcessingZoneChange={setSelect5} isLoading={isLoadingResult} + onAnalysis={handleAnalysisClick} > -
+ {[
{ onChange={(e) => setInput2(e.target.value)} className="ml-5 h-[3.2rem] text-center text-xl w-[150px]" /> -
-
+ +
+ + handleFileSelection(3, file, cd, id)} + showButton={false} + showPreview={true} + accept={".xls, .xlsx, .xlsm, .xltx"} + fileIdx={3} + /> + +
+
+
]} + {/*
{ fileIdx={3} />
- +
-
+
*/}
) diff --git a/apps/sn/app/ii/rdii/page.tsx b/apps/sn/app/ii/rdii/page.tsx index 2a9a49dbc..c80c0991e 100644 --- a/apps/sn/app/ii/rdii/page.tsx +++ b/apps/sn/app/ii/rdii/page.tsx @@ -5,7 +5,7 @@ import FileUploadForm from "@/components/ui/fileUploadForm" import FormSection from "@/components/ui/formSection" import BaseLayout from "@/ii/BaseLayout" import { DatePicker, filePicked } from "@common/business_components/ui" -import { Button, Input } from "@common/components/ui" +import { Input } from "@common/components/ui" import { zodResolver } from "@hookform/resolvers/zod" import { Label } from '@radix-ui/react-label' import { useState } from "react" @@ -175,6 +175,7 @@ export default function RTKForm() { // 모든 필수 파일이 선택되었는지 확인 if (!file1?.file || !file2?.file || !file3?.file) { + setIsLoadingResult(false); alert('모든 분석용 파일을 선택해주세요.'); return; } @@ -235,31 +236,31 @@ export default function RTKForm() { cntbArea: parseFloat(formData.rdiiArea) || null, // RDII 기여면적(ha) srcNm: formData.rtkSource, // 출처이름 (RTK계수 출처) - shortPrdR: parseFloat(formData.unitFactors[0]?.R !== undefined ? formData.unitFactors[0]?.R : "0") || null, // 단기간R - shortPrdT: parseFloat(formData.unitFactors[0]?.T !== undefined ? formData.unitFactors[0]?.T : "0") || null, // 단기간T - shortPrdK: parseFloat(formData.unitFactors[0]?.K !== undefined ? formData.unitFactors[0]?.K : "0") || null, // 단기간K + shortPrdR: parseFloat(formData.unitFactors[0]?.R || "0"), + shortPrdT: parseFloat(formData.unitFactors[0]?.T || "0"), + shortPrdK: parseFloat(formData.unitFactors[0]?.K || "0"), - mdPrdR: parseFloat(formData.unitFactors[1]?.R !== undefined ? formData.unitFactors[1]?.R : "0") || null, // 중간기간R - mdPrdT: parseFloat(formData.unitFactors[1]?.T !== undefined ? formData.unitFactors[1]?.T : "0") || null, // 중간기간T - mdPrdK: parseFloat(formData.unitFactors[1]?.K !== undefined ? formData.unitFactors[1]?.K : "0") || null, // 중간기간K + mdPrdR: parseFloat(formData.unitFactors[1]?.R || "0"), + mdPrdT: parseFloat(formData.unitFactors[1]?.T || "0"), + mdPrdK: parseFloat(formData.unitFactors[1]?.K || "0"), - longPrdR: parseFloat(formData.unitFactors[2]?.R !== undefined ? formData.unitFactors[2]?.R : "0") || null, // 장기간R - longPrdT: parseFloat(formData.unitFactors[2]?.T !== undefined ? formData.unitFactors[2]?.T : "0") || null, // 장기간T - longPrdK: parseFloat(formData.unitFactors[2]?.K !== undefined ? formData.unitFactors[2]?.K : "0") || null, // 장기간K + longPrdR: parseFloat(formData.unitFactors[2]?.R || "0"), + longPrdT: parseFloat(formData.unitFactors[2]?.T || "0"), + longPrdK: parseFloat(formData.unitFactors[2]?.K || "0"), - shortPrdMaxDpth: parseFloat(formData.initialDepths[0]?.Dmax !== undefined ? formData.initialDepths[0]?.Dmax : "0") || null, // 단기간최대깊이 - shortPrdRcvryRt: parseFloat(formData.initialDepths[0]?.Drec !== undefined ? formData.initialDepths[0]?.Drec : "0") || null, // 단기간회복비율 - shortPrdBgngDpth: parseFloat(formData.initialDepths[0]?.Do !== undefined ? formData.initialDepths[0]?.Do : "0") || null, // 단기간시작깊이 + shortPrdMaxDpth: parseFloat(formData.initialDepths[0]?.Dmax || "0"), + shortPrdRcvryRt: parseFloat(formData.initialDepths[0]?.Drec || "0"), + shortPrdBgngDpth: parseFloat(formData.initialDepths[0]?.Do || "0"), - mdPrdMaxDpth: parseFloat(formData.initialDepths[1]?.Dmax !== undefined ? formData.initialDepths[1]?.Dmax : "0") || null, // 중간기간최대깊이 - mdPrdRcvryRt: parseFloat(formData.initialDepths[1]?.Drec !== undefined ? formData.initialDepths[1]?.Drec : "0") || null, // 중간기간회복비율 - mdPrdBgngDpth: parseFloat(formData.initialDepths[1]?.Do !== undefined ? formData.initialDepths[1]?.Do : "0") || null, // 중간기간시작깊이 + mdPrdMaxDpth: parseFloat(formData.initialDepths[1]?.Dmax || "0"), + mdPrdRcvryRt: parseFloat(formData.initialDepths[1]?.Drec || "0"), + mdPrdBgngDpth: parseFloat(formData.initialDepths[1]?.Do || "0"), - longTermMaxDpth: parseFloat(formData.initialDepths[2]?.Dmax !== undefined ? formData.initialDepths[2]?.Dmax : "0") || null, // 장기간최대깊이 - longTermRcvryRt: parseFloat(formData.initialDepths[2]?.Drec !== undefined ? formData.initialDepths[2]?.Drec : "0") || null, // 장기간회복비율 - longTermBgngDpth: parseFloat(formData.initialDepths[2]?.Do !== undefined ? formData.initialDepths[2]?.Do : "0") || null, // 장기간시작깊이 + longTermMaxDpth: parseFloat(formData.initialDepths[2]?.Dmax || "0"), + longTermRcvryRt: parseFloat(formData.initialDepths[2]?.Drec || "0"), + longTermBgngDpth: parseFloat(formData.initialDepths[2]?.Do || "0"), - drtwSwtcRt: parseFloat(formData.rate !== undefined ? formData.rate : "0") || null, // 오수전환율 + drtwSwtcRt: parseFloat(formData.rate || "0"), // 오수전환율 anlsInfo: formData.analysisInfo, // 분석정보 tbSnRcptrMhlMpng: matchingResultData, // 수용가-맨홀 매칭결과 @@ -322,7 +323,7 @@ export default function RTKForm() { form={form} // react-hook-form 인스턴스 전달 onSubmitEvent={() => { }} // BaseLayout의 form 태그에 연결될 onSubmit graphBtn={false} - // select 상태 및 핸들러 전달 + analysisBtn={'RDII분석 실행'} enoCd={select1} setEnoCd={setSelect1} ctpvCd={select2} @@ -334,6 +335,7 @@ export default function RTKForm() { selectedSwageProcessingZone={select5} onSwageProcessingZoneChange={setSelect5} isLoading={isLoadingResult} + onAnalysis={handleAnalysisClick} > {[
@@ -426,9 +428,9 @@ export default function RTKForm() {
-
- -
+ {/*
+ +
*/}
]}