diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index 956f7dc84..848fae478 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -18,10 +18,10 @@ import { useEffect, useState } from "react"; import { tableData } from "@/components/lib/func/commom"; import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm"; import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; -import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal"; -import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal"; +import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal"; import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; import { headMakeColSpan } from "../rainReg/TableHead"; +import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; export default function Home() { const { code, htdfl, initHtdfl,getHtdflBdstData } = useWrStore((state) => state); @@ -52,7 +52,7 @@ export default function Home() { (item: customHtdflBdst) => { return { ...item, - bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N", + bdstChgYn: item?.chgBuilding && item.chgBuilding.length > 0 && item.chgBuilding[0]?.bdstChgNm !== null ? 'Y' : 'N', bdstUsgCd: item.reuseBuilding[0]?.bdstUsgCd }; } @@ -146,7 +146,7 @@ export default function Home() { } - bodyClass="w-[90vw] max-w-none" + bodyClass="w-[40vw] max-w-none" open={issNewReg} onOpenChange={(open) => { setIsNewReg(open); diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 30ddd1f4a..00e77a364 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -6,8 +6,8 @@ import { } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { tableData } from "@/components/lib/func/commom"; import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm"; -import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal"; -import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal"; +import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal"; +import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { ContentsDiv, ScrollArea, diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx index 597973ac9..e44ebc0b9 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx @@ -1,6 +1,5 @@ "use client"; import { useWrStore } from "@/app/store"; -import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal"; import { ContentsDiv, ScrollArea, @@ -18,9 +17,10 @@ import { useEffect, useState } from "react"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; import { tableData } from "@/components/lib/func/commom"; import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm"; -import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal"; +import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal"; import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { headMakeColSpan } from "../rainReg/TableHead"; +import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; export default function Home() { const { code, rswt, initRswt ,rswtBdstSearch,getRswtBdstData} = useWrStore((state) => state); @@ -47,7 +47,7 @@ export default function Home() { (item: customRswtBdst) => { return { ...item, - bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N", + bdstChgYn: item.chgBuilding[0]?.bdstChgNm != null? "Y" : "N", bdstUsgCd: item.reuseBuilding[0]?.bdstUsgCd }; } @@ -153,7 +153,7 @@ export default function Home() { } - bodyClass="w-[90vw] max-w-none" + bodyClass="w-[40vw] max-w-none" open={issNewReg} onOpenChange={(open) => { setIsNewReg(open); diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx index 6c865932e..4b49bac64 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx @@ -12,9 +12,9 @@ import { } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; import { Button } from "@common/components/ui"; -import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/page"; -import HeadChModal from "@/components/ui/modal/headChModal/headChModal"; +import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal"; import { useState } from "react"; +import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/TableHead"; export default function PbnstSttn() { const { code, rainSttn } = useWrStore((state) => state); @@ -132,7 +132,7 @@ export default function PbnstSttn() { setIsChHead(!isChHead); }} bodyClass={""} - body={} + body={} /> diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx index 7bfcc29b0..8ed57f120 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx @@ -7,7 +7,7 @@ import { getCityOrSgg, tableData, } from "@/components/lib/func/commom"; -import HeadChModal from "@/components/ui/modal/headChModal/headChModal"; +import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal"; import { ContentsDiv, SearchBaseForm, @@ -19,22 +19,46 @@ import { import ListDiv from "@common/business_components/ui/list_div"; import { Button } from "@common/components/ui"; import { useCallback, useEffect, useRef, useState } from "react"; -import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import type { chgBuilding, customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; +import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal"; +import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal"; export default function RainSttn() { const { code, rainSttn, rainSttnSearch, rainSttnInit } = useWrStore( (state) => state ); + const { rainSttnRes } = rainSttn; + const ref = useRef({} as ReturnType); const [pageNation, setPageNation] = useState(1); - const { rainSttnRes } = rainSttn; const [isChHead, setIsChHead] = useState(false); - const ref = useRef({} as ReturnType); const [bdstTable, setBdstTable] = useState(); + const [detailModal, setDetailModal] = useState<{isOpen:boolean,data:customRainBdst|undefined}>({data:undefined,isOpen:false }) + const [bdstChgProps, setBdstChgProps] = useState<{ + isOpen: boolean; + chBuilding: chgBuilding[]; + }>({ isOpen: false, chBuilding: [] }); const codeData = getCityOrSgg(ref); + const cellClick=(index:number|undefined, headId: string)=>{ + + if(headId!=='chBuildingYn' && index!==undefined && bdstTable!==undefined){ + setDetailModal({isOpen:true ,data:bdstTable[index] }) + }else if( headId==='chBuildingYn' && index!==undefined && bdstTable!==undefined){ + if ( + bdstTable[index] && + bdstTable[index]?.chgBuilding[0]?.bdstChgNm!==null + + ) { + setBdstChgProps({ isOpen:true , chBuilding: bdstTable[index].chgBuilding}); + } + } + + } + + useEffect(() => { if (!rainSttn.isInit) { rainSttnInit(codeData ?? "0"); @@ -49,6 +73,8 @@ export default function RainSttn() { ...item, ...item.reuseBuilding[0], ...item.reuseBuilding[0].rainyObj, + chBuildingYn:item.chgBuilding[0].bdstChgNm!==null?'Y':'N' + })) .filter((item: any) => item.rainyObj !== undefined); @@ -128,7 +154,7 @@ export default function RainSttn() { headlist={rainSttn.rainSttHeadList} pageSize={20} total={100000} - cellClick={undefined} + cellClick={(index: number | undefined,headId:string)=>{cellClick(index ?? undefined,headId)} } onPageChange={setPageNation} > @@ -150,6 +176,23 @@ export default function RainSttn() { /> } /> + { + setDetailModal({...detailModal, isOpen:!detailModal.isOpen}) + }} + bodyClass={"w-[40vw] max-w-none max-h-[calc(100%-70px)]"} + body={}/> + + } + onOpenChange={(open) => { + setBdstChgProps({ ...bdstChgProps, isOpen: open }); + }} + /> ); diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx index 73ea9b13a..d13cf8a12 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx @@ -3,7 +3,7 @@ import { useWrStore } from "@/app/store"; import { btnClass } from "@/app/store/common/code"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; import { excelDownload, getCityOrSgg, tableData } from "@/components/lib/func/commom"; -import HeadChModal from "@/components/ui/modal/headChModal/headChModal"; +import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal"; import { ContentsDiv, SearchBaseForm, diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx index 2e8b4ee48..d988b46d8 100644 --- a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx @@ -6,8 +6,8 @@ import { type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import { excelDownload } from "@/components/lib/func/commom"; -import ChkgdExcel from "@/components/ui/modal/chkgdExcel/chkgdExcel"; -import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal"; +import ChkgdExcel from "@/components/ui/modal/chkgd/chkgdExcel/chkgdExcel"; +import ChkgdModal from "@/components/ui/modal/chkgd/chkgdModal/chkgdModal"; import RainChkgdTable from "@/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable"; import RswtChkgdTable from "@/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable"; import { diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx index d6c8d8345..7d6e626c7 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx @@ -1,7 +1,6 @@ import type { SelectDataType } from "@common/business_components"; import type { rainChkZodType } from "."; import { TEST_UUID } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; -import { excelSerialToDateString } from "@/components/lib/func/commom"; const useTypes = [ "조경용수", "청소화장실용수", diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx index 5387f4292..8ae786488 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/excel.tsx @@ -12,6 +12,7 @@ export const excelRainSttnParsing = (data: customRainBdst[]): string[][] => { String(item.bdstInfoPk ?? ""), String(item.frstArchPrmsnDt ?? ""), String(item.archArea ?? ""), + String(item.chgBuilding.length>0 ? "Y" :"N"), String(item.reuseBuilding?.[0]?.lawTrgtYn ?? ""), String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""), String(item.reuseBuilding?.[0]?.instlCst ?? ""), diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx index 354f98a1b..314997b4f 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/headList.tsx @@ -1,139 +1,137 @@ import type { CommonTableProps } from "@/app/store/common/type/headder"; import { z } from "zod"; - export const sttnHeadListType = z.array( - z.object({ - id: z.string(), - title: z.string(), - visible: z.boolean(), - }) - ); - + z.object({ + id: z.string(), + title: z.string(), + visible: z.boolean(), + }) +); export const rainSttHeadListExport: z.infer = [ + { + id: "cityText", + title: "시도", + visible: true, + }, + { + id: "sggText", + title: "시군구", + visible: true, + }, + { + id: "bdstNm", + title: "건축물명", + visible: true, + }, + { + id: "daddr", + title: "주소", + visible: true, + }, + { + id: "bdstUsgCd", + title: "건축물용도코드", + visible: true, + }, + { + id: "frstArchPrmsnDt", + title: "최초건축허가일시", + visible: true, + }, + { + id: "archArea", + title: "건축면적", + visible: true, + }, + { + id: "chBuildingYn", + title: "중축・개축・재축여부", + visible: true, + }, + { + id: "lawTrgtYn", + title: "법적의무대상여부", + visible: true, + }, + { + id: "instlCmptnDt", + title: "설치완료일시", + visible: true, + }, -{ - id: "cityText", - title: "시도", - visible: true, -}, -{ - id: "sggText", - title: "시군구", - visible: true, -}, -{ - id: "bdstNm", - title: "건축물명", - visible: true, -}, -{ - id: "daddr", - title: "주소", - visible: true, -}, -{ - id: "bdstUsgCd", - title: "건축물용도코드", - visible: true, -}, -{ - id: "frstArchPrmsnDt", - title: "최초건축허가일시", - visible: true, -}, -{ - id: "archArea", - title: "건축면적", - visible: true, -}, -{ - id: "lawTrgtYn", - title: "법적의무대상여부", - visible: true, -}, -{ - id: "instlCmptnDt", - title: "설치완료일시", - visible: true, -}, + { + id: "instlCst", + title: "설치비용", + visible: true, + }, -{ - id: "instlCst", - title: "설치비용", - visible: true, -}, + { + id: "pntfColKnd", + title: "집수지점종류", + visible: true, + }, + { + id: "pntfColArea", + title: "집수지점면적", + visible: true, + }, + { + id: "dtfcltCpct", + title: "저류조용량", + visible: true, + }, + { + id: "filtrTrtmfctYn", + title: "여과처리시설유무", + visible: true, + }, + { + id: "filtrTrtmfctCpct", + title: "여과처리시설용량", + visible: true, + }, + { + id: "filtrTrtmfctPrs", + title: "여과처리시설처리공정", + visible: true, + }, -{ - id: "pntfColKnd", - title: "집수지점종류", - visible: true, -}, -{ - id: "pntfColArea", - title: "집수지점면적", - visible: true, -}, - -{ - id: "dtfcltCpct", - title: "저류조용량", - visible: true, -}, -{ - id: "filtrTrtmfctYn", - title: "여과처리시설유무", - visible: true, -}, -{ - id: "filtrTrtmfctCpct", - title: "여과처리시설용량", - visible: true, -}, -{ - id: "filtrTrtmfctPrs", - title: "여과처리시설처리공정", - visible: true, -}, - - -{ - id: "instlCstSprtYn", - title: "설치지원비용여부", - visible: true, -}, -{ - id: "instlCstSprtAmt", - title: "설치지원비용", - visible: true, -}, - -{ - id: "grntchBdstCertYn", - title: "녹색건축물인증여부", - visible: true, -}, -{ - id: "grntchBdstCertYr", - title: "녹색건축물인증년도", - visible: true, -}, -{ - id: "grntchBdstCertNo", - title: "녹색건축물인증번호", - visible: true, -}, -{ - id: "grntchBdstCertGrd", - title: "녹색건축물인증등급", - visible: true, -}, + { + id: "instlCstSprtYn", + title: "설치지원비용여부", + visible: true, + }, + { + id: "instlCstSprtAmt", + title: "설치지원비용", + visible: true, + }, + { + id: "grntchBdstCertYn", + title: "녹색건축물인증여부", + visible: true, + }, + { + id: "grntchBdstCertYr", + title: "녹색건축물인증년도", + visible: true, + }, + { + id: "grntchBdstCertNo", + title: "녹색건축물인증번호", + visible: true, + }, + { + id: "grntchBdstCertGrd", + title: "녹색건축물인증등급", + visible: true, + }, ]; - // id는 다확인해야함 export const rainSttNodeListExport: CommonTableProps[] = [ { @@ -142,7 +140,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ visible: true, row: 1, rowSpan: 1, - colSpan: 9, + colSpan: 10, }, { id: "rainFcltInfo", @@ -165,19 +163,17 @@ export const rainSttNodeListExport: CommonTableProps[] = [ title: "행정구역", visible: true, row: 2, - upName:'bdnstInfo', + upName: "bdnstInfo", rowSpan: 1, colSpan: 2, }, - - // 3번째줄 시작 { id: "cityText", title: "시도", visible: true, - upName:'adminDiv', + upName: "adminDiv", row: 3, rowSpan: 1, colSpan: 1, @@ -186,7 +182,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ id: "sggText", title: "시군구", visible: true, - upName:'adminDiv', + upName: "adminDiv", row: 3, rowSpan: 1, colSpan: 1, @@ -198,7 +194,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ id: "bdstNm", title: "건축물명", visible: true, - upName:'bdnstInfo', + upName: "bdnstInfo", row: 2, rowSpan: 2, colSpan: 1, @@ -207,7 +203,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ id: "daddr", title: "주소", visible: true, - upName:'bdnstInfo', + upName: "bdnstInfo", row: 2, rowSpan: 2, colSpan: 1, @@ -215,7 +211,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "bdstUsgCd", title: "건축물용도코드", - upName:'bdnstInfo', + upName: "bdnstInfo", visible: true, row: 2, rowSpan: 2, @@ -224,7 +220,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "frstArchPrmsnDt", title: "최초건축허가일시", - upName:'bdnstInfo', + upName: "bdnstInfo", visible: true, row: 2, rowSpan: 2, @@ -233,7 +229,16 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "archArea", title: "건축면적", - upName:'bdnstInfo', + upName: "bdnstInfo", + visible: true, + row: 2, + rowSpan: 2, + colSpan: 1, + }, + { + id: "chBuildingYn", + title: "중축・개축・재축여부", + upName: "bdnstInfo", visible: true, row: 2, rowSpan: 2, @@ -242,7 +247,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "lawTrgtYn", title: "법적의무대상여부", - upName:'bdnstInfo', + upName: "bdnstInfo", visible: true, row: 2, rowSpan: 2, @@ -251,7 +256,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "instlCmptnDt", title: "설치완료일시", - upName:'bdnstInfo', + upName: "bdnstInfo", visible: true, row: 2, rowSpan: 2, @@ -261,7 +266,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "instlCst", title: "설치비용", - upName:'rainFcltInfo', + upName: "rainFcltInfo", visible: true, row: 2, rowSpan: 2, @@ -271,7 +276,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "pntfCol", title: "집수면", - upName:'rainFcltInfo', + upName: "rainFcltInfo", visible: true, row: 2, rowSpan: 1, @@ -281,7 +286,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "pntfColKnd", title: "집수지점종류", - upName:'pntfCol', + upName: "pntfCol", visible: true, row: 3, rowSpan: 1, @@ -290,7 +295,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "pntfColArea", title: "집수지점면적", - upName:'pntfCol', + upName: "pntfCol", visible: true, row: 3, rowSpan: 1, @@ -300,7 +305,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "dtfcltCpct", title: "저류조용량", - upName:'rainFcltInfo', + upName: "rainFcltInfo", visible: true, row: 2, rowSpan: 2, @@ -309,7 +314,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "filtrTrtmfctYn", title: "여과처리시설유무", - upName:'filtrTrtmfct', + upName: "filtrTrtmfct", visible: true, row: 3, rowSpan: 1, @@ -318,7 +323,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "filtrTrtmfctCpct", title: "여과처리시설용량", - upName:'filtrTrtmfct', + upName: "filtrTrtmfct", visible: true, row: 3, rowSpan: 1, @@ -327,7 +332,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "filtrTrtmfctPrs", title: "여과처리시설처리공정", - upName:'filtrTrtmfct', + upName: "filtrTrtmfct", visible: true, row: 3, rowSpan: 1, @@ -338,7 +343,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ id: "filtrTrtmfct", title: "여과등 처리시설", visible: true, - upName:'insenInfo', + upName: "insenInfo", row: 2, rowSpan: 1, colSpan: 3, @@ -346,7 +351,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "instlCstSprtYn", title: "설치지원비용여부", - upName:'instlCstSprt', + upName: "instlCstSprt", visible: true, row: 3, rowSpan: 1, @@ -355,7 +360,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "instlCstSprtAmt", title: "설치지원비용", - upName:'instlCstSprt', + upName: "instlCstSprt", visible: true, row: 3, rowSpan: 1, @@ -365,7 +370,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "instlCstSprt", title: "설치비지원", - upName:'insenInfo', + upName: "insenInfo", visible: true, row: 2, rowSpan: 1, @@ -375,7 +380,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "grntchBdstCertYn", title: "녹색건축물인증여부", - upName:'grntchBdstCert', + upName: "grntchBdstCert", visible: true, row: 3, rowSpan: 1, @@ -384,7 +389,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "grntchBdstCertYr", title: "녹색건축물인증년도", - upName:'grntchBdstCert', + upName: "grntchBdstCert", visible: true, row: 3, rowSpan: 1, @@ -393,7 +398,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "grntchBdstCertNo", title: "녹색건축물인증번호", - upName:'grntchBdstCert', + upName: "grntchBdstCert", visible: true, row: 3, rowSpan: 1, @@ -402,7 +407,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "grntchBdstCertGrd", title: "녹색건축물인증등급", - upName:'grntchBdstCert', + upName: "grntchBdstCert", visible: true, row: 3, rowSpan: 1, @@ -411,7 +416,7 @@ export const rainSttNodeListExport: CommonTableProps[] = [ { id: "grntchBdstCert", title: "녹색건축물인증", - upName:'insenInfo', + upName: "insenInfo", visible: true, row: 2, rowSpan: 1, @@ -419,3 +424,160 @@ export const rainSttNodeListExport: CommonTableProps[] = [ }, ]; +export const rainSttnDetailNodeListExport:CommonTableProps[] = [ + { id: "totalSplyUswtrUtztnQnt", + title: "연간보급수이용량(m³)", + visible: true, + row: 1, + rowSpan: 2, + colSpan: 1, + }, + { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)", + visible: true, + row: 1, + rowSpan: 2, + colSpan: 1 + }, + { id: "useQulity", + title: "이용수질(필요시)", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 4 + }, + { id: "ph", title: "PH", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + + }, + { + id: "trbt", + title: "탁도", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, + { + id: "grssClfg", + title: "총대장균군수", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, + { + id: "etc", + title: "기타", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, + { id: "feeHistory", + title: "과태료부과내역", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 3 + }, + { + id: "vltnDt", + title: "부과일(위반일)", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, + { + id: "vltnMttr", + title: "위반사항", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, + { + id: "levyAmt", + title: "부과금액(천원)", + visible: true, + row: 2, + rowSpan: 1, + colSpan: 1 + }, +]; + +export const rainSttnDetailHeadListExport:CommonTableProps[] = [ + { id: "totalSplyUswtrUtztnQnt", + title: "연간보급수이용량(m³)", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1, + }, + { id: "totalRuseFcltUtztnQnt", title: "연간빗물이용량(m³)", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + + { id: "ph", title: "PH", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + + }, + { + id: "trbt", + title: "탁도", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + { + id: "grssClfg", + title: "총대장균군수", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + { + id: "etc", + title: "기타", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + + { + id: "vltnDt", + title: "부과일(위반일)", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + { + id: "vltnMttr", + title: "위반사항", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, + { + id: "levyAmt", + title: "부과금액(천원)", + visible: true, + row: 1, + rowSpan: 1, + colSpan: 1 + }, +]; diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/index.tsx index c0f829e41..afc64ba40 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rainSttn/index.tsx @@ -1,4 +1,4 @@ -import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; +import type { chHeadType, rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import { fetchType, getFetch } from "@/components/lib/api"; import { type customRainBdst, @@ -8,15 +8,20 @@ import { rainSttHeadListExport, sttnHeadListType, rainSttNodeListExport, + rainSttnDetailHeadListExport, + rainSttnDetailNodeListExport, } from "./headList"; import type { z } from "zod"; import type { CommonTableProps } from "@/app/store/common/type/headder"; // 테이블 헤드 리스트 -const rainSttNodeList = rainSttNodeListExport; const rainSttHeadList = rainSttHeadListExport; -const rainSttnRes: customRainBdst[] = []; +const rainSttNodeList = rainSttNodeListExport; +const rainSttnDetailNodeList = rainSttnDetailNodeListExport; +const rainSttnDetailHeadList = rainSttnDetailHeadListExport; +const rainSttnRes: customRainBdst[] = []; +const rainChkRes : rainChkZodType ={} as rainChkZodType const visibleHeadList = (falseHeads:CommonTableProps[], orgNodeList:CommonTableProps[])=>{ @@ -87,6 +92,9 @@ export type rainSttnState = { rainSttnRes: customRainBdst[]; rainSttHeadList: CommonTableProps[]; rainSttNodeList: CommonTableProps[]; + rainSttnDetailHeadList:CommonTableProps[] + rainSttnDetailNodeList:CommonTableProps[] + rainChkRes:rainChkZodType excelList: []; isInit: boolean; }; @@ -97,6 +105,7 @@ type rainSttnActions = { rainChSttnHead: ( headList: z.infer, ) => void; + rainSttnChkSearch:(rusePk:string) => void; }; export type rainSttnType = rainSttnState & rainSttnActions; @@ -105,7 +114,10 @@ export const rainSttnStateExport: rainSttnState = { rainSttn: { rainSttHeadList: rainSttHeadList, rainSttNodeList: rainSttNodeList, + rainSttnDetailHeadList:rainSttnDetailHeadList, + rainSttnDetailNodeList:rainSttnDetailNodeList, rainSttnRes: rainSttnRes, + rainChkRes:rainChkRes, excelList: [], isInit: false, }, @@ -181,5 +193,22 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = ( }, })); }, + rainSttnChkSearch: async( + rusePk:string + )=>{ + const rainChkRes = await getFetch( + fetchType.WR, + `/reuseChk/rainy/${rusePk}` + ); + + return set((state: rainSttnState) =>({ + rainSttn: { + ...state.rainSttn, + rainChkRes:rainChkRes + }, + + }) ) + } + }; }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx index 96edde5ca..9a342274d 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/rswtSttn/excel.tsx @@ -12,10 +12,10 @@ export const excelRSwtSttnParsing = (data: customRswtBdst[]): string[][] => { String(item.bdstUsgText ?? ""), String(item.frstArchPrmsnDt ?? ""), String(item.archArea ?? ""), + String(item.reuseBuilding?.[0]?.rswtrObj.oblgTrgtWtrUsqty ?? ""), String(item.chgBuilding.length>0 ? "Y" :"N"), String(item.reuseBuilding?.[0]?.lawTrgtYn ?? ""), String(item.reuseBuilding?.[0]?.instlCmptnDt ?? ""), - String(item.reuseBuilding?.[0]?.rswtrObj.oblgTrgtWtrUsqty ?? ""), String(item.reuseBuilding?.[0]?.instlCst ?? ""), item.reuseBuilding?.[0]?.rswtrObj?.orgwtKndCd ?? "", String(item.reuseBuilding?.[0]?.rswtrObj.filtrTrtmfctCpct ?? ""), diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index 02610279f..3b246ba20 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -1,17 +1,17 @@ import { useWrStore } from "@/app/store"; -import type { selectArray } from "@/app/store/common/code"; import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { formatCommaNumber, getCity, handleCommaNumberChange, } from "@/components/lib/func/commom"; -import type { objSearchType } from "@/components/ui/modal/bdstRegModal/bdstRegModal"; +import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; import { FormField, FormUi, DatePicker, SelectBox, + type SelectDataType, } from "@common/business_components"; import { Button, Input } from "@common/components"; import { useEffect, useRef, useState } from "react"; @@ -41,7 +41,7 @@ export default function BdstReg({ form }: { form: any }) { } }; - const [selectSgg, setSelectSgg] = useState(); + const [selectSgg, setSelectSgg] = useState(); const [objSearch, setObjSearch] = useState({ sgg: "", city: "", diff --git a/apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx similarity index 96% rename from apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx rename to apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx index 895af4388..72a7414c1 100644 --- a/apps/wr/components/ui/modal/chkgdExcel/chkgdExcel.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx @@ -1,7 +1,7 @@ import { useWrStore } from "@/app/store"; import { rainChkZod, rainRegExcel, type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import { excelToRainChkData } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel"; -import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { ToastFormUi } from "@/components/ui/toast/toastFromUi"; import { DatePicker, filePicked, @@ -17,7 +17,6 @@ import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import toast, { Toaster } from "react-hot-toast"; import type { z } from "zod"; -import { ToastFormUi } from "../../toast/toastFromUi"; export default function ChkgdExcel({ type }: { type: string }) { const { rainChkExcelDataUPload } = useWrStore((state) => { diff --git a/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx b/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx similarity index 98% rename from apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx rename to apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx index c07a84341..d6c332042 100644 --- a/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdModal/chkgdModal.tsx @@ -2,9 +2,9 @@ import { useWrStore } from "@/app/store"; import { ScrollArea, Title, UiTable } from "@common/business_components/ui"; import { Button } from "@common/components/ui"; import { useEffect, useState } from "react"; -import { GuideDetailsTable } from "../../table/chkgdTable/guideDetailTable/guideDetailTable"; import type { splRuseWaterType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead"; +import { GuideDetailsTable } from "@/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable"; export default function ChkgdModal({ type, obj }: { type: string; obj: any }) { const { rainChkgdn, rainChkDetilUpdate, rainChkGuidUpdate } = useWrStore( diff --git a/apps/wr/components/ui/modal/bdstChgModal/bdstChgModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx similarity index 100% rename from apps/wr/components/ui/modal/bdstChgModal/bdstChgModal.tsx rename to apps/wr/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal.tsx diff --git a/apps/wr/components/ui/modal/bdstRegModal/bdstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx similarity index 91% rename from apps/wr/components/ui/modal/bdstRegModal/bdstRegModal.tsx rename to apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx index c00f54bd1..9091e4521 100644 --- a/apps/wr/components/ui/modal/bdstRegModal/bdstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx @@ -7,13 +7,13 @@ import { import { ScrollArea, SelectBox, UiTable, type SelectDataType } from "@common/business_components"; import { Button, Input, Label } from "@common/components"; import { useEffect, useState } from "react"; -import RainRegForm from "../../form/fcltReg/rainReg/rainRegForm"; import { getCity, tableData } from "@/components/lib/func/commom"; import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; -import HtdflRegForm from "../../form/fcltReg/htdflReg/htdflRegForm"; import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; -import RswtrRegForm from "../../form/fcltReg/rswtrReg/rswtrRegForm"; import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/TableHead"; +import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm"; +import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm"; +import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm"; export type objSearchType = { sgg: string|number; @@ -131,8 +131,10 @@ export function BdstReg({ moType }: BdstRegProps) { pageSize={-10} total={-1} headName={undefined} - cellClick={(idx,headId)=> (tableClick(idx, headId||"" ))} - > + cellClick={(idx, headId) => (tableClick(idx, headId || ""))} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } } > {nodeList} diff --git a/apps/wr/components/ui/modal/headChModal/headChModal.tsx b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx similarity index 100% rename from apps/wr/components/ui/modal/headChModal/headChModal.tsx rename to apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx diff --git a/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx b/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx new file mode 100644 index 000000000..2ea483364 --- /dev/null +++ b/apps/wr/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal.tsx @@ -0,0 +1,102 @@ +"use client"; +import { ScrollArea, Title, UiTable } from "@common/business_components/ui"; +import RainRegForm from "../../../form/fcltReg/rainReg/rainRegForm"; +import RswtrRegForm from "../../../form/fcltReg/rswtrReg/rswtrRegForm"; +import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; +import { useWrStore } from "@/app/store"; +import { useEffect, useState } from "react"; +import type { CommonTableProps } from "@/app/store/common/type/headder"; +import { rightTableData } from "@/components/lib/func/TableData"; +import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan"; + +export default function SttnDetailModal({ + type, + formObj, +}: { + type: string; + formObj: any; +}) { + const { code, rainSttn, rswtSttn, rainSttnChkSearch } = useWrStore( + (state) => state + ); + const [detailData, setDetailData] = useState({ + head: [] as CommonTableProps[], + node:[] as CommonTableProps[], + data: {} as any, + }); + + useEffect(() => { + if (type === "RNB" && formObj.reuseBuilding[0]) { + rainSttnChkSearch(formObj.reuseBuilding[0].bdstRuseFcltPk); + + } else if (type === "RST") { + } + }, [type, formObj]); + + useEffect(() => { + if ( + type === "RNB" && + formObj.reuseBuilding[0] && + rainSttn.rainChkRes?.bdstRuseFcltFk + ) { + const tableTotalData = rightTableData([rainSttn.rainChkRes]); + const data = tableTotalData.map((item) => { + const obj = { + totalSplyUswtrUtztnQnt: item.totalSplyUswtrUtztnQnt, + totalRuseFcltUtztnQnt: item.totalRuseFcltUtztnQnt, + ph: item.ph, + trbt: item.trbt, + grssClfg: item.grssClfg, + etc: item.etc, + vltnDt: item.vltnDt, + vltnMttr: item.vltnMttr, + levyAmt: item.levyAmt, + }; + return obj; + }); + setDetailData({ + head: rainSttn.rainSttnDetailHeadList, + node:rainSttn.rainSttnDetailNodeList, + data: data, + }); + } else if (type === "RST") { + } + }, [rainSttn.rainChkRes]); + + useEffect(() =>{ + setDetailData({data:[] , head:[], node:[]}) + + },[]) + + return ( + +
+ + 0?"h-[80vh]":"h-[70vh]"} > + {type === "RNB" ? ( + + ) : ( + + )} + + {detailData.data.length>0? + } + + pageSize={0} + total={0} + cellClick={undefined} + onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + }} + >:<>} + +
+ ); +} diff --git a/apps/wr/components/ui/table/chkgdTable/rainChjgdDetail/rainChkgdDetailTable.tsx b/apps/wr/components/ui/table/chkgdTable/rainChjgdDetail/rainChkgdDetailTable.tsx new file mode 100644 index 000000000..e69de29bb