diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index 3b1ec8a78..680f637d4 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -20,7 +20,7 @@ export default function MapFeaturePopup() { coSttnMapDetail } = useWrStore((state) => state); const { pbnMapHeadList } = pbnMap; - const [isDetail, setIsDetail] = useState(null); + const [isDetail, setIsDetail] = useState(undefined); const [layerNm, setLayerNm] = useState(); const searchParams = useSearchParams(); @@ -45,6 +45,15 @@ export default function MapFeaturePopup() { }; }, []); + useEffect(() => { + if(isDetail ===null){ + alert("해당시설은 X,Y좌표를 찾을수 없어 위치를 찾을수 없습니다."); + window.close(); // isDetail이 null이면 팝업 닫기 + } + console.log("isDetail", isDetail); + }, [isDetail]); + + useEffect(() => { if (isFeatureCd && layerNm) { if (layerNm === "tb_wr_bdst_ruse_fclt") { @@ -55,6 +64,7 @@ export default function MapFeaturePopup() { }); } else if (layerNm === "tb_wr_rnwtr_utztn_fclt") { rainMapDetile(isFeatureCd).then((res) => { + setIsDetail(res); }); } else if (layerNm === "tb_wr_rswtr_fclt") { @@ -78,7 +88,7 @@ export default function MapFeaturePopup() { } }, [isFeatureCd, layerNm]); - if (!isDetail) return null; // 데이터 없으면 아무것도 안 그림 + if (isDetail === undefined) return null; // 데이터 없으면 아무것도 안 그림 return ( <> {isDetail ? ( diff --git a/apps/wr/app/base.tsx b/apps/wr/app/base.tsx index 34452e20b..10a456dde 100644 --- a/apps/wr/app/base.tsx +++ b/apps/wr/app/base.tsx @@ -15,7 +15,15 @@ export default function Base({ const changeMenu = (path: MenuItem) => { getMenuAuthrts(path.menuCd); - router.push(path.urlPath); + if (path.menuKornNm === "하수재이용통계") { + // console.log("외부 페이지로 이동합니다. " ,path); + // const popupOptions = `width=${window.screen.availWidth},height=${window.screen.availHeight},left=0,top=0,resizable=yes,scrollbars=yes`; + // path.newWndwYn ='N' + // window.open(path.urlPath, "candidatePopup", popupOptions); + return null; + } else { + router.push(path.urlPath); + } }; return (