수요처 팝업 추가 완료
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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<any>(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" ? (
|
||||
<CoSttnDetailPopup
|
||||
isDetail={isDetail}
|
||||
/>
|
||||
)
|
||||
: (
|
||||
<SttnDetailModal
|
||||
type={
|
||||
layerNm === "tb_wr_rnwtr_utztn_fclt"
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
import type { CommonTableProps } from "../../common/type/header";
|
||||
import { coSttHeadListExport, coSttNodeListExport } from "../../matDmd/coSttn/headList";
|
||||
import { fetchType, getFetchWithCount } from "@/components/lib/api";
|
||||
import {
|
||||
coSttHeadListExport,
|
||||
coSttNodeListExport,
|
||||
} from "../../matDmd/coSttn/headList";
|
||||
import { fetchType, getFetch, getFetchWithCount } from "@/components/lib/api";
|
||||
|
||||
const coSttnMapRes: DemandCompType[] = [];
|
||||
|
||||
export const costtnMapSize =20
|
||||
export const costtnMapSize = 20;
|
||||
|
||||
export type coSttnMapState = {
|
||||
coSttnMap: {
|
||||
@@ -21,7 +24,13 @@ export type coSttnMapState = {
|
||||
type coSttnMapActions = {
|
||||
coSttnMapInit: (pageNo: number, pageCnt: number, con: string) => 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<DemandCompType | undefined>;
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
coSttnMapDetail: async (dmdInfoId: string) => {
|
||||
try {
|
||||
const coSttnMapDetail = await getFetch(
|
||||
fetchType.WR,
|
||||
`/reuseFc/request/${dmdInfoId}`
|
||||
);
|
||||
return coSttnMapDetail;
|
||||
} catch (erTxt) {
|
||||
console.log("error", erTxt);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
export default function coSttnDetailPopup(){
|
||||
|
||||
|
||||
return(
|
||||
<>
|
||||
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -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(
|
||||
<div>
|
||||
<SdmInsertForm
|
||||
selectSidoData={code.cityCd}
|
||||
selectSigunData={code.sggCd}
|
||||
dataList={[]}
|
||||
rtnValue={(searchText: string, pageCnt: number) => {
|
||||
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}
|
||||
></SdmInsertForm>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user