@@ -125,6 +122,7 @@ export default function MapFeaturePopup() {
: "HTB"
}
formObj={isDetail}
+ isMap={true}
/>
)}
diff --git a/apps/wr/app/(with-layout)/map/mainMap/page.tsx b/apps/wr/app/(with-layout)/map/mainMap/page.tsx
index d9a25c724..d561ad933 100644
--- a/apps/wr/app/(with-layout)/map/mainMap/page.tsx
+++ b/apps/wr/app/(with-layout)/map/mainMap/page.tsx
@@ -173,7 +173,6 @@ const Map = () => {
setIsSearchModalOpen(false);
};
-
const getSelectedLayers = (isFeature: any) => {
const map = gisMaps.current;
if (!map) {
@@ -206,33 +205,53 @@ const Map = () => {
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
- );
+ const map = gisMaps.current;
+ if (!map) {
+ console.warn("지도가 초기화되지 않았습니다.");
+ return;
+ }
+
+ const isFeature = props?.featureData;
+
+ console.log('isFeature 1', isFeature)
+ if( typeof isFeature.getProperties === "function" ){
+
+ if (
+ Object.keys(isFeature?.getProperties()).length === 0 &&
+ isFeature.constructor === Object
+ ) {
+ const url = `/mapDetailPopUp?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=no`;
+ popupRef.current = window.open(url, "지도 레이어 팝업", popupOptions);
+ } else {
+ console.log('isFeature 2', isFeature)
+ const layerNm = getSelectedLayers(isFeature);
+ const safeProps = isFeature.getProperties();
+ const featureCd = getFeatureCd(safeProps, String(layerNm));
+ const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `;
+ const width =
+ String(layerNm) === "하수재이용시설"
+ ? Math.floor(window.innerWidth * 0.8)
+ : Math.floor(window.innerWidth * 0.4); // 화면 폭의 40%
+ const height =
+ String(layerNm) === "하수재이용시설"
+ ? Math.floor(window.innerHeight - 150)
+ : 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
+ );
+ }
+ }else{
+ console.log(' data확인 필요')
}
},
[checkedLayers, checkedLayersData, featureData] // 필요 시 의존성 넣기
@@ -255,7 +274,7 @@ const Map = () => {
isMiniMap={false}
searchView={undefined}
detailView={renderDetailView}
- onFeatureSelect={onFeatureFocus}
+ onFeatureSelect={onFeatureSelect}
setIsOpen={setIsOpen}
setFeatureData={setFeatureData}
featureData={featureData}
diff --git a/apps/wr/app/store/map/ruseMap/index.tsx b/apps/wr/app/store/map/ruseMap/index.tsx
index d42fc6202..a42355f81 100644
--- a/apps/wr/app/store/map/ruseMap/index.tsx
+++ b/apps/wr/app/store/map/ruseMap/index.tsx
@@ -16,6 +16,7 @@ export type ruseMapState = {
ruseMapCount: number;
isInit: boolean;
fclts: string[];
+ ruseDetailList:customPbnst[]
ruseMapHeadList: CommonTableProps[];
ruseMapNodeList: CommonTableProps[];
};
@@ -31,6 +32,7 @@ type ruseMapActions = {
fclts: string[]
) => void;
ruseMapDetail: (ruseFcltId: string) => Promise
;
+ getRuseMaplList :(ruseFcltId: string) => void;
};
export type ruseMapType = ruseMapState & ruseMapActions;
@@ -39,6 +41,7 @@ export const ruseMapStateExport: ruseMapState = {
ruseMap: {
isInit: false,
ruseMapRes: [],
+ ruseDetailList:[],
fclts: [],
ruseMapCount: 1,
ruseMapHeadList: pbnSttHeadListExport,
@@ -106,6 +109,23 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = (
console.log(errorHasu);
throw errorHasu; // 호출부에서 catch 가능하도록
}
- },
+ },getRuseMaplList:async(bscFctCd: string) =>{
+ try {
+ const ruseDetailList = await getFetch("wr", `/reuseFc/pubFc/${bscFctCd}`);
+ set((state: ruseMapState) => {
+ return {
+ ...state,
+ ruseMap: {
+ ...state.ruseMap,
+ ruseDetailList: ruseDetailList,
+ },
+ };
+ });
+ } catch (errorHasu) {
+ console.log(errorHasu);
+ throw errorHasu; // 호출부에서 catch 가능하도록
+ }
+ }
+
};
};
diff --git a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx
index 23eb3c1b4..1d404f08c 100644
--- a/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx
+++ b/apps/wr/components/ui/form/fcltReg/htdflReg/htdflRegForm.tsx
@@ -34,11 +34,13 @@ export default function HtdflRegForm({
isModal,
readonly = false,
setIsModal,
+ isMap
}: {
htdflForm: customHtdflBdst;
isModal: boolean;
readonly?: boolean;
setIsModal?: (modal: boolean) => void;
+ isMap?: boolean;
}) {
const { code, htdflBdstUpdate, htdflBdstReg } = useWrStore((state) => state);
const [frontPHdata, setFrontPHdata] = useState("");
@@ -140,14 +142,16 @@ export default function HtdflRegForm({
const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
- if (isModal === true) {
- setDivStyle("h-[53vh] max-h-[37vh]");
+ if(isMap){
+ setDivStyle("h-[100vh]")
+ }else if (isModal === true) {
+ setDivStyle("h-[53vh] max-h-[37vh]")
} else if (readonly === true) {
- setDivStyle("h-[62vh]");
+ setDivStyle("h-[62vh]")
} else {
setDivStyle("h-[57vh]")
}
- }, [isModal, readonly]);
+ }, [isModal, readonly ,isMap]);
useEffect(() => {
console.log("form errors:", form.formState.errors);
diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx
index 2da752028..8b215e728 100644
--- a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx
+++ b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx
@@ -30,11 +30,13 @@ export default function RainRegForm({
isModal,
readonly = false,
setIsModal,
+ isMap
}: {
rainForm: customRainBdst;
isModal: boolean;
setIsModal?: (modal: boolean) => void;
readonly?: boolean;
+ isMap?: boolean;
}) {
const { code, rainBdstReg, rainBdstUpdate } = useWrStore(
(state) => state
@@ -54,14 +56,16 @@ export default function RainRegForm({
const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
- if (isModal === true) {
+ if(isMap=== true){
+ setDivStyle("h-[100vh]")
+ }else if (isModal === true) {
setDivStyle("h-[53vh] max-h-[37vh]")
} else if (readonly === true) {
setDivStyle("h-[62vh]")
} else {
setDivStyle("h-[57vh]")
}
- }, [isModal, readonly]);
+ }, [isModal, readonly ,isMap]);
const cleanRainData = (raw: any): z.infer => {
const buildings =
diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx
index 055d0372f..0d1b47f4a 100644
--- a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx
+++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx
@@ -34,25 +34,30 @@ export default function RswtrRegForm({
isModal,
setIsModal,
readonly = false,
+ isMap
}: {
rswtForm: customRswtBdst;
isModal: boolean;
setIsModal?: (isModal: boolean) => void;
readonly?: boolean;
+ isMap?: boolean;
+
}) {
const { code, rswtBdstUpdate, rswtBdstReg } = useWrStore(
(state) => state
);
const [divStyle, setDivStyle] = useState("h-[53vh]");
useEffect(() => {
- if (isModal === true) {
+ if(isMap){
+ setDivStyle("h-[100vh]")
+ }else if (isModal === true) {
setDivStyle("h-[53vh] max-h-[37vh]")
} else if (readonly === true) {
setDivStyle("h-[62vh]")
} else {
setDivStyle("h-[57vh]")
}
- }, [isModal, readonly]);
+ }, [isModal, readonly ,isMap]);
// const defaultValues: z.infer = rswtZod.parse({});
const form = useForm>({
diff --git a/apps/wr/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup.tsx b/apps/wr/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup.tsx
new file mode 100644
index 000000000..9f0a114f8
--- /dev/null
+++ b/apps/wr/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup.tsx
@@ -0,0 +1,63 @@
+import { useWrStore } from "@/app/store";
+import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
+import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
+import {
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger,
+} from "@common/components/ui";
+import { useEffect, useRef, useState } from "react";
+
+export function RuseDetailPopup({ bscFctCd }: { bscFctCd: string }) {
+ const { ruseMap, getRuseMaplList } = useWrStore((state) => state);
+ const { ruseDetailList } = ruseMap;
+ const [fcltTab, setFcltTab] = useState("");
+ const [isDetail, setIsDetail] = useState({} as customPbnst);
+ const initRef = useRef(false);
+
+ useEffect(() => {
+ if (!initRef.current) {
+ getRuseMaplList(bscFctCd);
+ initRef.current = true;
+ }
+ }, [bscFctCd]);
+
+ useEffect(() => {
+ const detail = ruseDetailList.find(
+ (list) => list.pbnstRuseFcltId === fcltTab
+ );
+ if (detail) setIsDetail(detail);
+ }, [fcltTab, ruseDetailList]);
+
+ useEffect(() => {
+ if (ruseDetailList && ruseDetailList[0]) {
+ setFcltTab(ruseDetailList[0].pbnstRuseFcltId);
+ }
+ }, [ruseDetailList]);
+
+ if (!(ruseDetailList && ruseDetailList[0])) return;
+ return (
+
+
+
+ {ruseDetailList.map((item, index) => {
+ return (
+
+ {item.ruseUtztnFcltNm}
+
+ );
+ })}
+
+
+
+
+
+
+
+ );
+}
diff --git a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx
index 4212032f0..b6ac72eb6 100644
--- a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx
+++ b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx
@@ -34,7 +34,7 @@ import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
-export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titleVisible?: boolean }) {
+export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; titleVisible?: boolean ,isMap?:boolean}) {
const { pbnstSttn, prfmnc, pbnstPrfmncSttn } = useWrStore((state) => state);
const [fcltTab, setFcltTab] = useState("fclt");
const [ruseTab, setRuseTab] = useState("totalPrf");
@@ -252,7 +252,7 @@ export function PbnstSttnModal({ data, titleVisible }: { data: customPbnst; titl
>
)}
-
+
state
);
const [detailData, setDetailData] = useState({
head: [] as CommonTableProps[],
- node:[] as CommonTableProps[],
+ node: [] as CommonTableProps[],
data: {} as any,
});
useEffect(() => {
if (type === "RNB" && formObj?.reuseBuilding[0]) {
rainSttnChkSearch(formObj.reuseBuilding[0].bdstRuseFcltSn);
-
} else if (type === "RST") {
- // rswtChkPolAndGuide(formObj.reuseBuilding[0].bdstRuseFcltSn)
+ // rswtChkPolAndGuide(formObj.reuseBuilding[0].bdstRuseFcltSn)
}
}, [type, formObj]);
@@ -60,61 +61,89 @@ export default function SttnDetailModal({
});
setDetailData({
head: rainSttn.rainSttnDetailHeadList,
- node:rainSttn.rainSttnDetailNodeList,
+ node: rainSttn.rainSttnDetailNodeList,
data: data,
});
} else if (type === "RST" && rswtSttn.rswtSttnRes) {
- // const tableTotalData = rswtChkTableData(rswtSttn.rswtSttnRes as unknown as rswtChkZodType[]);
-
- // setDetailData({
- // head: rswtSttn.rswtSttHeadList,
- // node:rswtSttn.rswtSttNodeList,
- // // data: tableTotalData,
- // });
-
-
+ // const tableTotalData = rswtChkTableData(rswtSttn.rswtSttnRes as unknown as rswtChkZodType[]);
+ // setDetailData({
+ // head: rswtSttn.rswtSttHeadList,
+ // node:rswtSttn.rswtSttNodeList,
+ // // data: tableTotalData,
+ // });
}
}, [rainSttn.rainChkRes]);
-
- useEffect(() =>{
- setDetailData({data:[] , head:[], node:[]})
- },[])
+
+ useEffect(() => {
+ setDetailData({ data: [], head: [], node: [] });
+ }, []);
return (
-
-
- 0?"h-[80vh]":"h-[70vh]"} >
+
+ 0
+ ? "h-[80vh]"
+ : "h-[70vh]"
+ }
+ >
{type === "RNB" ? (
-
+
) : type === "RST" ? (
-
- ) : ()}
+
+ ) : (
+
+ )}
- {detailData.data.length>0?
-
-
- :<>>}
+ {detailData.data.length > 0 ? (
+
+
+
+ ) : (
+ <>>
+ )}
-
);
}