diff --git a/apps/wr/app/(popUp-layout)/layout.tsx b/apps/wr/app/(popUp-layout)/layout.tsx
new file mode 100644
index 000000000..d3804ac93
--- /dev/null
+++ b/apps/wr/app/(popUp-layout)/layout.tsx
@@ -0,0 +1,13 @@
+"use client";
+
+export default function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ return (
+ <>
+
{children}
+ >
+ );
+}
diff --git a/apps/wr/app/(popUp-layout)/mapDetilePopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDetilePopUp/page.tsx
new file mode 100644
index 000000000..68be4a266
--- /dev/null
+++ b/apps/wr/app/(popUp-layout)/mapDetilePopUp/page.tsx
@@ -0,0 +1,84 @@
+"use client";
+
+import { CoSttnMap } from "@/components/ui/map/LayerPopUp/CoSttnMap/CoSttnMap";
+import { HasuFacility } from "@/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility";
+import { HtdflFacility } from "@/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty";
+import { LdrmntCoMap } from "@/components/ui/map/LayerPopUp/LdrmntCoMap/LdrmntCoMap";
+import { RainFacility } from "@/components/ui/map/LayerPopUp/RainFacility/RainFacility";
+import { RswtFacility } from "@/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty";
+import { RuseFacility } from "@/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility";
+import { useSearchParams } from "next/navigation";
+
+export default function MapDetailPopUp() {
+ const searchParams = useSearchParams();
+ const bc = new BroadcastChannel("mapDetailPopUp");
+
+ const renderConditionalContent = () => {
+ const layerId = searchParams.get("layerNm");
+ switch (layerId) {
+ case "하수재이용시설":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "하수처리시설":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "빗물이용시설":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "중수도시설":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "온배수시설":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "수요처":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ case "잠재수요처":
+ return (
+ {
+ bc.postMessage({ type: "SELECT_FEATURE", feature });
+ }}
+ />
+ );
+ default:
+ return null; // 안전하게 아무 것도 렌더링하지 않음
+ }
+ };
+ return (
+ <>
+ {renderConditionalContent()}
+ >
+ );
+}
diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx
new file mode 100644
index 000000000..1246525d9
--- /dev/null
+++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx
@@ -0,0 +1,136 @@
+"use client";
+import { useWrStore } from "@/app/store";
+import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
+import CoDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/coDatailModal";
+import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
+import { Title, UiTable } from "@common/business_components/ui";
+import { useSearchParams } from "next/navigation";
+import { useEffect, useState } from "react";
+
+export default function MapFeaturePopup() {
+ const [isFeatureCd, setIsFeatureCd] = useState(null);
+ const {
+ pbnMap,
+ ruseMapDetail,
+ rainMapDetile,
+ rswtMapDetile,
+ htdfMapDetile,
+ pbnMapDetaile,
+ ldrmntMapDetile,
+ } = useWrStore((state) => state);
+ const { pbnMapHeadList } = pbnMap;
+ const [isDetail, setIsDetail] = useState(null);
+ const [layerNm, setLayerNm] = useState();
+ const searchParams = useSearchParams();
+
+ useEffect(() => {
+ const layerName = searchParams.get("layerNm");
+ const featureCd = searchParams.get("featureCd");
+ setLayerNm(String(layerName));
+ setIsFeatureCd(featureCd);
+
+ const handleUnload = () => {
+ // 부모에게 닫힘 알림
+ window.opener?.postMessage(
+ { type: "POPUP_CLOSED", target: "detail" },
+ "*"
+ );
+ };
+
+ window.addEventListener("beforeunload", handleUnload);
+
+ return () => {
+ window.removeEventListener("beforeunload", handleUnload);
+ };
+ }, []);
+
+ useEffect(() => {
+ if (isFeatureCd && layerNm) {
+ let detail = {};
+ if (layerNm === "하수재이용시설") {
+ detail = ruseMapDetail(isFeatureCd);
+ setIsDetail(detail);
+ } else if (layerNm === "하수처리시설") {
+ pbnMapDetaile(isFeatureCd, isFeatureCd).then((res) => {
+ setIsDetail(res);
+ });
+ } else if (layerNm === "빗물이용시설") {
+ rainMapDetile(isFeatureCd).then((res) => {
+ setIsDetail(res);
+ });
+ } else if (layerNm === "중수도시설") {
+ rswtMapDetile(isFeatureCd).then((res) => {
+ setIsDetail(res);
+ });
+ } else if (layerNm === "온배수시설") {
+ htdfMapDetile(isFeatureCd).then((res) => {
+ setIsDetail(res);
+ });
+ } else if (layerNm === "잠재수요처") {
+ ldrmntMapDetile(isFeatureCd).then((res) => {
+ setIsDetail(res);
+ });
+ }
+ }
+ }, [isFeatureCd, layerNm]);
+
+ if (!isDetail) return null; // 데이터 없으면 아무것도 안 그림
+ return (
+ <>
+ {isDetail ? (
+
+ {layerNm === "하수재이용시설" ? (
+
+ ) : layerNm === "하수처리시설" ? (
+
+
+
+
+ {/* 높이 조정 */}
+
{}}
+ onPageChange={() => {}}
+ />
+ {}}
+ onPageChange={() => {}}
+ />
+
+ ) : layerNm === "잠재수요처" ? (
+
{
+ console.log(value)
+ }}
+ isMap={true}
+ />
+ ) : (
+
+ )}
+
+ ) : (
+ <>>
+ )}
+ >
+ );
+}
diff --git a/apps/wr/app/map/util.ts b/apps/wr/app/(popUp-layout)/util.ts
similarity index 100%
rename from apps/wr/app/map/util.ts
rename to apps/wr/app/(popUp-layout)/util.ts
diff --git a/apps/wr/app/(with-layout)/layout.tsx b/apps/wr/app/(with-layout)/layout.tsx
new file mode 100644
index 000000000..9c813f8ec
--- /dev/null
+++ b/apps/wr/app/(with-layout)/layout.tsx
@@ -0,0 +1,18 @@
+"use client";
+import Base from "../base";
+
+export default function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+
+
+ return (
+
+
+ {children}
+
+
+ );
+}
diff --git a/apps/wr/app/(with-layout)/map/mainMap/page.tsx b/apps/wr/app/(with-layout)/map/mainMap/page.tsx
new file mode 100644
index 000000000..ece39452f
--- /dev/null
+++ b/apps/wr/app/(with-layout)/map/mainMap/page.tsx
@@ -0,0 +1,294 @@
+"use client";
+
+import Gis from "@common/business_components/ui/map/Gis";
+import { useEffect, useRef, useState, useCallback } from "react";
+import { mapService } from "../service";
+import GisApp from "@common/business_components/ui/map/lib/gis.core";
+<<<<<<< HEAD:apps/wr/app/map/mainMap/page.tsx
+import { SearchBar } from "@common/business_components/ui/map/searchBar/searchBar";
+=======
+import { useWrStore } from "@/app/store";
+import { getFeatureCd } from "@/components/lib/func/\bmapUtil";
+>>>>>>> 2bfd50cff260ec1eb1eea772d1c22d06b771dfe2:apps/wr/app/(with-layout)/map/mainMap/page.tsx
+
+const Map = () => {
+ const { comMap } = useWrStore((state) => state);
+ const { isFeatured } = comMap;
+ const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정
+ const gisMaps = useRef(null);
+ const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태
+ const [isSearchModalOpen, setIsSearchModalOpen] = useState(true); // SearchModal 열림 상태
+ const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터
+ const [checkedLayers, setCheckedLayers] = useState([]);
+ const [checkedLayersData, setCheckedLayersData] = useState([]);
+ const popupRef = useRef(null);
+ const popupDetailRef = useRef(null);
+
+ const fetchData = async () => {
+ try {
+ const response = await mapService.getLyrStngs();
+ setTreeData(response); // API 응답 저장
+ } catch (error) {
+ console.error("데이터 불러오기 실패:", error);
+ }
+ };
+
+ // 팝업 닫기 핸들러를 useCallback으로 메모이제이션
+ // const handlePopupClose = useCallback(() => {
+ // setIsOpen(false);
+ // setFeatureData(null);
+ // }, []);
+
+ // 컴포넌트 마운트 시 1회 실행
+ useEffect(() => {
+ fetchData();
+ }, []);
+
+ useEffect(() => {
+ const bc = new BroadcastChannel("mapDetailPopUp");
+ bc.onmessage = (event) => {
+ if (event.data.type === "SELECT_FEATURE") {
+ onFeatureSelect(event.data.feature);
+ closePopup();
+ }
+ };
+ }, []);
+
+ useEffect(() => {
+ const messageHandler = (event: MessageEvent) => {
+ if (event.data.type === "POPUP_CLOSED") {
+ if (event.data.target === "detail") {
+ console.log("디테일 팝업 닫힘 감지됨");
+ setFeatureData(null);
+ setIsOpen(false);
+ setIsSearchModalOpen(true);
+ popupDetailRef.current = null;
+ } else {
+ console.log("기타 팝업 닫힘 감지됨");
+ popupRef.current = null;
+ }
+ }
+ };
+ window.addEventListener("message", messageHandler);
+ return () => {
+ window.removeEventListener("message", messageHandler);
+ };
+ }, []);
+
+ useEffect(() => {
+ console.log("isFeatured ", isFeatured);
+
+ if (isFeatured) {
+ console.log("isFeatured ", isFeatured);
+ onFeatureSelect(isFeatured);
+ }
+ }, [isFeatured]);
+
+ // 체크된 레이어 정보를 받는 핸들러
+ const handleCheckedLayersChange = (
+ checkedIds: string[],
+ checkedNodesData: any[]
+ ) => {
+ setCheckedLayers(checkedIds);
+ setCheckedLayersData(checkedNodesData);
+ };
+
+ // SearchModal, GisContent 등에서 호출
+<<<<<<< HEAD:apps/wr/app/map/mainMap/page.tsx
+ const onFeatureFocus = (data: any) => {
+ console.log(data);
+ };
+
+=======
+ const onFeatureSelect = (data: any) => {
+ const map = gisMaps.current;
+ if (!map) {
+ console.warn("지도가 초기화되지 않았습니다.");
+ return;
+ }
+
+ // 항상 같은 select 객체 사용
+ const select = GisApp.Module.select as any;
+ if (!select) return;
+
+ // 1. 기존 선택 초기화
+ select.resetSelectedFeature();
+
+ // 2. data가 OpenLayers Feature 인스턴스인지 확인
+ let foundFeature: any = null;
+ let featureId = data.fid;
+ const layerName = data.layerNm;
+ console.log("선택된 레이어 이름:", data, layerName);
+ if (layerName === "하수재이용시설") {
+ // 재이용시설
+ featureId = `${layerName}.${data.searchPk}`;
+ } else if (
+ //빗물이용시설, 중수도시설
+ layerName === "빗물이용시설" ||
+ layerName == "중수도시설"
+ ) {
+ featureId = `${layerName}.${data.bdstInfoSn}`;
+ } else if (layerName === "하수처리시설") {
+ //하수처리시설
+ featureId = `${layerName}.${data.bscFctCd}`;
+ } else if (layerName === "온배수시설") {
+ //온배수시설
+ featureId = `${layerName}.${data.bdstRuseFcltSn}`;
+ } else if (layerName == "수요처") {
+ //수요처
+ featureId = `${layerName}.${data.dmdInfoId.replaceAll("-", "")}`;
+ } else {
+ console.warn("해당 레이어에 대한 featureId 매핑 없음", layerName);
+ featureId = `${layerName}.${data.fid || data.id || data.ftrIdn}`;
+ }
+ map
+ .getLayers()
+ .getArray()
+ .forEach((layer: any) => {
+ const source = layer.getSource?.();
+ if (source?.getFeatureById) {
+ const feature = source.getFeatureById(String(featureId).trim());
+ if (feature) foundFeature = feature;
+ }
+ });
+
+ // 3. 피처 선택
+ if (foundFeature) {
+ const geometry = foundFeature.getGeometry();
+ if (geometry) {
+ const extent = geometry.getExtent();
+
+ map.getView().fit(extent, {
+ duration: 300,
+ padding: [50, 50, 50, 50],
+ maxZoom: 16,
+ constrainResolution: true,
+ nearest: true,
+ });
+ }
+ select.selectFeature(foundFeature, true);
+ } else {
+ console.warn("OpenLayers Feature를 찾을 수 없습니다:", data);
+ }
+ const currentId = data?.fid || data?.id || data?.ftrIdn;
+ const lastId = featureData?.fid || featureData?.id || featureData?.ftrIdn;
+ if (featureData && currentId === lastId) return; // 이전과 같으면 무시
+ setFeatureData(data);
+ setIsOpen(true);
+ setIsSearchModalOpen(false);
+ };
+
+
+ const getSelectedLayers = (isFeature: any) => {
+ const map = gisMaps.current;
+ if (!map) {
+ console.warn("지도가 초기화되지 않았습니다.");
+ return;
+ }
+ let result = null;
+ const layers = map
+ ? map
+ .getLayers()
+ .getArray()
+ .filter((l: any) => l.getVisible())
+ : []; // gisMap이 null인지 확인 후 레이어 가져오기
+ let featureLayer: { get: (key: string) => any } = { get: () => null };
+ layers.forEach((layer: any) => {
+ const source = layer.getSource();
+ if (
+ source &&
+ source.hasFeature &&
+ isFeature &&
+ typeof isFeature.getId === "function" &&
+ source.hasFeature(isFeature)
+ ) {
+ featureLayer = layer; // 피처가 속한 레이어 찾기)
+ }
+ });
+ result = featureLayer.get("lyrNm");
+ return result;
+ };
+
+>>>>>>> 2bfd50cff260ec1eb1eea772d1c22d06b771dfe2:apps/wr/app/(with-layout)/map/mainMap/page.tsx
+ const renderDetailView = useCallback(
+ (props: any) => {
+ const isFeature = props.featureData.getProperties();
+ if (
+ Object.keys(isFeature).length === 0 &&
+ isFeature.constructor === Object
+ ) {
+ const url = `/mapDetilePopUp?layerNm=${encodeURIComponent(props.seletectedLayerNm)}`;
+ const width = window.screen.availWidth;
+ const height = window.screen.availHeight;
+ const left = 0;
+ const top = 0;
+ const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`;
+ popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
+ } else {
+ const layerNm = getSelectedLayers(featureData);
+ const safeProps = featureData.getProperties();
+ const featureCd = getFeatureCd(safeProps, String(layerNm));
+ const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `;
+ const width = Math.floor(window.innerWidth * 0.4); // 화면 폭의 40%
+ const height = Math.floor(window.innerHeight - 450); // 150px 여백 확보; // calc(100% - 70px)
+ const left = (window.screen.availWidth - width) / 2;
+ const top = (window.screen.availHeight - height) / 2;
+ const popupOptions = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`;
+ popupDetailRef.current = window.open(
+ url,
+ "지도 시설 상세정보 팝업",
+ popupOptions
+ );
+ }
+ },
+ [checkedLayers, checkedLayersData, featureData] // 필요 시 의존성 넣기
+ );
+ const closePopup = () => {
+ if (popupRef.current && !popupRef.current.closed) {
+ popupRef.current.close();
+ popupRef.current = null;
+ setIsOpen(false);
+ setFeatureData(null);
+ }
+ };
+
+ return (
+
+
+ }
+ waterDepth={undefined}
+ />
+
+ );
+};
+
+export default Map;
diff --git a/apps/wr/app/(with-layout)/map/popup/page.tsx b/apps/wr/app/(with-layout)/map/popup/page.tsx
new file mode 100644
index 000000000..ca7a07b43
--- /dev/null
+++ b/apps/wr/app/(with-layout)/map/popup/page.tsx
@@ -0,0 +1,153 @@
+// "use client";
+
+// import Gis from "@common/business_components/ui/map/Gis";
+// import { useEffect, useRef, useState, useCallback } from "react";
+// import { mapService } from "../service";
+// import NewWindowPopup from "../components/newWindowPopup";
+// import GisApp from "@common/business_components/ui/map/lib/gis.core";
+
+// const Map = () => {
+// const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정
+// const gisMaps = useRef(null);
+// const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태
+// const [isSearchModalOpen, setIsSearchModalOpen] = useState(true); // SearchModal 열림 상태
+// const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터
+// const [checkedLayers, setCheckedLayers] = useState([]);
+// const [checkedLayersData, setCheckedLayersData] = useState([]);
+
+// const fetchData = async () => {
+// try {
+// const response = await mapService.getLyrStngs();
+// setTreeData(response); // API 응답 저장
+// } catch (error) {
+// console.error("데이터 불러오기 실패:", error);
+// }
+// };
+
+// // 팝업 닫기 핸들러를 useCallback으로 메모이제이션
+// const handlePopupClose = useCallback(() => {
+// setIsOpen(false);
+// setFeatureData(null);
+// }, []);
+
+// // 컴포넌트 마운트 시 1회 실행
+// useEffect(() => {
+// fetchData();
+// }, []);
+
+// // 체크된 레이어 정보를 받는 핸들러
+// const handleCheckedLayersChange = (checkedIds: string[], checkedNodesData: any[]) => {
+// setCheckedLayers(checkedIds);
+// setCheckedLayersData(checkedNodesData);
+// };
+
+// // SearchModal, GisContent 등에서 호출
+// const onFeatureSelect = (data: any) => {
+// const map = gisMaps.current;
+// if (!map) {
+// console.warn("지도가 초기화되지 않았습니다.");
+// return;
+// }
+
+// // 항상 같은 select 객체 사용
+// const select = GisApp.Module.select as any;
+// if (!select) return;
+
+// // 1. 기존 선택 초기화
+// select.resetSelectedFeature();
+
+// // 2. data가 OpenLayers Feature 인스턴스인지 확인
+// let foundFeature: any = null;
+// if (
+// data &&
+// typeof data.getGeometry === "function" &&
+// typeof data.setStyle === "function"
+// ) {
+// // 이미 Feature 인스턴스라면 그대로 사용
+// foundFeature = data;
+// } else {
+// // 아니면 featureId로 맵에서 Feature 인스턴스를 찾아서 사용
+// const featureId = data.fid || data.ftrIdn || data.id;
+// map
+// .getLayers()
+// .getArray()
+// .forEach((layer: any) => {
+// const source = layer.getSource?.();
+// if (source?.getFeatureById) {
+// const feature = source.getFeatureById(String(featureId).trim());
+// if (feature) foundFeature = feature;
+// }
+// });
+// }
+
+// // 3. 피처 선택
+// if (foundFeature) {
+// const geometry = foundFeature.getGeometry();
+// if (geometry) {
+// const extent = geometry.getExtent();
+
+// map.getView().fit(extent, {
+// duration: 300,
+// padding: [50, 50, 50, 50],
+// maxZoom: 16,
+// constrainResolution: true,
+// nearest: true,
+// });
+// }
+// select.selectFeature(foundFeature, true);
+// } else {
+// console.warn("OpenLayers Feature를 찾을 수 없습니다:", data);
+// }
+
+// setFeatureData(data);
+// setIsOpen(true);
+// setIsSearchModalOpen(false);
+// };
+
+// // MapSearchBar 래퍼 컴포넌트
+// // const CustomMapSearchBar = (props: any) => {
+// // return (
+// //
+// // );
+// // };
+
+// return (
+//
+//
+// //
+// {
+
+// console.log('p' ,props)
+// }
+// }
+// onFeatureSelect={onFeatureSelect}
+// setIsOpen={setIsOpen}
+// setFeatureData={setFeatureData}
+// featureData={featureData}
+// setIsSearchModalOpen={setIsSearchModalOpen}
+// isOpen={isOpen}
+// isSearchModalOpen={isSearchModalOpen}
+// onCheckedLayersChange={handleCheckedLayersChange}
+// imgVisble={true}
+// searchBar={undefined}
+// />
+//
+// );
+// };
+
+// export default Map;
diff --git a/apps/wr/app/map/service/index.ts b/apps/wr/app/(with-layout)/map/service/index.ts
similarity index 100%
rename from apps/wr/app/map/service/index.ts
rename to apps/wr/app/(with-layout)/map/service/index.ts
diff --git a/apps/wr/app/map/service/map.ts b/apps/wr/app/(with-layout)/map/service/map.ts
similarity index 100%
rename from apps/wr/app/map/service/map.ts
rename to apps/wr/app/(with-layout)/map/service/map.ts
diff --git a/apps/wr/app/matMng/coMat/coMatRvw/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMat/coMatRvw/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx
diff --git a/apps/wr/app/matMng/coMat/ruseCaseMng/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/ruseCaseMng/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMat/ruseCaseMng/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMat/ruseCaseMng/page.tsx
diff --git a/apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/ruseRvwHstry/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMat/ruseRvwHstry/page.tsx
diff --git a/apps/wr/app/matMng/coMng/coSttn/page.tsx b/apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMng/coSttn/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx
diff --git a/apps/wr/app/matMng/coMng/drgtSttn/page.tsx b/apps/wr/app/(with-layout)/matMng/coMng/drgtSttn/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMng/drgtSttn/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMng/drgtSttn/page.tsx
diff --git a/apps/wr/app/matMng/coMng/ldrmntCoSttn/page.tsx b/apps/wr/app/(with-layout)/matMng/coMng/ldrmntCoSttn/page.tsx
similarity index 100%
rename from apps/wr/app/matMng/coMng/ldrmntCoSttn/page.tsx
rename to apps/wr/app/(with-layout)/matMng/coMng/ldrmntCoSttn/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/htdflReg/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx
similarity index 99%
rename from apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx
index d08d6f06e..688fb836c 100644
--- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx
+++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx
@@ -10,7 +10,7 @@ import {
UiTable,
} from "@common/business_components";
import { Button } from "@common/components";
-import { useWrStore } from "../../../store";
+import { useWrStore } from "../../../../store";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@common/components";
import { useCallback, useEffect, useState } from "react";
import ListDiv from "@common/business_components/ui/list_div";
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/utilsZod.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/utilsZod.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/utilsZod.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/utilsZod.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/TableHead.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/TableHead.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltReg/rainReg/TableHead.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/TableHead.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/htdflSttn/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rainSttn/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/fcltSttn/rswtSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/rswtSttn/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/TableHead.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/TableHead.tsx
diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx
similarity index 96%
rename from apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx
index bf18d4d98..97d80a7a8 100644
--- a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx
+++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx
@@ -118,13 +118,33 @@ export default function Page() {
const rainPageChange = (pageNo: number) => {
if (pageNo > 0) {
setRainPageNation(pageNo);
- rainChkInit(pageNo, rainPageSize, searchYear, commonCd);
+ if (fcltNm) {
+ rainChkNmSearch(
+ pageNo,
+ rainPageSize,
+ searchYear,
+ commonCd,
+ fcltNm
+ );
+ } else {
+ rainChkInit(pageNo, rainPageSize, searchYear, commonCd);
+ }
}
};
const rswtPageChange = (pageNo: number) => {
if (pageNo > 0) {
setRswtPageNation(pageNo);
- rswtChkgdnInit(pageNo, rswtPageSize, searchYear, commonCd);
+ if (fcltNm) {
+ rswtChkNmSearch(
+ pageNo,
+ rainPageSize,
+ searchYear,
+ commonCd,
+ fcltNm
+ );
+ } else {
+ rswtChkgdnInit(pageNo, rswtPageSize, searchYear, commonCd);
+ }
}
};
diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
diff --git a/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
similarity index 94%
rename from apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
index ba1821f20..6b4eead42 100644
--- a/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
+++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx
@@ -83,14 +83,34 @@ export default function Page() {
const rainPageChange = (pageNo: number) => {
if (pageNo > 0) {
setRainPageNation(pageNo);
- rainChkSttnInit(pageNo, rainPageSize, searchYear, commonCd);
+ if (fcltNm) {
+ rainChkSttnNmSearch(
+ pageNo,
+ rainPageSize,
+ searchYear,
+ commonCd,
+ fcltNm
+ );
+ } else {
+ rainChkSttnInit(pageNo, rainPageSize, searchYear, commonCd);
+ }
}
};
const rswtPageChange = (pageNo: number) => {
if (pageNo > 0) {
setRswtPageNation(pageNo);
- rswtChkSttnInit(pageNo, rswtPageSize, searchYear, commonCd);
+ if (fcltNm) {
+ rswtChkNmSttnSearch(
+ pageNo,
+ rainPageSize,
+ searchYear,
+ commonCd,
+ fcltNm
+ );
+ } else {
+ rswtChkSttnInit(pageNo, rswtPageSize, searchYear, commonCd);
+ }
}
};
diff --git a/apps/wr/app/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx
similarity index 100%
rename from apps/wr/app/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx
rename to apps/wr/app/(with-layout)/ruseFcltMng/prfmncSttn/pbnstPrfmncSttn/page.tsx
diff --git a/apps/wr/app/stats/rainStat/page.tsx b/apps/wr/app/(with-layout)/stats/rainStat/page.tsx
similarity index 100%
rename from apps/wr/app/stats/rainStat/page.tsx
rename to apps/wr/app/(with-layout)/stats/rainStat/page.tsx
diff --git a/apps/wr/app/stats/rswtStat/page.tsx b/apps/wr/app/(with-layout)/stats/rswtStat/page.tsx
similarity index 100%
rename from apps/wr/app/stats/rswtStat/page.tsx
rename to apps/wr/app/(with-layout)/stats/rswtStat/page.tsx
diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx
index add988817..fe4c3aff0 100644
--- a/apps/wr/app/layout.tsx
+++ b/apps/wr/app/layout.tsx
@@ -1,10 +1,9 @@
"use client";
import "./globals.css";
-import { StoreProvider} from "./store";
-import koBase from "../public/locales/ko/message.json";
import i18next from "i18next";
import { I18nextProvider } from "react-i18next";
-import Base from "./base";
+import koBase from "../public/locales/ko/message.json";
+import { StoreProvider } from "./store";
export default function RootLayout({
children,
@@ -25,11 +24,9 @@ export default function RootLayout({
-
-
+
{children}
-
-
+
diff --git a/apps/wr/app/map/components/layerPopup/hasuFacility.tsx b/apps/wr/app/map/components/layerPopup/hasuFacility.tsx
deleted file mode 100644
index 5a10ce3ed..000000000
--- a/apps/wr/app/map/components/layerPopup/hasuFacility.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { useWrStore } from "@/app/store";
-import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
-import { tableData } from "@/components/lib/func/commom";
-import { Title, UiTable } from "@common/business_components/ui";
-import { useEffect, useState } from "react";
-interface Props {
- seletectedLayerNm: string;
- viewMode: 'list' | 'detail' | 'nothing';
- onFeatureSelect: (feature: any) => void;
- onClose: () => void;
- isRuseReg: { data: any | undefined };
-}
-const HasuFacility = ({ seletectedLayerNm, viewMode, onClose, onFeatureSelect, isRuseReg }: Props) => {
- const {
- code,
- pbnst,
- pubHasuInit,
- } = useWrStore((state) => state);
- const { pubFacHeadList, pbnstHasuRes, pbnstHasuResCount } = pbnst;
- const [hasuTable, setHasuTable] = useState();
- const [hasuPage, setHasuPage] = useState(1);
- useEffect(() => {
- if (code.sggCd.length && pbnstHasuRes.length > 0) {
- setHasuTable(tableData(pbnstHasuRes, { code }));
- }
- }, [code, pbnstHasuRes]);
- useEffect(() => {
- if (seletectedLayerNm !== '하수처리시설' || viewMode != 'list') return;
- if (!pbnst.isInit) {
- pubHasuInit("1", "0");
- }
- }, [pbnst.isInit, pubHasuInit]);
- useEffect(() => {
- if (seletectedLayerNm !== '하수처리시설' || viewMode != 'list') return;
- pubHasuInit(String(hasuPage), "0");
- }, [hasuPage, pubHasuInit]);
-
- const hasuCellClick = (index: number | undefined) => {
- if (index !== undefined && pbnstHasuRes !== undefined) {
- onFeatureSelect(pbnstHasuRes[index]);
- onClose();
- }
- };
- return (viewMode == 'list' ? (
-
-
-
-
- {/* 높이 조정 */}
-
-
- ) :
- (
-
-
-
-
- {/* 높이 조정 */}
-
{ }}
- onPageChange={() => { }}
- />
- { }}
- onPageChange={() => { }}
- />
-
- )
- )
-}
-export default HasuFacility;
\ No newline at end of file
diff --git a/apps/wr/app/map/components/layerPopup/htdflFacility.tsx b/apps/wr/app/map/components/layerPopup/htdflFacility.tsx
deleted file mode 100644
index fe4bef25a..000000000
--- a/apps/wr/app/map/components/layerPopup/htdflFacility.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import { useWrStore } from '@/app/store';
-import type { customHtdflBdst } from '@/app/store/ruseFcltMng/fcltReg/htdflReg';
-import { tableData } from '@/components/lib/func/commom';
-import SttnDetailModal from '@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal';
-import { Title, UiTable } from '@common/business_components/ui';
-import { HeadMakeColSpan } from '@common/business_components/ui/table/HeadMakeColSpan';
-import React, { useEffect, useState } from 'react'
-interface Props {
- seletectedLayerNm: string;
- viewMode: 'list' | 'detail' | 'nothing';
- onFeatureSelect: (feature: any) => void;
- onClose: () => void;
- htdflDetailModal: { isOpen: boolean; data: customHtdflBdst | undefined };
-}
-const HtdflFacility = ({ seletectedLayerNm, viewMode, onFeatureSelect, onClose, htdflDetailModal }: Props) => {
- const { code, htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore((state) => state);
- const { htdflSttnRes, htdflSttnResCount } = htdflSttn;
- const [htdflTable, setHtdflTable] = useState();
- const [htdflPage, setHtdflPage] = useState(1)
- // 온배수시설 cellClick 이벤트 (상세정보)
- const htdflCellClick = (index: number | undefined) => {
- if (index !== undefined && htdflTable !== undefined) {
- onFeatureSelect(htdflTable[index]);
- onClose();
- }
- };
- useEffect(() => {
- if (seletectedLayerNm !== '온배수시설' || viewMode != 'list') return;
- if (!htdflSttn.isInit) {
- initHtdfl(false, 1, "20", "0", '', code.cityCd, code.sggCd);
- }
- }, [code.cityCd, code.sggCd, htdflSttn.isInit, initHtdfl]);
-
- useEffect(() => {
- if (seletectedLayerNm !== '온배수시설' || viewMode != 'list') return;
- const data = tableData(htdflSttnRes, { code });
- const chData = data
- .map((item: any) => ({
- ...item,
- ...item.reuseBuilding[0],
- ...item.reuseBuilding[0].htdflObj,
- chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
- }))
- .filter((item: any) => item.htdflObj !== undefined);
- setHtdflTable(chData);
- }, [code, htdflSttnRes, htdflSttn.htdflSttHeadList]);
-
- useEffect(() => {
- if (seletectedLayerNm !== '온배수시설' || viewMode != 'list') return;
- htdflSttnSearch(true, htdflPage, "20", '', '', code.cityCd, code.sggCd);
- }, [code.cityCd, code.sggCd, htdflPage, htdflSttnSearch]);
- return (
- viewMode == 'detail' ? (
-
- ) : (
-
-
-
- {/*
-
-
*/}
-
-
{
- htdflCellClick(index ?? undefined);
- }}
- onPageChange={setHtdflPage}
- >
-
-
-
- )
- )
-}
-
-export default HtdflFacility
\ No newline at end of file
diff --git a/apps/wr/app/map/components/layerPopup/rainFacility.tsx b/apps/wr/app/map/components/layerPopup/rainFacility.tsx
deleted file mode 100644
index 54b51e8a6..000000000
--- a/apps/wr/app/map/components/layerPopup/rainFacility.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-import { useWrStore } from "@/app/store";
-import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
-import { tableData } from "@/components/lib/func/commom";
-import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
-import { Title, UiTable } from "@common/business_components/ui";
-import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
-import { useEffect, useState } from "react";
-interface Props {
- seletectedLayerNm: string;
- viewMode: 'list' | 'detail' | 'nothing';
- onFeatureSelect: (feature: any) => void;
- onClose: () => void;
- rainDetailModal: { isOpen: boolean; data: customRainBdst | undefined };
-}
-const RainFacility = ({seletectedLayerNm,viewMode,onFeatureSelect,onClose,rainDetailModal}:Props) => {
- // 빗물재이용시설 변수
- const { code, rainSttn, rainSttnSearch, rainSttnInit } = useWrStore(
- (state) => state
- );
- const { rainSttnRes, rainSttnResCount } = rainSttn;
- const [rainTable, setRainTable] = useState();
- const [rainPage, setRainPage] = useState(1)
-
- // 빗물재이용시설 cellClick 이벤트 (상세정보)
- const rainCellClick = (index: number | undefined, headId: string) => {
- if (
- index !== undefined &&
- rainTable !== undefined &&
- headId !== 'chBuildingYn') {
- onFeatureSelect(rainTable[index]);
- onClose();
- }
- }
- useEffect(() => {
- if (seletectedLayerNm !== '빗물이용시설' || viewMode != 'list') return;
- console.log('빗물이용시설 초기값 호출', viewMode)
- if (!rainSttn.isInit) {
- rainSttnInit(false, 1, "20", "0", '', code.cityCd, code.sggCd);
- }
- }, [code.cityCd, code.sggCd, rainSttn.isInit, rainSttnInit]);
-
- useEffect(() => {
- const data = tableData(rainSttnRes, { code });
- const chData = data
- .map((item: any) => {
- return {
- ...item,
- ...item.reuseBuilding[0],
- ...item.reuseBuilding[0].rainyObj,
- dtfcltCpct: item.reuseBuilding[0].rainyObj.dtfcltCpct === -1
- ? "확인불가"
- : item.reuseBuilding[0].rainyObj.dtfcltCpct,
- instlCst: item.reuseBuilding[0].instlCst === -1
- ? "확인불가"
- : item.reuseBuilding[0].instlCst,
- instlCstSprtAmt: item.reuseBuilding[0].instlCstSprtAmt === -1
- ? "확인불가"
- : item.reuseBuilding[0].instlCstSprtAmt,
- chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
- pntfColArea: item.reuseBuilding[0].rainyObj.pntfColArea === -1
- ? "확인불가"
- : item.reuseBuilding[0].rainyObj.pntfColArea,
- filtrTrtmfctCpct: item.reuseBuilding[0].rainyObj.filtrTrtmfctCpct === -1
- ? "확인불가"
- : item.reuseBuilding[0].rainyObj.filtrTrtmfctCpct,
- archArea: Math.floor(item.archArea) === -1 ? "확인불가" : item.archArea,
- };
- })
- .filter((item: any) => item.rainyObj !== undefined);
- setRainTable(chData);
- }, [code, rainSttnRes, rainSttn.rainSttHeadList]);
-
- useEffect(() => {
- if (seletectedLayerNm !== '빗물이용시설' || viewMode != 'list') return;
- rainSttnSearch(false, rainPage, "20", '', '', code.cityCd, code.sggCd);
- }, [code.cityCd, code.sggCd, rainPage, rainSttnSearch]);
- return (viewMode == 'detail' ?
- ()
- : (
- <>
-
-
- {/*
-
-
*/}
-
- {
- rainCellClick(index ?? undefined, headId);
- }}
- onPageChange={setRainPage}
- >
-
-
- >
- ))
-}
-export default RainFacility;
\ No newline at end of file
diff --git a/apps/wr/app/map/components/layerPopup/reuseFacility.tsx b/apps/wr/app/map/components/layerPopup/reuseFacility.tsx
deleted file mode 100644
index 152d37999..000000000
--- a/apps/wr/app/map/components/layerPopup/reuseFacility.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-import { useWrStore } from "@/app/store";
-import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
-import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
-import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
-import { Title, UITab, UiTable } from "@common/business_components/ui";
-import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
-import { useState, useEffect, useCallback } from "react";
-interface Props {
- seletectedLayerNm: string;
- viewMode: 'list' | 'detail' | 'nothing';
- setFcltPk: (pk: string) => void;
- onFeatureSelect: (feature: any) => void;
- onClose: () => void;
- actTabData: { id: string; name: string; data: any } | undefined;
- tabData: { id: string; name: string; data: any }[];
-}
-const ResueFacility = ({ viewMode, seletectedLayerNm, tabData, actTabData, setFcltPk, onFeatureSelect, onClose}: Props) => {
- const [activeTab, setActiveTab] = useState(''); // 현재 활성화된 탭
- // 하수재이용시설 변수
- const {
- pbnstSttn,
- pbnstSttnSearch,
- pbnSttnInit,
- getFlcts
- } = useWrStore((state) => state);
- const { fclts, pbnstSttnResCount } = pbnstSttn
- const [bdstTable, setBdstTable] = useState()
- // 재이용시설 cellClick 이벤트 (상세정보)
- const pbnstCellClick = (index: number | undefined) => {
- if (
- index !== undefined &&
- pbnstSttn.pbnstSttnRes &&
- pbnstSttn.pbnstSttnRes[index]
- ) {
- setFcltPk(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltId);
- onFeatureSelect(pbnstSttn.pbnstSttnRes[index]);
- onClose()
- }
- };
-
- // 재이용 현황 초기값
- useEffect(() => {
- if (seletectedLayerNm !== '하수재이용시설' || viewMode !='list') return;
- if (!pbnstSttn.isInit) {
- getFlcts()
- }
- }, [seletectedLayerNm, pbnstSttn.isInit]);
- useEffect(() => {
- if (seletectedLayerNm !== '하수재이용시설' || viewMode !='list') return;
- pbnSttnInit("1", "20", {
- partValue: "A",
- sidoValue: '0',
- sigunValue: "0",
- regionValue: "",
- unitWaterShedValue: "",
- middleRegionValue: "",
- envPartValue: "",
- sidoText: "",
- sigunText: ""
- }, String(new Date().getFullYear()), pbnstSttn.fclts);
- }, [fclts, pbnSttnInit, pbnstSttn.fclts, seletectedLayerNm])
- useEffect(() => {
- setBdstTable(pbnstSttn.pbnstSttnRes);
- }, [seletectedLayerNm, pbnstSttn.pbnstSttnRes]);
-
- // 재이용시설 조회
- // 재이용시설 페이징처리 관련 함수
- const onPageChangeHandler = useCallback((page: number) => {
- if (seletectedLayerNm !== '하수재이용시설' || viewMode !='list') return;
- pbnstSttnSearch(
- false,
- String(page),
- String(20),
- {
- partValue: "A",
- sidoValue: "0",
- sigunValue: "0",
- regionValue: "",
- unitWaterShedValue: "",
- middleRegionValue: "",
- envPartValue: "",
- sidoText: "",
- sigunText: "",
- },
- "",
- String(new Date().getFullYear()), fclts
- );
- }, [fclts, pbnstSttnSearch]);
- // FIXME: 윤선화차장님 요구사항으로 엑셀 다운로드 삭제.
- // const excelClick = useCallback(() => {
- // // if (codeData) pbnstSttnSearch(1, "10000", codeData);
- // excelDownload(
- // [[]],
- // "하수재이용시설 현황",
- // "sample_pbnstSttn.xlsx",
- // "A1:U2"
- // );
- // }, [pbnstSttnSearch]);
- return (
- viewMode == 'detail' ?
- // 재이용시설 상세
- <>
-
-
-
-
- ({
- value: tab.id,
- label: tab.name,
- onClick: () => setActiveTab(tab.id),
- }))}
- />
-
-
- > :
-
-
-
- {/*
-
-
*/}
-
-
{
- pbnstCellClick(index);
- }}
- onPageChange={onPageChangeHandler}
- >
-
-
-
- )
-}
-export default ResueFacility;
\ No newline at end of file
diff --git a/apps/wr/app/map/components/layerPopup/rswtFacility.tsx b/apps/wr/app/map/components/layerPopup/rswtFacility.tsx
deleted file mode 100644
index dc2537c95..000000000
--- a/apps/wr/app/map/components/layerPopup/rswtFacility.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { useWrStore } from "@/app/store";
-import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
-import { tableData } from "@/components/lib/func/commom";
-import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
-import { Title, UiTable } from "@common/business_components/ui";
-import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
-import { useEffect, useState } from "react";
-interface Props {
- seletectedLayerNm: string;
- viewMode: 'list' | 'detail' | 'nothing';
- onFeatureSelect: (feature: any) => void;
- onClose: () => void;
- rswtrDetailModal: { isOpen: boolean; data: customRswtBdst | undefined };
-}
-const RswtFacility = ({ seletectedLayerNm, viewMode, onFeatureSelect, onClose, rswtrDetailModal }: Props) => {
- const { code, rswtSttn, rswtSttnSearch, rswtSttnInit } = useWrStore(
- (state) => state
- );
- const { rswtSttnRes, rswtSttnResCount } = rswtSttn;
- const [rswtrTable, setRswtrTable] = useState()
- const [rswtrPage, setRswtrPage] = useState(1);
- // 중수도시설 cellClick 이벤트 (상세정보)
- const rswtCellClick = (index: number | undefined, headId: string) => {
- if (headId !== 'chBuildingYn' && index !== undefined && rswtrTable !== undefined) {
- // setRswtrDetailModal({ isOpen: true, data: rswtrTable[index] });
- // setViewMode('detail')
- onFeatureSelect(rswtrTable[index]);
- onClose();
- }
- }
- useEffect(() => {
- if (seletectedLayerNm !== '중수도시설' || viewMode != 'list') return;
- if (!rswtSttn.isInit) {
- rswtSttnInit(false, 1, "20", "0", '', code.cityCd, code.sggCd);
- }
- }, [code.cityCd, code.sggCd, rswtSttn.isInit, rswtSttnInit]);
-
- useEffect(() => {
- if (seletectedLayerNm !== '중수도시설' || viewMode != 'list') return;
- const data = tableData(rswtSttnRes, { code });
- const chData = data
- .map((item: customRswtBdst) => {
- return {
- ...item,
- ...item.reuseBuilding[0],
- ...item.reuseBuilding[0]?.rswtrObj,
- chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N',
- instlCst: item.reuseBuilding[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCst,
- instlCstSprtAmt: item.reuseBuilding[0]?.instlCstSprtAmt === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCstSprtAmt,
- archArea: item?.archArea.split('.')[0] !== '-1' ? item?.archArea.split('.')[0] : '확인불가'
- }
- })
- .filter(
- (item: customRswtBdst) =>
- item.reuseBuilding[0]?.rswtrObj !== undefined
- );
- setRswtrTable(chData);
- }, [code, rswtSttnRes]);
- // FIXME: 윤선화 차장님 요구사항으로 엑셀 다운로드 삭제.
- // const rswtSttnExcelDownload = useCallback(() => {
- // if (rswtSttn.excelList.length > 0) {
- // if (rswtSttn.excelList.length === 0) return;
- // excelDownload(
- // rswtSttn.excelList,
- // "중수도시설 현황",
- // "sample_rswtSttn.xlsx",
- // "A1:W3",
- // );
- // }
- // }, [rswtSttn.excelList])
-
- useEffect(() => {
- if (seletectedLayerNm !== '중수도시설' || viewMode != 'list') return;
- rswtSttnSearch(false, rswtrPage, "20", '', '', code.cityCd, code.sggCd);
- }, [code.cityCd, code.sggCd, rswtSttnSearch, rswtrPage]);
- return (
- viewMode == 'detail' ?
- // 중수도시설 상세
- (
-
- ) : (
-
-
-
- {/*
-
-
*/}
-
-
{
- rswtCellClick(index, headId);
- }}
- onPageChange={setRswtrPage}
- >
-
-
-
- ))
-}
-export default RswtFacility;
\ No newline at end of file
diff --git a/apps/wr/app/map/components/newWindowPopup.tsx b/apps/wr/app/map/components/newWindowPopup.tsx
deleted file mode 100644
index 21d31b984..000000000
--- a/apps/wr/app/map/components/newWindowPopup.tsx
+++ /dev/null
@@ -1,183 +0,0 @@
-"use client"
-import NewWindowPortal from '@/app/map/components/newWindowPortal';
-import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
-import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
-import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
-import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
-import { useGisContext } from "@common/business_components/ui/map/Gis";
-import type { DemandCompType } from '@common/business_components/ui/sdmInsertForm/form';
-import React, { useCallback, useEffect, useRef, useState } from 'react';
-import ResueFacility from './layerPopup/reuseFacility';
-import { detainSttn, fetchHasuDetail, fetchpbnstDetail } from '../util';
-import HasuFacility from './layerPopup/hasuFacility';
-import RainFacility from './layerPopup/rainFacility';
-import RswtFacility from './layerPopup/rswtFacility';
-import HtdflFacility from './layerPopup/htdflFacility';
-import ReuseMngFacility from './layerPopup/reuseMngFacility';
-
-interface NewWindowPopupProps {
- featureData: any;
- seletectedLayerNm?: string
- onFeatureSelect: (data: any) => void;
- onClose: () => void;
-}
-
-const NewWindowPopup: React.FC = ({
- featureData,
- seletectedLayerNm,
- onFeatureSelect,
- onClose
-}) => {
- const { gisMap } = useGisContext() as unknown as { checkedLayerIds: React.MutableRefObject; treeData: { lyrSn: number }[] | null; gisCore: any; gisMap: any; };
- const [tabData, setTabData] = useState<{ id: string; name: string; data: any }[]>([]);
- const [activeTab, setActiveTab] = useState('0');
- const [viewMode, setViewMode] = useState<'list' | 'detail' | 'nothing'>('list');
- const [fcltPk, setFcltPk] = useState('');
-
-
- // onClose 함수를 useCallback으로 메모이제이션
- const memoizedOnClose = useCallback(() => {
- onClose();
- }, [onClose]);
-
- // 빗물재이용시설 변수
- const [rainDetailModal, setRainDetailModal] = useState<{ isOpen: boolean, data: customRainBdst | undefined }>({ data: undefined, isOpen: false });
- const [rainList, setRainList] = useState([]);
-
- // 중수도시설 변수
- const [rswtrDetailModal, setRswtrDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false });
- const [rswtrList, setRswtrList] = useState([]);
-
- // 온배수시설 변수
- const [htdflDetailModal, setHtdflDetailModal] = useState<{ isOpen: boolean, data: customHtdflBdst | undefined }>({ data: undefined, isOpen: false });
- const [htdflList, setHtdflList] = useState([]);
-
- // 하수처리시설 변수
- const [hasuList, setHasuList] = useState([]);
- const [isRuseReg, setIsRuseReg] = useState<{
- data: any | undefined;
- }>({ data: undefined });
-
- // 수요처관리 변수
- const [isDmdModal, setIsDmdModal] = useState<{
- isMoal: boolean;
- data: any | undefined;
- }>({ isMoal: false, data: undefined });
- const [mngList, setMngList] = useState([]);
-
- ///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
- const getSelectedLayers = () => {
- console.trace('호출확인', 1)
- let result = null;
- const layers = gisMap ? gisMap.getLayers().getArray().filter((l: any) => l.getVisible()) : []; // gisMap이 null인지 확인 후 레이어 가져오기
- let featureLayer: { get: (key: string) => any } = { get: () => null };
- layers.forEach((layer: any) => {
- const source = layer.getSource();
- if (source && source.hasFeature && featureData
- && typeof featureData.getId === 'function' && source.hasFeature(featureData)) {
- featureLayer = layer; // 피처가 속한 레이어 찾기)
- }
- });
- result = featureLayer.get('lyrNm');
- return result;
- };
- // 상세 목록 데이터 상태 처리
- useEffect(() => {
- if (hasuList.length > 0) setIsRuseReg({ data: [hasuList[0]] });
- }, [hasuList])
- useEffect(() => {
- if (rainList.length > 0) setRainDetailModal({ isOpen: true, data: rainList[0] });
- }, [rainList])
- useEffect(() => {
- if (rswtrList.length > 0) setRswtrDetailModal({ isOpen: true, data: rswtrList[0] });
- }, [rswtrList])
- useEffect(() => {
- if (htdflList.length > 0) setHtdflDetailModal({ isOpen: true, data: htdflList[0] });
- }, [htdflList])
- useEffect(() => {
- if (mngList.length > 0) setIsDmdModal({ isMoal: true, data: [mngList[0]] });
- }, [mngList])
-
- const lastCalledIdRef = useRef(null);
- const [layerId, setLayerId] = useState();
-
- useEffect(() => {
- const layers = getSelectedLayers();
- setLayerId(layers);
- }, []); // 최초 렌더링 시 호출
-
- // 피쳐 데이터가 변경될 때마다 호출
- useEffect(() => {
- if (!featureData || typeof featureData.getProperties !== "function" || featureData.getProperties() == '') return;
- const selectedProps = featureData.getProperties();
- const currentId = featureData.getId?.() || selectedProps?.id || selectedProps?.fid;
- // 유효하지 않은 ID는 아예 무시
- if (!currentId || typeof currentId !== 'string') return;
- // 이전과 동일하면 무시
- if (!currentId || currentId === lastCalledIdRef.current) return;
- lastCalledIdRef.current = currentId // 새로운 피처일 때만 API 호출
- const layerId = getSelectedLayers?.();
- if (!layerId || typeof layerId !== 'string') return;
- const featureCd =
- layerId === '하수재이용시설' ? selectedProps?.swtrmt_fclt_cd :
- ['빗물이용시설', '중수도시설', '온배수시설', '수요처'].includes(layerId) ? selectedProps?.bdst_nm :
- layerId === '하수처리시설' ? selectedProps?.swtrmt_fclt_nm :
- null;
- if (!featureCd || featureCd === fcltPk) return;
- if (layerId === '하수재이용시설') {
- fetchpbnstDetail(featureCd, setTabData);
- } else if (layerId === '하수처리시설') {
- fetchHasuDetail(featureCd, selectedProps?.swtrmt_fclt_cd).then((data) => { setHasuList(data) })
- } else {
- detainSttn(featureCd, layerId).then((res) => {
- if (layerId === '빗물이용시설') setRainList(res);
- else if (layerId === '중수도시설') setRswtrList(res);
- else if (layerId === '온배수시설') { setHtdflList(res); setHtdflDetailModal({ isOpen: true, data: res[0] }); }
- else if (layerId === '수요처') setMngList(res);
- });
- }
- setFcltPk(featureCd);
- setActiveTab(featureCd);
- setViewMode("detail");
- }, [featureData]);
- ///////////////////////////////////////////// 피쳐데이터 선택 시 각 시설별 데이터 처리 ///////////////////////////////////////////////
-
- // 체크된 레이어에 따른 조건부 컴포넌트 렌더링 함수
- const renderConditionalContent = () => {
- const actTabData = tabData.find((tab) => tab.id === activeTab);
- if (layerId === null || layerId === undefined) {
- setLayerId(seletectedLayerNm || '');
- }
- switch (layerId) {
- case '하수재이용시설':
- return ()
- case '하수처리시설':
- return ()
- case '빗물이용시설':
- return ()
- case '중수도시설':
- return ()
- case '온배수시설':
- return ()
- case '수요처':
- return()
- default:
- break;
- }
- return null; // 조건에 맞는 콘텐츠가 없을 경우
- };
- return (
- viewMode == 'nothing' ? <>> :
-
- {/* 체크된 레이어에 따른 조건부 렌더링 */}
- {renderConditionalContent()}
-
- );
-};
-
-export default NewWindowPopup;
\ No newline at end of file
diff --git a/apps/wr/app/map/components/newWindowPortal.tsx b/apps/wr/app/map/components/newWindowPortal.tsx
deleted file mode 100644
index 119e3a52b..000000000
--- a/apps/wr/app/map/components/newWindowPortal.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import React, { useState, useEffect, useRef, useCallback } from 'react';
-import { createPortal } from 'react-dom';
-
-// 현재 문서의 스타일(CSS)을 새 창으로 복사하는 함수
-const copyStyles = (sourceDoc: Document, targetDoc: Document) => {
- Array.from(sourceDoc.styleSheets).forEach(styleSheet => {
- try {
- if (styleSheet.cssRules) { //