diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx
index c173173ff..0d981b194 100644
--- a/apps/wr/app/page.tsx
+++ b/apps/wr/app/page.tsx
@@ -48,6 +48,11 @@ export default function Home() {
+
+
+
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
index 8cbca00cb..2e06b05b3 100644
--- a/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
+++ b/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
@@ -7,20 +7,24 @@ import type {
customRainBdst,
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import { getCityOrSgg, tableData } from "@/components/lib/func/commom";
+import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
import {
ContentsDiv,
SearchBaseForm,
Title,
+ UiModal,
UiTable,
type ReturnType,
} from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
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";
import { Button } from "@common/components/ui";
import { useCallback, useEffect, useRef, useState } from "react";
export default function HtdflSttn() {
- const { code, htdflSttn ,initHtdfl} = useWrStore((state) => state);
+ const { code, htdflSttn, htdflSttnSearch, initHtdfl} = useWrStore((state) => state);
const { htdflSttnRes } = htdflSttn;
const ref = useRef({} as ReturnType);
@@ -40,11 +44,26 @@ export default function HtdflSttn() {
const codeData = getCityOrSgg(ref);
const excelClick = useCallback(() => {
- // if (codeData) rainSttnSearch(1, "10000", codeData);
+ if (codeData) htdflSttnSearch(1, "10000", codeData);
}, []);
- const cellClick = (index: number | undefined, headId: string) => {};
+ useEffect(() => {
+ if (codeData != null) htdflSttnSearch(pageNation, "20", codeData);
+ }, [pageNation]);
+ 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 (!htdflSttn.isInit) {
@@ -129,6 +148,39 @@ export default function HtdflSttn() {
+ {
+ setIsChHead(!isChHead);
+ }}
+ bodyClass={""}
+ body={
+ ({
+ ...item,
+ visible: item.visible ?? false,
+ }))}
+ />
+ }
+ />
+ {
+ 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/prfmncSttn/chkgdnSttn/page.tsx b/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
new file mode 100644
index 000000000..4ddc4246a
--- /dev/null
+++ b/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
@@ -0,0 +1,206 @@
+"use client";
+
+import { useWrStore } from "@/app/store";
+import { type rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
+import type { rswtChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
+import {
+ excelArrayDownload,
+ excelDownload,
+} from "@/components/lib/func/commom";
+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 {
+ ContentsDiv,
+ SearchDiv,
+ SearchFormLeft,
+ SearchFormRight,
+ SearchInput,
+ SelectBox,
+ Title,
+ UiModal,
+} from "@common/business_components/ui";
+import ListDiv from "@common/business_components/ui/list_div";
+import { Button } from "@common/components/ui";
+import { useCallback, useEffect, useState } from "react";
+import { Toaster } from "react-hot-toast";
+
+//-----------------------
+export default function Page() {
+ const {
+ code,
+ rainChkgdn,
+ rswtChkgdn,
+ rainChkInit,
+ rainChkDetilUpdate,
+ rainChkDelete,
+ rainChkExcelDownload,
+ rswtrChkExcelDownload,
+
+ rswtChkgdnInit
+ } = useWrStore((state) => {
+ return state;
+ });
+ const [isRegExcel, setIsRegExcel] = useState(false);
+ const [searchTxt, setSearchTxt] = useState();
+ const [updateRainDetail, setUpdateRainDetail] = useState(
+ []
+ );
+ const [deleteIdx, setDeleteIdx] = useState([]);
+ const [selFcltDiv, setSelFcltDiv] = useState("RNB");
+ const [isModal, setIsModal] = useState({
+ open: false,
+ data: {},
+ });
+ const cellClick = () => {
+ if (searchTxt) rainChkInit(searchTxt, "0");
+ };
+
+ useEffect(() => {
+ if (!rainChkgdn.isInit) {
+ rainChkInit("2024", "0");
+ setIsModal({ data: {}, open: rainChkgdn.isModalClose });
+ setIsRegExcel(false);
+ }
+
+ if (!rswtChkgdn.isInit) {
+ rswtChkgdnInit("2024", "0");
+ setIsModal({ data: {}, open: rainChkgdn.isModalClose });
+ setIsRegExcel(false);
+ }
+ }, [rainChkgdn.isInit, rainChkInit]);
+
+ useEffect(() => {
+ console.log("rswtChkgdn.excelList ", rswtChkgdn.excelList);
+
+ if (rswtChkgdn.excelList[0]?.data.length > 1)
+ excelArrayDownload(
+ "중수도_점검결과_이용량현황",
+ "sample_rs_chk.xlsx",
+ rswtChkgdn.excelList
+ );
+ }, [rswtChkgdn.excelList]);
+
+ useEffect(() => {
+ excelDownload(
+ rainChkgdn.excelList,
+ "빗물이용시설 지도점검",
+ "sample_rainy.xlsx",
+ "A1:AN1"
+ );
+ }, [rainChkgdn.excelList]);
+
+ const excelClick = useCallback(() => {
+ console.log("selFcltDiv ", selFcltDiv);
+ if (selFcltDiv === "RNB") {
+ rainChkExcelDownload(code.cityCd, code.sggCd);
+ } else {
+ rswtrChkExcelDownload(code.cityCd, code.sggCd);
+ }
+ }, [
+ rainChkExcelDownload,
+ rswtrChkExcelDownload,
+ code.cityCd,
+ code.sggCd,
+ selFcltDiv,
+ ]);
+
+ const handleClick = useCallback(
+ (data: any) => {
+ if (data) setIsModal({ open: true, data: data });
+ },
+ [isModal]
+ );
+
+ const clickDelete = (data: number[]) => {
+ if (data.length > 0) {
+ rainChkDelete(data);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+ {
+ setSearchTxt(e);
+ }}
+ />
+
+ setSelFcltDiv(String(val))
+ }
+ value={selFcltDiv ?? rainChkgdn.fcltDiv[0]?.val}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {selFcltDiv === "RNB" ? (
+
+ ) : (
+
+ )}
+
+
+
+ {
+ setIsModal({ open: !open, data: {} });
+ }}
+ bodyClass={"w-[80vw] max-w-none"}
+ body={}
+ >
+ }
+ />
+
+
+ );
+}
diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx
index c6da1b2f8..0dedb1570 100644
--- a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx
+++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx
@@ -2,8 +2,9 @@ import type { CommonTableProps } from "@/app/store/common/type/headder";
import { htdflSttHeadListExport, htdflSttNodeListExport } from "./headList";
import type { sttnHeadListType } from "../rainSttn/headList";
import type { z } from "zod";
+import { controlHeadView } from "../rainSttn";
import type { customHtdflBdst } from "../../fcltReg/htdflReg";
-import { getFetch } from "@/components/lib/api";
+import { fetchType, getFetch } from "@/components/lib/api";
const htdflSttHeadList = htdflSttHeadListExport;
const htdflSttNodeList = htdflSttNodeListExport;
@@ -16,7 +17,13 @@ export type htdflSttnState = {
htdflSttnRes:customHtdflBdst[]
};
};
-type htdflSttnActions = {};
+type htdflSttnActions = {
+ initHtdfl:(con:string) => void;
+ htdflSttnSearch: (page: number, total: string, con: string) => void;
+ htdflChSttnHead: (
+ headList: z.infer,
+ ) => void;
+};
export type htdflSttnType = htdflSttnState & htdflSttnActions;
@@ -29,11 +36,11 @@ export const htdflSttnStateExport: htdflSttnState = {
},
};
const initFetch = async (code:string|number) => {
- const rswtRes = await getFetch(
+ const htdflRes = await getFetch(
"wr",
`/drain/facilityList/1/20/${code}`)
- return rswtRes;
+ return htdflRes;
};
export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
@@ -57,5 +64,52 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
console.log(error);
}
},
+ htdflSttnSearch: async (page: number, total: string, con: string) => {
+ try {
+ const htdflSttnRes = await getFetch(
+ fetchType.WR,
+ `/drain/facilityList/${page}/${total}/${con}`
+ );
+ if (Number(total) > 9000) {
+ // const htdflExcel = excelHtdflSttnParsing(htdflSttnRes);
+ set((state: htdflSttnState) => {
+ return {
+ ...state,
+ htdflSttn: {
+ ...state.htdflSttn,
+ // excelList: htdflExcel,
+ },
+ };
+ });
+ } else
+ set((state: htdflSttnState) => {
+ return {
+ ...state,
+ htdflSttn: {
+ ...state.htdflSttn,
+ htdflSttnRes: htdflSttnRes,
+ isInit: false,
+ },
+ };
+ });
+ } catch (erTxt) {
+ console.log("error", erTxt);
+ }
+ },
+ htdflChSttnHead: async (
+ headList: z.infer
+ ): Promise => {
+
+ console.log('head ', headList)
+ const changeNodeList= controlHeadView(headList,htdflSttNodeList)
+
+ return set((state: htdflSttnState) => ({
+ htdflSttn: {
+ ...state.htdflSttn,
+ htdflSttHeadList: headList,
+ htdflSttNodeList: changeNodeList,
+ },
+ }));
+ },
}
}
\ No newline at end of file
diff --git a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx
index 1f97373ca..bd08489f2 100644
--- a/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx
+++ b/apps/wr/components/ui/modal/sttn/headChModal/headChModal.tsx
@@ -8,7 +8,7 @@ import { useForm } from "react-hook-form";
import { z } from "zod";
export default function HeadChModal({headList, type }:{headList : z.infer ,type:string }) {
- const { rainChSttnHead , rswtChSttnHead} = useWrStore((state) => state);
+ const { rainChSttnHead , rswtChSttnHead, htdflChSttnHead} = useWrStore((state) => state);
let items = headList.map(item => ({id:item.id, title:item.title, val:item.visible }));
@@ -32,6 +32,8 @@ export default function HeadChModal({headList, type }:{headList : z.infer
-
- 0?"h-[80vh]":"h-[70vh]"} >
- {type === "RNB" ? (
-
- ) : (
-
- )}
+
+ 0?"h-[80vh]":"h-[70vh]"} >
+ {type === "RNB" ? (
+
+ ) : type === "RST" ? (
+
+ ) : ()}
- {detailData.data.length>0?
- }
-
- pageSize={0}
- total={0}
- cellClick={undefined}
- onPageChange={function (page: number): void {
- throw new Error("Function not implemented.");
- }}
- >:<>>}
-
+ {detailData.data.length>0?
+ }
+
+ pageSize={0}
+ total={0}
+ cellClick={undefined}
+ onPageChange={function (page: number): void {
+ throw new Error("Function not implemented.");
+ }}
+ >:<>>}
+
+
);
}