diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index b18914cdc..2140a7eb6 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -1,27 +1,81 @@ -'use client' +"use client"; import Link from "next/link"; import { Button } from "@common/components/ui"; export default function Home() { return ( <> -
- - - +
+ {/* 시설 등록 */} +
+

시설 등록

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
- - + {/* 지도점검 결과 */} +
+

지도점검 결과

+
+
+ +
+
+
+ + {/* 시설 현황 */} +
+

시설 현황

+
+
+ +
+
+
+ + {/* 수요처 관리 */} +
+

수요처 관리

+
+
+ +
+
+
); diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index ba5a691d1..c92eb8bd3 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -9,6 +9,7 @@ import { SearchFormRight, SearchInput, Title, + UiModal, UiTable, } from "@common/business_components"; import { Button } from "@common/components"; @@ -16,16 +17,25 @@ import { headMakeColSpan } from "../rainReg/page"; import ListDiv from "@common/business_components/ui/list_div"; import { useEffect, useState } from "react"; import { tableData } from "@/components/lib/func/commom"; -import { HtdflRegForm } from "@/components/ui/form/fcltReg/htdflReg/component"; +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 type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg"; -import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg"; export default function Home() { const { code, htdfl, initHtdfl } = useWrStore((state) => state); const nodeList = headMakeColSpan(htdfl.upHeadList); const [searchTxt, setSearchTxt] = useState(""); - const [rswtForm, setRswtForm] = useState(); + const [htdflForm, setHtdflForm] = useState(); const [bdstTable, setbdstTable] = useState(); + const [issNewReg,setIsNewReg] = useState( false); + + const [bdstChgProps, setBdstChgProps] = useState<{ + isOpen: boolean; + chgBuilding: chgBuilding[]; + }>({ isOpen: false, chgBuilding: [] }); + const { htdflRes } = htdfl; useEffect(() => { @@ -40,12 +50,26 @@ export default function Home() { } }, [code, htdflRes]); - const cellClick: (val: number | undefined) => void = (val) => { + const cellClick: (val: number|undefined ,headId: string) => void = ( + val + ,headId) => { if ((bdstTable ?? []).length > 0 && val !== undefined) { { - setRswtForm(htdflRes[val]); + setHtdflForm(htdflRes[val]); } } + + if (headId === "bdstChgYn" && val !== undefined) { + if ( + htdflRes[val]?.bdstInfoPk != null && + htdflRes[val]?.chgBuilding?.length > 0 + ) { + bdstChgModal(htdflRes[val]?.chgBuilding); + } + } + }; + const bdstChgModal = (chgBuilding: chgBuilding[]) => { + setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding }); }; return ( <> @@ -65,8 +89,13 @@ export default function Home() { /> - - + +
@@ -81,7 +110,7 @@ export default function Home() { pageSize={100} total={10} headName={"○건축물 목록"} - cellClick={cellClick} + cellClick={(val,headId)=>{cellClick(val||undefined , headId)}} > {nodeList} @@ -91,13 +120,33 @@ export default function Home() { + } + bodyClass="w-[90vw] max-w-none" + open={issNewReg} + onOpenChange={(open) => { + setIsNewReg(open); + }} + /> + + } + onOpenChange={(open) => { + setBdstChgProps({ ...bdstChgProps, isOpen: open }); + } + } + /> + + ); diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index df9fa8411..1db6b224b 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -90,8 +90,8 @@ const resetContents = () => {
- 운영정보 - 시설정보 + 시설정보 + 차수별정보 +
+ +
+ ( + + 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 new file mode 100644 index 000000000..73e781487 --- /dev/null +++ b/apps/wr/components/ui/modal/chkgdModal/chkgdModal.tsx @@ -0,0 +1,153 @@ +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} + + +
+ :<>} + +
+
+ + + + + ) + +} \ No newline at end of file diff --git a/apps/wr/components/ui/modal/pbnstMng/component.tsx b/apps/wr/components/ui/modal/pbnstMng/component.tsx deleted file mode 100644 index 3dcf3d3b1..000000000 --- a/apps/wr/components/ui/modal/pbnstMng/component.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@common/components"; - -export function PbnstMngModal(butNm:string,chldrn:React.ReactNode) { - return ( - <> - - - - - - - Share link - - Anyone who has this link will be able to view this. - - - {chldrn} - - - - - - - - - - - ); -} diff --git a/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx b/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx new file mode 100644 index 000000000..c663bf95b --- /dev/null +++ b/apps/wr/components/ui/table/rainChkgd/rainChkgdTable.tsx @@ -0,0 +1,28 @@ +'use client' + +import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page"; +import { useWrStore } from "@/app/store"; +import { UiTable } from "@common/business_components/ui"; + +export default function RainChkgdTable() { + + const { code, rainChkgdn} = useWrStore((state) => state); + const nodeList = headMakeprfmnc(rainChkgdn?.rainChkgdnHeadList,rainChkgdn?.rainHeadNm ) ; + + + return( + + <> + {} } > + {nodeList} + + + ) + +} \ No newline at end of file diff --git a/apps/wr/components/ui/table/rswtChkgd/rswtChkgdTable.tsx b/apps/wr/components/ui/table/rswtChkgd/rswtChkgdTable.tsx new file mode 100644 index 000000000..376ab7a95 --- /dev/null +++ b/apps/wr/components/ui/table/rswtChkgd/rswtChkgdTable.tsx @@ -0,0 +1,30 @@ +'use client' + +import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/page"; +import { useWrStore } from "@/app/store"; +import { UiTable } from "@common/business_components/ui"; + +export default function RswtChkgdTable() { + + const { rswtChkgdn} = useWrStore((state) => state); + const nodeList = headMakeprfmnc(rswtChkgdn?.rswtChkgdnHeadList , rswtChkgdn?.rswtHeadNm ); + + + return( + + <> + { } } onPageChange={function (page: number): void { + throw new Error("Function not implemented."); + } } > + {nodeList} + + + ) + +} \ No newline at end of file diff --git a/packages/common/business_components/src/ui/dialog_ui/index.tsx b/packages/common/business_components/src/ui/dialog_ui/index.tsx index 7609e2908..ef611fa40 100644 --- a/packages/common/business_components/src/ui/dialog_ui/index.tsx +++ b/packages/common/business_components/src/ui/dialog_ui/index.tsx @@ -1,50 +1,29 @@ import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTrigger } from "@common/components"; +import { useState } from "react"; type ModalType = { bodyClass: string; - butNm: string; - title: string | undefined; body: React.ReactNode; open?: boolean; onOpenChange?: (open: boolean) => void; } -export function UiModal({ bodyClass, butNm, title, body, open, onOpenChange }: ModalType) { - const dialogProps = open !== undefined && onOpenChange !== undefined && title !== undefined - ? { open, onOpenChange, title } - : {}; - +export function UiModal({ bodyClass, body, open, onOpenChange }: ModalType) { + return ( <> - {!open && ( - - - - + + - {body} + {(open && body)} - )} - {open && ( - - - - - - - {body} - - - - - )} ); } diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 834db2347..368abc5cc 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -9,7 +9,7 @@ type UiTableProps = { pageSize: number; total: number; children: React.ReactNode | undefined; - cellClick : ((index:number|undefined)=>void) | undefined; + cellClick : ((index:number|undefined, headId:string)=>void )| undefined; onPageChange: (page: number) => void; className?: string; } @@ -21,25 +21,22 @@ type UiHeadProps = { export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick, onPageChange, className = '' }: UiTableProps) { const [cur, setCur] = useState(1); - const [idx, setIdx] = useState(0); + const [idx, setIdx] = useState(-1); const handlePageChange = (page: number) => { setCur(page); onPageChange(page); } - const handleCellClick = (index: number) => { + + + const handleCellClick = (index: number,headId:string )=> { if (cellClick) { - console.log("cellClick", index); - cellClick(index); + cellClick(index,headId); setIdx(index); } + + }; -useEffect(() => { - - console.log("idx", idx); - console.log("idx", idx); - - },[idx]) return ( <> {headName ?
@@ -59,7 +56,7 @@ useEffect(() => { {headlist?.map((head) => ( // handleCellClick(index)} key={head.id + index}>{el[head.id]} - handleCellClick(index)} key={head.id + index}>{el[head.id]} + handleCellClick(index,head.id)} key={head.id + index}>{el[head.id]} ))} ))}