diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 87e762b43..0006631d3 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -106,7 +106,9 @@ const Map = () => { const featurePk = getWrFeaturePk(layerName ?? ""); // 재이용시설 if (featurePk) { - featureId = `${layerName}.${data[featurePk]}`; + + const lastPk = layerName==='tb_wr_ruse_fclt_dmd_co'? data[featurePk].replaceAll("-", "") : data[featurePk] + featureId = `${layerName}.${lastPk}`; } else { console.warn("해당 피처는 선택된 레이어에서 찾을수 없습니다."); } @@ -154,12 +156,11 @@ const Map = () => { setIsOpen(true); setIsSearchModalOpen(false); - if (popUpClick && !( + if (popUpClick && foundFeature&&!( Object.keys(foundFeature?.getProperties()).length === 0 && foundFeature.constructor === Object )){ const layerName = getWrLayerNm(data); - const isColumn = getFeatureCd(foundFeature.getProperties(), String(layerName)); if(layerName&&isColumn) featurePopUpOpen(layerName,isColumn,popupDetailRef) diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index ff4e3ffbd..a660e5e6b 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -1,5 +1,6 @@ "use client"; import { useWrStore } from "@/app/store"; +import CoSttnDetailPopup from "@/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup"; 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"; @@ -16,6 +17,7 @@ export default function MapFeaturePopup() { htdfMapDetile, pbnMapDetaile, ldrmntMapDetile, + coSttnMapDetail } = useWrStore((state) => state); const { pbnMapHeadList } = pbnMap; const [isDetail, setIsDetail] = useState(null); @@ -63,6 +65,11 @@ export default function MapFeaturePopup() { htdfMapDetile(isFeatureCd).then((res) => { setIsDetail(res); }); + }else if(layerNm ==='tb_wr_ruse_fclt_dmd_co'){ + coSttnMapDetail(isFeatureCd).then((res) => { + console.log('tb_wr_ruse_fclt_dmd_co ', res) + setIsDetail(res); + }); } else if (layerNm === "tb_wr_tmpr_dmd_co") { ldrmntMapDetile(isFeatureCd).then((res) => { setIsDetail(res); @@ -112,7 +119,12 @@ export default function MapFeaturePopup() { }} isMap={true} /> - ) : ( + ) :layerNm === "tb_wr_ruse_fclt_dmd_co" ? ( + + ) + : ( void; coSttnMapSearch: (pageNo: number, pageCnt: number, con: string) => void; - coSttnMapTxtSearch: (pageNo: number, pageCnt: number, con: string, txt: string) => void; + coSttnMapTxtSearch: ( + pageNo: number, + pageCnt: number, + con: string, + txt: string + ) => void; + coSttnMapDetail: (dmdInfoId: string) => Promise; }; export type coSttnMapType = coSttnMapState & coSttnMapActions; @@ -37,7 +46,6 @@ export const coSttnMapStateExport: coSttnMapState = { }, }; - export const coSttnMapActionsExport: (set: any) => coSttnMapActions = ( set: any ) => { @@ -60,7 +68,7 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = ( }; }); } catch (e) { - console.log(e) + console.log(e); } }, coSttnMapSearch: async (pageNo: number, pageCnt: number, con: string) => { @@ -96,11 +104,17 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = ( console.log("error", erTxt); } }, - coSttnMapTxtSearch: async (pageNo: number, pageCnt: number, con: string, txt: string) => { + coSttnMapTxtSearch: async ( + pageNo: number, + pageCnt: number, + con: string, + txt: string + ) => { try { const coSttnMapRes = await getFetchWithCount( fetchType.WR, - `/reuseFc/request/${pageNo}/${pageCnt}/${con}/${txt}`) + `/reuseFc/request/${pageNo}/${pageCnt}/${con}/${txt}` + ); set((state: coSttnMapState) => { return { ...state, @@ -109,12 +123,23 @@ export const coSttnMapActionsExport: (set: any) => coSttnMapActions = ( coSttnMapRes: coSttnMapRes.data, coSttnMapResCount: coSttnMapRes.count, isInit: false, - } - } - }) + }, + }; + }); } catch (erTxt) { console.log("error", erTxt); } }, - } -} \ No newline at end of file + coSttnMapDetail: async (dmdInfoId: string) => { + try { + const coSttnMapDetail = await getFetch( + fetchType.WR, + `/reuseFc/request/${dmdInfoId}` + ); + return coSttnMapDetail; + } catch (erTxt) { + console.log("error", erTxt); + } + }, + }; +}; diff --git a/apps/wr/components/lib/func/mapUtil.ts b/apps/wr/components/lib/func/mapUtil.ts index 78aa71427..ebf4cc2dc 100644 --- a/apps/wr/components/lib/func/mapUtil.ts +++ b/apps/wr/components/lib/func/mapUtil.ts @@ -30,7 +30,6 @@ export const getFeatureCd = (featurePropertise: any, layerNm: string) => { layerNm === "tb_wr_bdst_ruse_fclt" ? featurePropertise?.swtrmt_fclt_cd : [ - "tb_wr_ruse_fclt_dmd_co", "tb_wr_rswtr_fclt", "tb_wr_htdfl_fclt", "tb_wr_rnwtr_utztn_fclt", @@ -39,29 +38,29 @@ export const getFeatureCd = (featurePropertise: any, layerNm: string) => { ? featurePropertise?.bdst_nm : layerNm === "tb_il_swage_prcs_fclt" ? featurePropertise?.swtrmt_fclt_nm - : null; + : layerNm === "tb_wr_ruse_fclt_dmd_co" + ? featurePropertise?.bdst_info_sn + : null; return featureCd; }; export const getWrLayerNm = (featurePropertise: any) => { const result = wrLayerList - .filter(item => item.val in featurePropertise) // 키 존재 여부 체크 - .map(item => item.text); - + .filter((item) => item.val in featurePropertise) // 키 존재 여부 체크 + .map((item) => item.text); return result[0]; }; - -export const getWrFeaturePk = (layerName :string) => { +export const getWrFeaturePk = (layerName: string) => { const result = wrFeaturePK - .filter(item => item.val === layerName) // 키 존재 여부 체크 - .map(item => item.text); + .filter((item) => item.val === layerName) // 키 존재 여부 체크 + .map((item) => item.text); return result[0]; }; -export const getSelectedLayers = (isFeature: any, gisMaps:any) => { +export const getSelectedLayers = (isFeature: any, gisMaps: any) => { const map = gisMaps.current; if (!map) { console.warn("지도가 초기화되지 않았습니다."); @@ -94,11 +93,11 @@ export const getSelectedLayers = (isFeature: any, gisMaps:any) => { return result; }; -export const getClickFeatureId = (data: any) => { - let featureId ='' +export const getClickFeatureId = (data: any) => { + let featureId = ""; const layerName = data.layerNm; if (layerName === "하수재이용시설") { - // 재이용시설 + // 재이용시설 featureId = `${layerName}.${data.searchPk}`; } else if ( //빗물이용시설, 중수도시설 @@ -121,7 +120,11 @@ export const getClickFeatureId = (data: any) => { return featureId; }; -export function featurePopUpOpen(layerNm:string,featureCd:string,popupDetailRef){ +export function featurePopUpOpen( + layerNm: string, + featureCd: string, + popupDetailRef +) { const url = `/mapFeaturePopup?layerNm=${encodeURIComponent(String(layerNm))}&featureCd=${encodeURIComponent(featureCd)} `; const width = String(layerNm) === "tb_wr_bdst_ruse_fclt" @@ -139,4 +142,4 @@ export function featurePopUpOpen(layerNm:string,featureCd:string,popupDetailRef) "지도 시설 상세정보 팝업", popupOptions ); -} \ No newline at end of file +} diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx deleted file mode 100644 index dbd30a89d..000000000 --- a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup.tsx +++ /dev/null @@ -1,10 +0,0 @@ -export default function coSttnDetailPopup(){ - - - return( - <> - - - - ) -} \ No newline at end of file diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx new file mode 100644 index 000000000..26c586561 --- /dev/null +++ b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx @@ -0,0 +1,30 @@ +import { useWrStore } from "@/app/store"; +import SdmInsertForm from "@common/business_components/ui/sdmInsertForm"; +import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; + +export default function CoSttnDetailPopup({isDetail} :{isDetail:DemandCompType}){ + const { + code + } = useWrStore((state) => state); + + + return( +
+ { + console.log(searchText, pageCnt); + }} + rtnInputData={async (data) => { + console.log(data) + }} + bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"} + updateList={isDetail} + readOnly={true} + > + +
+ ) +} \ No newline at end of file