diff --git a/apps/wr/app/(map-layout)/layout.tsx b/apps/wr/app/(map-layout)/layout.tsx
new file mode 100644
index 000000000..a44714aa2
--- /dev/null
+++ b/apps/wr/app/(map-layout)/layout.tsx
@@ -0,0 +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}
+
+ );
+}
diff --git a/apps/wr/app/(with-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx
similarity index 94%
rename from apps/wr/app/(with-layout)/map/mainMap/page.tsx
rename to apps/wr/app/(map-layout)/map/mainMap/page.tsx
index 664283c80..331e487bd 100644
--- a/apps/wr/app/(with-layout)/map/mainMap/page.tsx
+++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx
@@ -2,11 +2,12 @@
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";
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/(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)/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 (
{
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/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/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) => {
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
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(() => {