From 4e65b3129f076f861014674baa683994ec042deb Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 8 Aug 2025 11:20:47 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EC=A7=80=EB=8F=84=20nofooter=20=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/layout.tsx | 12 ++++++++++++ .../map/mainMap/page.tsx | 2 +- .../map/popup/page.tsx | 0 .../map => (map-layout)}/service/index.ts | 0 .../map => (map-layout)}/service/map.ts | 0 apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx | 2 +- .../ui/map/detailPopup/coSttnDetailPopup.tsx | 10 ++++++++++ .../{LayerPopUp => }/detailPopup/ruseDetailPopup.tsx | 0 8 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 apps/wr/app/(map-layout)/layout.tsx rename apps/wr/app/{(with-layout) => (map-layout)}/map/mainMap/page.tsx (99%) rename apps/wr/app/{(with-layout) => (map-layout)}/map/popup/page.tsx (100%) rename apps/wr/app/{(with-layout)/map => (map-layout)}/service/index.ts (100%) rename apps/wr/app/{(with-layout)/map => (map-layout)}/service/map.ts (100%) create mode 100644 apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx rename apps/wr/components/ui/map/{LayerPopUp => }/detailPopup/ruseDetailPopup.tsx (100%) diff --git a/apps/wr/app/(map-layout)/layout.tsx b/apps/wr/app/(map-layout)/layout.tsx new file mode 100644 index 000000000..d11fafb72 --- /dev/null +++ b/apps/wr/app/(map-layout)/layout.tsx @@ -0,0 +1,12 @@ +"use client"; +import { NoFooterLayout } from "@common/components/ui"; + +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/(map-layout)/map/mainMap/page.tsx similarity index 99% rename from apps/wr/app/(with-layout)/map/mainMap/page.tsx rename to apps/wr/app/(map-layout)/map/mainMap/page.tsx index d561ad933..c4a1f34e3 100644 --- a/apps/wr/app/(with-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -2,7 +2,7 @@ import Gis from "@common/business_components/ui/map/Gis"; import { useEffect, useRef, useState, useCallback } from "react"; -import { mapService } from "../service"; +import { mapService } from "../../service"; import GisApp from "@common/business_components/ui/map/lib/gis.core"; import { SearchBar } from "@common/business_components/ui/map/searchBar/searchBar"; import { useWrStore } from "@/app/store"; diff --git a/apps/wr/app/(with-layout)/map/popup/page.tsx b/apps/wr/app/(map-layout)/map/popup/page.tsx similarity index 100% rename from apps/wr/app/(with-layout)/map/popup/page.tsx rename to apps/wr/app/(map-layout)/map/popup/page.tsx diff --git a/apps/wr/app/(with-layout)/map/service/index.ts b/apps/wr/app/(map-layout)/service/index.ts similarity index 100% rename from apps/wr/app/(with-layout)/map/service/index.ts rename to apps/wr/app/(map-layout)/service/index.ts diff --git a/apps/wr/app/(with-layout)/map/service/map.ts b/apps/wr/app/(map-layout)/service/map.ts similarity index 100% rename from apps/wr/app/(with-layout)/map/service/map.ts rename to apps/wr/app/(map-layout)/service/map.ts diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index a96780250..debea36c9 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -1,6 +1,6 @@ "use client"; import { useWrStore } from "@/app/store"; -import { RuseDetailPopup } from "@/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup"; +import { RuseDetailPopup } from "@/components/ui/map/detailPopup/ruseDetailPopup"; 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"; diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx new file mode 100644 index 000000000..dbd30a89d --- /dev/null +++ b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx @@ -0,0 +1,10 @@ +export default function coSttnDetailPopup(){ + + + return( + <> + + + + ) +} \ No newline at end of file diff --git a/apps/wr/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx similarity index 100% rename from apps/wr/components/ui/map/LayerPopUp/detailPopup/ruseDetailPopup.tsx rename to apps/wr/components/ui/map/detailPopup/ruseDetailPopup.tsx From fcb39e289e1e52cf562ad9cbfc0a9e55128d4a69 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 8 Aug 2025 14:53:18 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EC=A7=80=EB=8F=84=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 20 ++++++++++++++++--- .../(popUp-layout)/mapDetailPopUp/page.tsx | 14 ++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index a3c253500..331e487bd 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -7,6 +7,7 @@ import GisApp from "@common/business_components/ui/map/lib/gis.core"; import { SearchBar } from "@common/business_components/ui/map/searchBar/searchBar"; import { useWrStore } from "@/app/store"; import { getFeatureCd } from "@/components/lib/func/mapUtil"; +import toast, { Toaster } from "react-hot-toast"; const Map = () => { const { comMap } = useWrStore((state) => state); @@ -228,7 +229,6 @@ const Map = () => { 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)); @@ -266,7 +266,20 @@ const Map = () => { }; const onOpenPopup = (data:any) => { - console.log(data) + if(data){ + + const url = `/mapDetailPopUp?layerNm=${encodeURIComponent(data)}`; + 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{ + toast.error('시설 및 수요처가 선택되지 않았습니다.') + } + + } return ( @@ -307,7 +320,8 @@ const Map = () => { onOpenPopup(data) }} /> - + + ); }; diff --git a/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx index 04b7ab238..d8e93c567 100644 --- a/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapDetailPopUp/page.tsx @@ -16,7 +16,7 @@ export default function MapDetailPopUp() { const renderConditionalContent = () => { const layerId = searchParams.get("layerNm"); switch (layerId) { - case "하수재이용시설": + case "tb_wr_bdst_ruse_fclt": return ( { @@ -24,7 +24,7 @@ export default function MapDetailPopUp() { }} /> ); - case "하수처리시설": + case "tb_il_swage_prcs_fclt": return ( { @@ -32,7 +32,7 @@ export default function MapDetailPopUp() { }} /> ); - case "빗물이용시설": + case "tb_wr_rnwtr_utztn_fclt": return ( { @@ -40,7 +40,7 @@ export default function MapDetailPopUp() { }} /> ); - case "중수도시설": + case "tb_wr_rswtr_fclt": return ( { @@ -48,7 +48,7 @@ export default function MapDetailPopUp() { }} /> ); - case "온배수시설": + case "tb_wr_htdfl_fclt": return ( { @@ -56,7 +56,7 @@ export default function MapDetailPopUp() { }} /> ); - case "수요처": + case "tb_wr_ruse_fclt_dmd_co": return ( { @@ -64,7 +64,7 @@ export default function MapDetailPopUp() { }} /> ); - case "잠재수요처": + case "tb_wr_tmpr_dmd_co": return ( { From 986e7a5c3bbc13553aedd579e57a59edb516cc59 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 8 Aug 2025 17:30:22 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=98=A4=EB=A5=98=20=EB=B0=8F=20=EC=9E=98=EB=AA=BB?= =?UTF-8?q?=EB=90=9C=20api=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/layout.tsx | 15 ++++++++++++++- apps/wr/components/lib/api/index.ts | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/apps/wr/app/(map-layout)/layout.tsx b/apps/wr/app/(map-layout)/layout.tsx index d11fafb72..a44714aa2 100644 --- a/apps/wr/app/(map-layout)/layout.tsx +++ b/apps/wr/app/(map-layout)/layout.tsx @@ -1,12 +1,25 @@ "use client"; +import type { MenuItem } from "@common/components/api"; import { NoFooterLayout } from "@common/components/ui"; +import { usePathname,useRouter } from "next/navigation"; +import { useWrStore } from "../store"; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + const { getMenuAuthrts } = useWrStore((state) => state); + const router = useRouter(); + const pathname = usePathname(); + + const changeMenu = (path: MenuItem) => { + getMenuAuthrts(path.menuCd); + router.push(path.urlPath); + }; return ( - {children} + + {children} + ); } diff --git a/apps/wr/components/lib/api/index.ts b/apps/wr/components/lib/api/index.ts index fd1287793..6b1f4292c 100644 --- a/apps/wr/components/lib/api/index.ts +++ b/apps/wr/components/lib/api/index.ts @@ -41,7 +41,10 @@ export const getFetch = async (type: string, url: string) => { // JSON 응답 처리 const res = await response.json(); return res.data; - } else { + } else if(contentType.includes('application/octet-stream')) { + // 파일 응답 처리 (ex. PDF, Excel 등) + + console.log('contentType ' ,contentType) // 파일 응답 처리 (ex. PDF, Excel 등) const blob = await response.blob(); const blobUrl = window.URL.createObjectURL(blob); @@ -54,7 +57,9 @@ export const getFetch = async (type: string, url: string) => { window.URL.revokeObjectURL(blobUrl); return null; // 다운로드이므로 반환값 없음 - } + }else{ + throw Error('오류 발생') + } }; export const getFetchWithCount = async (type: string, url: string) => { @@ -89,8 +94,10 @@ export const getFetchWithCount = async (type: string, url: string) => { const res = await response.json(); return res; - } else { + } else if(contentType.includes('application/octet-stream')) { // 파일 응답 처리 (ex. PDF, Excel 등) + + console.log('contentType ' ,contentType) const blob = await response.blob(); const blobUrl = window.URL.createObjectURL(blob); const a = document.createElement("a"); @@ -102,7 +109,9 @@ export const getFetchWithCount = async (type: string, url: string) => { window.URL.revokeObjectURL(blobUrl); return null; // 다운로드이므로 반환값 없음 - } + }else{ + throw Error('오류 발생') + } }; export const postFectch = async (url: string, params: any, type?: string) => { From 552c9a15324a0cf4ca30cbcab1e1e11006fe7a39 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 8 Aug 2025 18:40:02 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=20=ED=8C=9D=EC=97=85=20=EC=8B=A4=EC=A0=81=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/map/ruseMap/index.tsx | 39 ++++++++++++++----- .../ruseFcltMng/fcltReg/pbnstReg/type.tsx | 31 ++++++++++++++- .../sttn/pbnstSttnModal/pbnstSttnModal.tsx | 23 +++++++---- 3 files changed, 74 insertions(+), 19 deletions(-) diff --git a/apps/wr/app/store/map/ruseMap/index.tsx b/apps/wr/app/store/map/ruseMap/index.tsx index a42355f81..6333846b4 100644 --- a/apps/wr/app/store/map/ruseMap/index.tsx +++ b/apps/wr/app/store/map/ruseMap/index.tsx @@ -1,4 +1,4 @@ -import { fetchType, getFetch } from "@/components/lib/api"; +import { fetchType, getFetch, postFectch } from "@/components/lib/api"; import type { CommonTableProps } from "../../common/type/header"; import type { WaterReuseFacility } from "../../ruseFcltMng/fcltSttn/pbnstSttn/type"; import { @@ -16,7 +16,7 @@ export type ruseMapState = { ruseMapCount: number; isInit: boolean; fclts: string[]; - ruseDetailList:customPbnst[] + ruseDetailList: customPbnst[]; ruseMapHeadList: CommonTableProps[]; ruseMapNodeList: CommonTableProps[]; }; @@ -32,16 +32,17 @@ type ruseMapActions = { fclts: string[] ) => void; ruseMapDetail: (ruseFcltId: string) => Promise; - getRuseMaplList :(ruseFcltId: string) => void; + getRuseMaplList: (bscFctCd: string) => void; }; + export type ruseMapType = ruseMapState & ruseMapActions; export const ruseMapStateExport: ruseMapState = { ruseMap: { isInit: false, ruseMapRes: [], - ruseDetailList:[], + ruseDetailList: [], fclts: [], ruseMapCount: 1, ruseMapHeadList: pbnSttHeadListExport, @@ -109,15 +110,36 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( console.log(errorHasu); throw errorHasu; // 호출부에서 catch 가능하도록 } - },getRuseMaplList:async(bscFctCd: string) =>{ + }, + getRuseMaplList: async (bscFctCd: string) => { try { - const ruseDetailList = await getFetch("wr", `/reuseFc/pubFc/${bscFctCd}`); + const ruseDetailList = await getFetch( + fetchType.WR, + `/reuseFc/pubFc/${bscFctCd}` + ); + const year = new Date().getFullYear(); + const data = [bscFctCd]; + const rusePrfList = await postFectch( + `/reuseFc/pubDetailList/${year}/0/1/10`, + data, + fetchType.WR + ); + const dataList = ruseDetailList.map((ruse) => { + const matchRuse = rusePrfList?.data.find( + (prf) => prf.pbnstRuseFcltId === ruse.pbnstRuseFcltId + ); + return { + ...ruse, + prfList: matchRuse.prfList, + }; + }); + console.log("/dataList ", dataList); set((state: ruseMapState) => { return { ...state, ruseMap: { ...state.ruseMap, - ruseDetailList: ruseDetailList, + ruseDetailList: dataList, }, }; }); @@ -125,7 +147,6 @@ export const ruseMapActionsExport: (set: any) => ruseMapActions = ( console.log(errorHasu); throw errorHasu; // 호출부에서 catch 가능하도록 } - } - + }, }; }; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx index f8bb81b88..226de8f17 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx @@ -231,6 +231,30 @@ export const fcBizSchema = z.object({ mdfr: z.string().nullish(), }); +const PrfSchema = z.object({ + pbnstRuseFcltId: z.string(), + ym: z.string(), // 예: "202310" + wshwtr: z.number(), + coolUswtr: z.number(), + cleanUswtr: z.number(), + drwtUswtr: z.number(), + dltnUswtr: z.number(), + ithlRswtr: z.number(), + ithlEtcUswtr: z.number(), + cleanToilUswtr: z.number(), + resn: z.number(), + lndwtr: z.number(), + hydUswtr: z.number(), + rvrKeepUswtr: z.number(), + farmUswtr: z.number(), + ugwtChr: z.number(), + indstUswtr: z.number(), + regDt: z.date().default(new Date()).nullish(), + rgtr: z.string().nullish(), + mdfcnDt: z.date().default(new Date()).nullish(), + mdfr: z.string().nullish(), +}); + export const pbnstRegZod = z.object({ pbnstRuseFcltId: z.string().default(""), swtrmtFcltId: z.string().default(""), @@ -258,11 +282,14 @@ export const pbnstRegZod = z.object({ fcBizs: z.array(fcBizSchema).default([]), fcOpers://z.array(fcOperSchema).default([]), z .array(fcOperSchema) - .min(1, { message: "재이용시설의 운영정보를 최소 하나를 등록해주세요" }) + .min(1, { message: "재이용시설의 운영정보를 최소 하나를 등록해주세요" }), + prfList: z.array(PrfSchema).nullish(), }); -export const pbnstRegArrayZod = z.array(pbnstRegZod); + + +export const pbnstRegArrayZod = z.array(pbnstRegZod); export type PbnstRegArrrayType = z.infer; export type fcBizType = z.infer; diff --git a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx index b6ac72eb6..d7ad10a76 100644 --- a/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx +++ b/apps/wr/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal.tsx @@ -223,17 +223,24 @@ export function PbnstSttnModal({ data, titleVisible,isMap}: { data: customPbnst; } }; useEffect(() => { - if (pbnstSttn.pbnstSttnRes && data) { - const prfList = pbnstSttn.pbnstSttnRes.find( - (item) => item.pbnstRuseFcltId === data.pbnstRuseFcltId - )?.prfList; + if(isMap){ + if(data.prfList &&data.prfList.length>0){ + getTablePrfData(data.prfList); + } + }else{ - if (prfList) { - - getTablePrfData(prfList); + if (pbnstSttn.pbnstSttnRes && data) { + const prfList = pbnstSttn.pbnstSttnRes.find( + (item) => item.pbnstRuseFcltId === data.pbnstRuseFcltId + )?.prfList; + + if (prfList) { + + getTablePrfData(prfList); + } } } - }, [pbnstSttn.pbnstSttnRes, data]); + }, [pbnstSttn.pbnstSttnRes, data,isMap]); useEffect(() => {