From dcfafbc8fc452a20720ce57f779674435e832045 Mon Sep 17 00:00:00 2001 From: JIeunhuh Date: Tue, 13 May 2025 17:57:27 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=9A=94=EC=B2=AD=EC=82=AC=ED=95=AD=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/components/ui/fileUploadForm.tsx | 9 +++--- apps/sn/app/ii/BaseLayout.tsx | 23 +++++++++------ apps/sn/app/ii/irsetting/page.tsx | 4 +-- apps/sn/app/ii/rdii/page.tsx | 2 +- apps/sn/app/ii/result/page.tsx | 31 ++++++++++++++++++-- 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/apps/sn/app/components/ui/fileUploadForm.tsx b/apps/sn/app/components/ui/fileUploadForm.tsx index e111d8362..3c57bb812 100644 --- a/apps/sn/app/components/ui/fileUploadForm.tsx +++ b/apps/sn/app/components/ui/fileUploadForm.tsx @@ -7,13 +7,14 @@ import React, { useState } from 'react' const FileUploadForm = ({ title }: { title: string }) => { const [files, setFiles] = useState(null); const [selectedYear, setSelectedYear] = useState(''); + const [selectedQuarter, setSelectedQuarter] = useState(''); // 현재 년도부터 10년 전까지의 년도 옵션 생성 const yearOptions = Array.from({ length: 10 }, (_, i) => { const year = new Date().getFullYear() - i; return { text: `${year}년`, val: year.toString() }; }); - + const quater = [{text: '1분기', val: '1'}, {text: '2분기', val: '2'}, {text: '3분기', val: '3'}, {text: '4분기', val: '4'}] return (
@@ -32,8 +33,8 @@ const FileUploadForm = ({ title }: { title: string }) => { className="w-50" selectClass="rounded-lg bg-white" label="분기" - selectArray={yearOptions} - onSelectValue={(value: string | number) => setSelectedYear(String(value))} + selectArray={quater} + onSelectValue={(value: string | number) => setSelectedQuarter(String(value))} />
@@ -44,7 +45,7 @@ const FileUploadForm = ({ title }: { title: string }) => { className="px-4 py-2 bg-blue-600 text-white rounded-sm text-sm font-medium hover:bg-blue-700" size="sm" onClick={() => { - if (!files?.[0] || !selectedYear) { + if (!files?.[0] || !selectedYear || !selectedQuarter) { alert('파일과 등록년도를 선택해주세요.'); return; } diff --git a/apps/sn/app/ii/BaseLayout.tsx b/apps/sn/app/ii/BaseLayout.tsx index db502cbd8..42697c00f 100644 --- a/apps/sn/app/ii/BaseLayout.tsx +++ b/apps/sn/app/ii/BaseLayout.tsx @@ -10,14 +10,14 @@ type TitleName = { secondCardTitle?: string } type SelectBox = { - labelNm?:Label - searchChk?:boolean + labelNm?: Label + searchChk?: boolean } -type Label= { +type Label = { first: string second: string - third:string - fourth:string + third: string + fourth: string } type BaseLayout = { children?: ReactNode[] @@ -25,8 +25,8 @@ type BaseLayout = { form: any onSubmitEvent: Function graphBtn?: boolean - firstDivBtn?:boolean - searchBox?:SelectBox + firstDivBtn?: boolean + searchBox?: SelectBox } // TODO: 나중에 이벤트 추가되면 파라미터 추가 필요 ? /** @@ -38,7 +38,7 @@ type BaseLayout = { * @param graphBtn : 하단에 그래프 버튼 유무 처리 * @returns */ -const BaseLayout = ({ children,titleName, form, onSubmitEvent, graphBtn=false, searchBox }: BaseLayout) => { +const BaseLayout = ({ children, titleName, form, onSubmitEvent, graphBtn = false, searchBox }: BaseLayout) => { return ( @@ -70,7 +70,12 @@ const BaseLayout = ({ children,titleName, form, onSubmitEvent, graphBtn=false, s {children?.[1] != null ?
-

{titleName.secondCardTitle}

+

{titleName?.secondCardTitle}

+
+ {graphBtn ? : null} + {/* 그래프 있을 시 */} + {graphBtn ? : null} +
{children?.[1]}
: null} diff --git a/apps/sn/app/ii/irsetting/page.tsx b/apps/sn/app/ii/irsetting/page.tsx index 16b44ea95..fbfbe0c76 100644 --- a/apps/sn/app/ii/irsetting/page.tsx +++ b/apps/sn/app/ii/irsetting/page.tsx @@ -33,7 +33,7 @@ const IrSetting = () => { { }} graphBtn={false}>
- { if (date) setSelectedDate(date);}} mode={"single"} /> +
@@ -48,7 +48,7 @@ const IrSetting = () => {
- + { if (date) setSelectedDate(date) }} mode={"single"} /> diff --git a/apps/sn/app/ii/rdii/page.tsx b/apps/sn/app/ii/rdii/page.tsx index 9a04102e7..7db1bfe56 100644 --- a/apps/sn/app/ii/rdii/page.tsx +++ b/apps/sn/app/ii/rdii/page.tsx @@ -138,7 +138,7 @@ export default function RTKForm() {
- + { if (date) setSelectedDate(date) }} mode={"single"} /> diff --git a/apps/sn/app/ii/result/page.tsx b/apps/sn/app/ii/result/page.tsx index f42f2ab29..a3a036518 100644 --- a/apps/sn/app/ii/result/page.tsx +++ b/apps/sn/app/ii/result/page.tsx @@ -29,6 +29,20 @@ const tableColumn = [ { id: 'date', title: '분석일자' }, { id: 'usr', title: '분석자' } ] +const tableColumn2 = [ + { id: 'no', title: '번호' }, + { id: 'hasu', title: '하수처리장' }, + { id: 'guyeok', title: '처리구역' }, + { id: 'sangsu', title: '상수 사용량' }, + { id: 'rate', title: '오수 전환율' }, + { id: 'rtx', title: 'RTX계수출처' }, + { id: 'rdii', title: 'RDII 기여면적' }, + { id: 'water', title: '순오수량' }, + { id: 'measureWater', title: '강우유출량' }, + { id: 'ii', title: 'RDII(m2/d)' }, + { id: 'date', title: '분석일자' }, + { id: 'usr', title: '분석자' } +] const tableInfoData = [{ 'no': '1', 'hasu': '양평하수처리장', 'guyeok': '양평', 'sangsu': '1000', 'rate': '0.5', 'water': '500', 'measureWater': '1000', 'ii': '500', 'date': '2023-10-01', 'usr': '홍길동' }] const Result = () => { const form = useForm>({ @@ -43,7 +57,7 @@ const Result = () => { } }) return ( - { }} graphBtn={true}> + { }} graphBtn={true}> {[
○ 침입수 산정결과 현황
{ cellClick={(e) => { }} onPageChange={(e) => { }} /> -
]} +
, +
+ { }} + onPageChange={(e) => { }} + /> +
+ ]} ) }