From c054d635b11acaaa898b730fad69c6914f2e13a3 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Mon, 14 Apr 2025 18:10:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=A0=90=EA=B2=80=20?= =?UTF-8?q?=ED=8D=BC=EB=B8=94=EB=A6=AC=EC=8B=B1=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 10 +- .../ruseFcltMng/prfmncReg/chkgdnReg/page.tsx | 84 ++++++++--- .../prfmncReg/chkgdnReg/rainChkgdn/index.tsx | 133 +++++++++++++++-- .../ruseFcltMng/fcltReg/htdflReg/index.tsx | 36 ++++- .../ruseFcltMng/fcltReg/rainReg/index.tsx | 31 +++- .../ruseFcltMng/fcltReg/rswtReg/index.tsx | 42 +++++- .../ui/form/fcltReg/bdstReg/bdstReg.tsx | 7 +- .../ui/form/fcltReg/rainReg/rainRegForm.tsx | 4 +- .../ui/modal/chkgdExcel/chkgdExcel.tsx | 92 ++++++++++++ .../ui/modal/chkgdModal/chkgdModal.tsx | 140 +++++++++++++++++- .../ui/table/rainChkgd/rainChkgdTable.tsx | 2 - 11 files changed, 516 insertions(+), 65 deletions(-) create mode 100644 apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index d41309f85..4dedd354f 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -107,7 +107,7 @@ export default function Home() { return ( <> - +
@@ -145,7 +145,8 @@ export default function Home() { <div className="grid grid-cols-6 gap-4 "> <div className="col-span-4 max-h-full ovreflow-y-scroll"> <ListDiv> - <UiTable + <ScrollArea className="h-full"> + <UiTable tableData={bdstTable || []} headlist={rain.upHeadList} pageSize={100} @@ -156,14 +157,15 @@ export default function Home() { }} > {nodeList} - </UiTable> + </UiTable> + </ScrollArea> </ListDiv> </div> <div className="col-span-2 max-h-full ovreflow-y-scroll"> <ListDiv> <ScrollArea> <RainRegForm - rainForm={rainForm || undefined} + rainForm={rainForm ?? {} as customRainBdst} isModal={false} ></RainRegForm> </ScrollArea> diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx index 52bd270e1..843a4682b 100644 --- a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx @@ -1,7 +1,10 @@ "use client"; import { useWrStore } from "@/app/store"; -import { chHeadNm, fcltDiv, type chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; +import { + fcltDiv, + type chHeadType, +} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import { ContentsDiv, SearchDiv, @@ -10,20 +13,24 @@ import { SearchInput, SelectBox, Title, + UiModal, UiTable, } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; import { Button, Input } from "@common/components/ui"; import { useState } from "react"; -import { headMakeColSpan } from "../../fcltReg/rainReg/page"; import { TableRow, TableHead } from "@common/components"; import React from "react"; import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import RainChkgdTable from "@/components/ui/table/rainChkgd/rainChkgdTable"; import RswtChkgdTable from "@/components/ui/table/rswtChkgd/rswtChkgdTable"; +import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal"; +import ChkgdExcel from "@/components/ui/modal/chkgdExcel/chkgdExcel"; - -export const headMakeprfmnc = (upHeadList: TableUpperProps[] ,makeHeadNm:chHeadType[] ) => { +export const headMakeprfmnc = ( + upHeadList: TableUpperProps[], + makeHeadNm: chHeadType[] +) => { return ( <> <TableRow> @@ -32,16 +39,22 @@ export const headMakeprfmnc = (upHeadList: TableUpperProps[] ,makeHeadNm:chHeadT <TableHead rowSpan={2} key={head.id}> {head.title} </TableHead> - ) : head.upSequnce === 1 ? ( - <TableHead key={head.id} rowSpan={1} colSpan={makeHeadNm.find((ch)=> ch.headNm ===head.upName)?.length}> - {makeHeadNm.find((ch)=> ch.headNm ===head.upName)?.text} + ) : head.upSequnce === 1 ? ( + <TableHead + key={head.id} + rowSpan={1} + colSpan={ + makeHeadNm.find((ch) => ch.headNm === head.upName)?.length + } + > + {makeHeadNm.find((ch) => ch.headNm === head.upName)?.text} </TableHead> ) : null )} </TableRow> <TableRow> {upHeadList.map((head: TableUpperProps) => - makeHeadNm.find((ch)=> ch.headNm ===head.upName) ? ( + makeHeadNm.find((ch) => ch.headNm === head.upName) ? ( <TableHead key={head.id}>{head.title}</TableHead> ) : null )} @@ -51,11 +64,20 @@ export const headMakeprfmnc = (upHeadList: TableUpperProps[] ,makeHeadNm:chHeadT }; //----------------------- export default function Page() { - - - + const [isDetail, setIsDetail] = useState(false); + const [isExcel, setIsExcel] = useState(false); + + + + const [testObj, setTestObj] = useState({}); + const [selFcltDiv, setSelFcltDiv] = useState("RST"); - + + const cellClick = () => { + const ch = { bdstNm: "test", chckYmd: "2022-10-10" }; + setTestObj(ch); + }; + return ( <ContentsDiv> <div className="grid grid-cols-4 gap-4 "> @@ -70,28 +92,37 @@ export default function Page() { setText={(e) => {}} /> <SelectBox - className={ "col-span-3 w-full h-full text-2xl"} + className={"col-span-3 w-full h-full text-2xl"} label={"시설구분"} selectClass={""} selectArray={fcltDiv} onSelectValue={setSelFcltDiv} - value={selFcltDiv??fcltDiv[0]?.val} + value={selFcltDiv ?? fcltDiv[0]?.val} /> </SearchFormLeft> <SearchFormRight> - <Button className="mr-4 rounded-lg" onClick={(e) => {}}> + <Button + className="mr-4 rounded-lg" + onClick={(e) => { + cellClick() + setIsDetail(!isDetail); + }} + > 조회 </Button> <Button className="mr-4 rounded-lg" onClick={() => {}}> 삭제 - </Button> + </Button> <Button className="mr-4 rounded-lg" onClick={() => {}}> 저장 </Button> <Button className="mr-4 rounded-lg" onClick={() => {}}> 결과등록 </Button> - <Button className="mr-4 rounded-lg" onClick={() => {}}> + <Button className="mr-4 rounded-lg" + onClick={() => { + setIsExcel(!isDetail); + }}> 양식받기 </Button> </SearchFormRight> @@ -101,14 +132,23 @@ export default function Page() { <div className="grid grid-cols-6 gap-4 "> <div className="col-span-6"> <ListDiv> - {selFcltDiv === "RNB" ? ( - <RainChkgdTable /> - ) : ( - <RswtChkgdTable /> - )} + {selFcltDiv === "RNB" ? <RainChkgdTable /> : <RswtChkgdTable />} </ListDiv> </div> </div> + + <UiModal + open={isDetail} + onOpenChange={setIsDetail} + bodyClass={"w-[40vw] max-w-none"} + body={<ChkgdModal type={selFcltDiv} obj={testObj}></ChkgdModal>} + /> + + <UiModal open={isExcel} + onOpenChange={setIsExcel} + bodyClass={"w-[40vw] max-w-none"} + body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>} + /> </ContentsDiv> ); } diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx index 1bc9a624f..6300e0108 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/index.tsx @@ -1,8 +1,20 @@ import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import type { text } from "stream/consumers"; +import { z } from "zod"; + + +export const rainRegExcel =z.object({ + bdstInfoPk:z.number().default(111111111), + chckYmd:z.date().default(new Date()), + file: z.instanceof(File).optional() + + +}) + + export const fcltDiv=[ {val:'RST', text:'중수도시설'}, {val:'RNB', text:'빗물이용시설'}, @@ -18,6 +30,8 @@ export type chHeadType={ export const rainHeadNm:chHeadType[] = [ {headNm:"useQuilty", text:"이용수질(필요시)" , length: 4}, {headNm:"feeHist", text:"과태료 부과내역" , length: 3}, + {headNm:"subWater", text:"연간보급수 이용량(m³)" , length: 13}, + {headNm:"detailQulity", text:"분기" , length: 11} ] export const rainChkgdnHeadList:TableUpperProps[] = [ @@ -42,6 +56,93 @@ export const rainChkgdnHeadList:TableUpperProps[] = [ { id: "fee", title: "부과금액(천원)", upName: "feeHist", upSequnce: 3 }, ]; +export const supWaterHeadList:TableUpperProps[] = [ + { id: "utztnUsgTest", title: "이용용도" }, + { id: "total", title: "계" ,upName: "subWater", upSequnce: 1 , edit:true}, + { id: "sub1", title: "1월" , upName: "subWater", upSequnce: 2 , edit:true}, + { id: "sub2", title: "2월", upName: "subWater", upSequnce: 3 , edit:true}, + { id: "sub3", title: "3월", upName: "subWater", upSequnce: 4 , edit:true}, + { id: "sub4", title: "4월", upName: "subWater", upSequnce: 5 , edit:true}, + { id: "sub5", title: "5월", upName: "subWater", upSequnce: 6 , edit:true}, + { id: "sub6", title: "6월", upName: "subWater", upSequnce: 7 , edit:true}, + { id: "sub7", title: "7월", upName: "subWater", upSequnce: 8 , edit:true}, + { id: "sub8", title: "8월", upName: "subWater", upSequnce: 9 , edit:true}, + { id: "sub9", title: "9월", upName: "subWater", upSequnce: 10, edit:true }, + { id: "sub10", title: "10월", upName: "subWater", upSequnce: 11 , edit:true}, + { id: "sub11", title: "11월", upName: "subWater", upSequnce: 12 , edit:true}, + { id: "sub12", title: "12월", upName: "subWater", upSequnce: 13 , edit:true}, + ] + + + export const rswtDetailHeadList:TableUpperProps[] = [ + { id: "utztnUsgTest", title: "이용용도" }, + { id: "avre", title: "평균" ,upName: "detailQulity", upSequnce: 1 , edit:true}, + { id: "grssClfg", title: "총대장균군수" , upName: "detailQulity", upSequnce: 2 , edit:true}, + { id: "combResdch", title: "결합잔류염소", upName: "detailQulity", upSequnce: 3 , edit:true}, + { id: "trbt", title: "탁도", upName: "detailQulity", upSequnce: 4 , edit:true}, + { id: "bod", title: "BOD", upName: "detailQulity", upSequnce: 5 , edit:true}, + { id: "smll", title: "냄새", upName: "detailQulity", upSequnce: 6 , edit:true}, + { id: "crmty", title: "색도", upName: "detailQulity", upSequnce: 7 , edit:true}, + { id: "tn", title: "T-N", upName: "detailQulity", upSequnce: 8 , edit:true}, + { id: "tph", title: "T-P", upName: "detailQulity", upSequnce: 9 , edit:true}, + { id: "ph", title: "PH", upName: "detailQulity", upSequnce: 10, edit:true }, + { id: "clIonQnt", title: "염화물", upName: "detailQulity", upSequnce: 11 , edit:true}, + ] + + +export const supWaterData =[{ + utztnUsgTest:'test', + total:100, + sub1:10, + sub2:10, + sub3:10, + sub4:10, + sub5:10, + sub6:10, + sub7:10, + sub8:10, + sub9:10, + sub10:10, + sub11:10, + sub12:10, +}, +{ + utztnUsgTest:'test22', + total:10011, + sub1:101, + sub2:101, + sub3:101, + sub4:101, + sub5:101, + sub6:101, + sub7:101, + sub8:101, + sub9:101, + sub10:101, + sub11:101, + sub12:101, +} +] + +type supWaterDataType ={ + utztnUsgTest:string, + total:number, + sub1:number, + sub2:number, + sub3:number, + sub4:number, + sub5:number, + sub6:number, + sub7:number, + sub8:number, + sub9:number, + sub10:number, + sub11:number, + sub12:number, +} + + + // export const rainChkgdnHeadList:TableUpperProps[] = [ // { id: "cityText", title: "시도" }, @@ -53,18 +154,18 @@ export const rainChkgdnHeadList:TableUpperProps[] = [ // { id: "rainDtnbaOpct", title: "빗물저류조용량(m³)" }, // { id: "checkDay", title: "점검일" }, // { id: "utztnUsg", title: "이용용도" }, -// { id: "sub1", title: "1월" , upName: "yearSubWater", upSequnce: 1 }, -// { id: "sub2", title: "2월", upName: "yearSubWater", upSequnce: 2 }, -// { id: "sub3", title: "3월", upName: "yearSubWater", upSequnce: 3 }, -// { id: "sub4", title: "4월", upName: "yearSubWater", upSequnce: 4 }, -// { id: "sub5", title: "5월", upName: "yearSubWater", upSequnce: 5 }, -// { id: "sub6", title: "6월", upName: "yearSubWater", upSequnce: 6 }, -// { id: "sub7", title: "7월", upName: "yearSubWater", upSequnce: 7 }, -// { id: "sub8", title: "8월", upName: "yearSubWater", upSequnce: 8 }, -// { id: "sub9", title: "9월", upName: "yearSubWater", upSequnce: 9 }, -// { id: "sub10", title: "10월", upName: "yearSubWater", upSequnce: 10 }, -// { id: "sub11", title: "11월", upName: "yearSubWater", upSequnce: 11 }, -// { id: "sub12", title: "12월", upName: "yearSubWater", upSequnce: 12 }, +// { id: "sub1", title: "1월" , upName: "subWater", upSequnce: 1 }, +// { id: "sub2", title: "2월", upName: "subWater", upSequnce: 2 }, +// { id: "sub3", title: "3월", upName: "subWater", upSequnce: 3 }, +// { id: "sub4", title: "4월", upName: "subWater", upSequnce: 4 }, +// { id: "sub5", title: "5월", upName: "subWater", upSequnce: 5 }, +// { id: "sub6", title: "6월", upName: "subWater", upSequnce: 6 }, +// { id: "sub7", title: "7월", upName: "subWater", upSequnce: 7 }, +// { id: "sub8", title: "8월", upName: "subWater", upSequnce: 8 }, +// { id: "sub9", title: "9월", upName: "subWater", upSequnce: 9 }, +// { id: "sub10", title: "10월", upName: "subWater", upSequnce: 10 }, +// { id: "sub11", title: "11월", upName: "subWater", upSequnce: 11 }, +// { id: "sub12", title: "12월", upName: "subWater", upSequnce: 12 }, // { id: "rain1", title: "1월", upName: "yearRainWater", upSequnce: 1 }, // { id: "rain2", title: "2월", upName: "yearRainWater", upSequnce: 2 }, @@ -94,6 +195,9 @@ export type rainChkgdnState = { rainChkgdn: { rainChkgdnHeadList:TableUpperProps[] rainHeadNm:chHeadType[] + supWaterHeadList:TableUpperProps[] + supWaterData:supWaterDataType[] + rswtDetailHeadList:TableUpperProps[] }; }; @@ -108,7 +212,10 @@ export type rainChkgdnType = rainChkgdnState & rainChkgdnActions; export const rainChkgdnStateExport: rainChkgdnState = { rainChkgdn: { rainChkgdnHeadList:rainChkgdnHeadList, - rainHeadNm:rainHeadNm + rainHeadNm:rainHeadNm, + supWaterHeadList:supWaterHeadList, + supWaterData:supWaterData, + rswtDetailHeadList:rswtDetailHeadList, }, }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx index 9df44962f..61cac7aa3 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/htdflReg/index.tsx @@ -1,5 +1,5 @@ import { getFectch, postFectch, putFectch } from "@/components/lib/api"; -import { upHeadList, type bdstAll, type TableUpperProps } from "../rainReg"; +import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg"; import { z } from "zod"; @@ -7,8 +7,8 @@ export const hdtflZod = z.object({ bdstInfoPk: z.number().nullish(), ctpvCd: z.number().default(0), sggCd: z.number().default(0), - daddr: z.string().default(""), - bdstNm: z.string().default(""), + daddr: z.string().default(" "), + bdstNm: z.string().default(" "), frstArchPrmsnDt: z.date().default(() => new Date()), archChgPrmsnDt: z.date().default(() => new Date()).nullish() , archArea: z.number().default(0), @@ -48,7 +48,8 @@ export const hdtflZod = z.object({ plwtYn: z.string().default(""), orgwtWtritSpt: z.number().default(0), orgwtOcrnProcs: z.string().default(""), - wtritEntrcTp: z.number().default(0), + wtritEntrcTp: z.number().max(4, "온도는 100이상이 될 수 없습니다.") + .default(0), amtgnr: z.number().default(0), prcsProcsYn: z.string().default(""), prcsFcltCpct: z.number().default(0), @@ -77,7 +78,7 @@ export const hdtflZod = z.object({ z.object({ bdstInfoFk: z.number().nullish(), archChgPrmsnDt: z.coerce.date() , - archChgArea: z.number().default(0), + archChgArea: z.string().default("-"), bdstChgNm: z.string().default(""), }) ) @@ -228,7 +229,30 @@ export const htdflFacActionsExport: (set: any) => htdflFacSActions = ( try { const res = await postFectch("/drain/facility", data); if (res.ok) { - alert(" 등록이 완료되었습니다."); + + if(data.chgBuilding.length > 0){ + await res + .json() + .then((resData: any) => { + const chPK = resData?.data?.bdstInfoPk; + const makeCh = resData.data.chgBuilding.map( + (item: chgBuilding) => ({ + ...item, + bdstInfoFk: chPK, + }) + ); + const chch = postFectch("/reuseFc/chgBuilding", makeCh); + return chch; + }) + .then((chch: any) => { + if (chch.ok) { + alert("등록이 완료되었습니다."); + } + }); + }else{ + alert("등록이 완료되었습니다."); + + } } const htdflRes = await initFetch(undefined); set((state: htdflFacState) => ({ diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx index e2ab7c2f7..c978b36d9 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx @@ -58,7 +58,7 @@ export const rainZod = z.object({ z.object({ bdstInfoFk: z.number().nullish(), archChgPrmsnDt: z.coerce.date(), - archChgArea: z.number().default(0), + archChgArea: z.string().default("-"), bdstChgNm: z.string().default(""), }) ).default([]) @@ -69,7 +69,7 @@ export const rainZod = z.object({ export type chgBuilding={ bdstInfoFk: number|null, archChgPrmsnDt: Date, - archChgArea: number, + archChgArea: string, bdstChgNm: string } @@ -127,8 +127,10 @@ export type TableUpperProps = { title: string; upName?: string; upSequnce?: number; + edit?:boolean; }; + export const upHeadList: TableUpperProps[] = [ { id: "cityText", title: "시도" }, { id: "sggText", title: "시군구" }, @@ -188,7 +190,7 @@ const rainRes: customRainBdst[] = []; chgBuilding:[{ bdstInfoFk: 0, archChgPrmsnDt: new Date(), - archChgArea: 0, + archChgArea: "-", bdstChgNm: "" }] @@ -291,9 +293,28 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( try { const res = await postFectch("/reuseFc/rainyInfo", data); if(res.ok){ + + if(data.chgBuilding.length > 0){ + await res.json().then((resData: any) => { - - // alert(" 등록이 완료되었습니다.") + const chPK = resData?.data?.bdstInfoPk + const makeCh= resData.data.chgBuilding.map((item: chgBuilding) => + ( { + ...item, + bdstInfoFk: chPK, + }) + ); + const chch= postFectch("/reuseFc/chgBuilding", makeCh); + return chch; + }).then((chch: any) => { + if(chch.ok) { + alert("등록이 완료되었습니다."); + + } + }) + }else{ + alert("등록이 완료되었습니다."); + } } const rainRes = await initFetch(undefined); set((state: rainFacState) => ({ diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx index 4a00e9d8f..73fa5206a 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx @@ -56,9 +56,18 @@ export const rswtZod = z.object({ altUswtrIdntyMthdCd: z.string().default("") }).default({}) }) - ).default([]) - + ).default([]), + chgBuilding: z + .array( + z.object({ + bdstInfoFk: z.number().nullish(), + archChgPrmsnDt: z.coerce.date() , + archChgArea: z.string().default("-"), + bdstChgNm: z.string().default(""), + }) + ) + .default([]), }); @@ -161,10 +170,9 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( rswtUpdate: async (data: customRswtBdst) => { try { const res = await putFectch("/reuseFc/waterreuseFc", data); - if(res.ok){ - alert(" 수정이 완료되었습니다.") + if (res.ok) { + alert("등록이 완료되었습니다."); } - const rswtRes = await initFetch(undefined); set((state: rswtFacState) => ({ ...state, @@ -183,7 +191,29 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( try { const res = await postFectch("/reuseFc/waterreuseFc", data); if(res.ok){ - alert(" 등록이 완료되었습니다.") + if(data.chgBuilding.length > 0){ + await res + .json() + .then((resData: any) => { + const chPK = resData?.data?.bdstInfoPk; + const makeCh = resData.data.chgBuilding.map( + (item: chgBuilding) => ({ + ...item, + bdstInfoFk: chPK, + }) + ); + const chch = postFectch("/reuseFc/chgBuilding", makeCh); + return chch; + }) + .then((chch: any) => { + if (chch.ok) { + alert("등록이 완료되었습니다."); + } + }); + }else{ + alert("등록이 완료되었습니다."); + + } } const rainRes = await initFetch(undefined); set((state: rswtFacState) => ({ diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index bd9d0c460..c1a1a79ea 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -59,7 +59,6 @@ export default function BdstReg({ form }: { form: any }) { }, [selectSgg]) useEffect(() => { - console.log("form", form.getValues()); const subscription = form.form?.watch((value: any) => { console.log('vale', value) }); @@ -308,10 +307,10 @@ export default function BdstReg({ form }: { form: any }) { <FormUi label="면적"> <Input className="" - placeholder="1,000,000" + placeholder="-" type="text" - value={ field.value??0} - onChange={(e) => field.onChange(Number(e.target.value))} + value={ field.value??"-"} + onChange={(e) => field.onChange((e.target.value))} /> </FormUi> diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx index 36895009a..8e529d111 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx @@ -147,7 +147,7 @@ export function RainRegForm({ className="" placeholder="1,000,000" type="" - value={field.value ?? 0} + value={field.value ?? 0} onChange={(e) => { field.onChange(e.target.value === "" ? "" : Number(e.target.value)); }} @@ -299,11 +299,11 @@ export function RainRegForm({ className="" placeholder="1,000,000" type="" - {...field} onChange={(e) => { const value = e.target.value; field.onChange(value === "" ? "" : Number(value)); }} + value={field.value ?? 0} /> </FormUi> )} diff --git a/apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx new file mode 100644 index 000000000..5e33a783e --- /dev/null +++ b/apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx @@ -0,0 +1,92 @@ +import { rainRegExcel } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { + DatePicker, + FileUpload, + Form, + FormField, + FormUi, + Title, +} from "@common/business_components/ui"; +import { Button } from "@common/components/ui"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useState } from "react"; +import { useForm } from "react-hook-form"; +import type { z } from "zod"; + +export default function ChkgdExcel({ type }: { type: string }) { + const [files, setFiles] = useState(null); + + const [dmdDate, setDmdDate] = useState(new Date()); + + const defaultValues: z.infer<typeof rainRegExcel> = rainRegExcel.parse({}); + + const form = useForm<z.infer<typeof rainRegExcel>>({ + resolver: zodResolver(rainRegExcel), + defaultValues: defaultValues, + }); + + const onChangeDate = (val: Date | undefined) => { + if (val) setDmdDate(val); + }; + return ( + <> + <div> + <Form {...form}> + <div> + <Title + title={ + type === "RNB" + ? "빗물 이용시설" + : "중수도 이용시설" + "점검 결과등록" + } + > +
+
+

+ {"○점검정보 입력"} +

+ + +
+ +
+ ( + + field.onChange(date), + }} + selectClass={selectClass} + /> + + )} + /> + + ( + + + + )} + /> +
+ +
+ + ); +} diff --git a/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx b/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx index e3c85465b..73e781487 100644 --- a/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx +++ b/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx @@ -1,11 +1,149 @@ -export default function ChkgdModal(){ +import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page"; +import { useWrStore } from "@/app/store"; +import { ScrollArea, Title, UiTable } from "@common/business_components/ui"; +import { Button } from "@common/components/ui"; +import { useEffect } from "react"; + +export default function ChkgdModal({type, obj}:{type:string , obj:any} ){ + const { rainChkgdn} = useWrStore((state) => state); + + const nodeList = headMakeprfmnc(rainChkgdn?.supWaterHeadList,rainChkgdn?.rainHeadNm ) ; + const rswtnodeList = headMakeprfmnc(rainChkgdn?.rswtDetailHeadList,rainChkgdn?.rainHeadNm ) ; + + + useEffect(() =>{ + + },[rainChkgdn]) + + + const cellClick =(val:number|undefined, headId:string)=>{ + if(val!=undefined) + console.log(rainChkgdn.supWaterData[val]) + + + } return( <> + +
+
+ +
+
+

{"○"+ obj.bdstNm + `(${obj.chckYmd})`}

+ + +
+ + + { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + + {nodeList} + + + + { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + {nodeList} + + + + {type !=='RNB'? +
+ { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + {rswtnodeList} + + + + { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + {rswtnodeList} + + + + { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + {rswtnodeList} + + + + { + cellClick(val, headId); + }} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } }> + {rswtnodeList} + + +
+ :<>} + +
+
diff --git a/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx b/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx index 9cdcd8152..c663bf95b 100644 --- a/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx +++ b/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx @@ -2,8 +2,6 @@ import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page"; import { useWrStore } from "@/app/store"; -import { rainHeadNm } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; -import { rswtHeadNm } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn"; import { UiTable } from "@common/business_components/ui"; export default function RainChkgdTable() {