Merge commit 'ef1643e9da4cb71ac202ac995157136023ef7bb2' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run

This commit is contained in:
JIeunhuh
2025-07-08 16:09:30 +09:00
2 changed files with 21 additions and 43 deletions
+20 -42
View File
@@ -1,24 +1,18 @@
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
import type { customPbnst, pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
import { excelDownload, tableData } from "@/components/lib/func/commom";
import { Title, UiTable, UITab, ContentsDiv, ScrollArea } from '@common/business_components';
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
import { Button } from "@common/components/ui";
import React, { useCallback, useState, useEffect } from 'react';
import NewWindowPortal from '@/app/map/newWindowPortal';
import PbnstPrfmncSttnPopup from "@/app/map/pbnstPrfmncSttnPopup";
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
import type { chgBuilding, customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
import RainPrfmncSttnPopup from "@/app/map/rainPrfmncSttnPopup";
import RswtrPrfmncsSttnPopup from "@/app/map/rswtrPrfmncSttnPopup";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
import HtdflPrfmncSttnPopup from "@/app/map/htdflPrfmncSttnPopup";
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
import { getFetch } from "@/components/lib/api";
import { useGisContext } from "@common/business_components/ui/map/Gis";
import ListDiv from "@common/business_components/ui/list_div";
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
interface NewWindowPopupProps {
featureData: any;
@@ -26,6 +20,7 @@ interface NewWindowPopupProps {
checkedLayersData?: any[];
seletectedLayerNm?: string
viewMode?: 'list' | 'detail' | 'nothing'
onFeatureSelect: (data: any) => void;
onClose: () => void;
}
@@ -51,6 +46,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
checkedLayers = [],
checkedLayersData = [],
seletectedLayerNm,
onFeatureSelect,
onClose
}) => {
const { gisMap } = useGisContext() as unknown as { checkedLayerIds: React.MutableRefObject<number[]>; treeData: { lyrSn: number }[] | null; gisCore: any; gisMap: any; };
@@ -126,38 +122,37 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
const layerId = getSelectedLayers();
if (featureData && typeof featureData.getProperties === "function") {
const selectedVal = featureData.getProperties();
let featureCd = layerId == '하수재이용시설' ? selectedVal?.swtrmt_fclt_cd : layerId == '빗물이용시설' || layerId == '중수도시설' ? selectedVal?.bdst_nm : layerId == '하수처리시설' ? 'a' : null;
let featureCd = layerId == '하수재이용시설' ? selectedVal?.swtrmt_fclt_cd : layerId == '빗물이용시설' || layerId == '중수도시설' || layerId == '온배수시설'? selectedVal?.bdst_nm : layerId == '하수처리시설' ? 'a' : null;
if (featureCd && featureCd !== fcltPk) {
if (layerId == '하수재이용시설') {
featureCd = selectedVal?.swtrmt_fclt_cd;
setFcltPk(featureCd); // 현재 호출된 featureCd 저장
setActiveTab(featureCd)
fetchpbnstDetail(featureCd); // 상세정보
setViewMode("detail")
}
else if (layerId == '빗물이용시설') {
featureCd = selectedVal?.bdst_nm;
setFcltPk(featureCd)
rainSttnSearch(1, '20', '', featureCd, code.cityCd, code.sggCd);
setRainDetailModal({ isOpen: true, data: rainSttn.rainSttnRes[0] });
setViewMode("detail")
}
else if (layerId == '중수도시설') {
featureCd = selectedVal?.bdst_nm;
console.log(featureCd)
setFcltPk(featureCd)
rswtSttnSearch(1, '20', '', featureCd, code.cityCd, code.sggCd);
setRswtrDetailModal({ isOpen: true, data: rswtSttnRes[0] });
setViewMode("detail")
}
else if (layerId == '온배수시설') {
featureCd = selectedVal?.bdst_nm;
setFcltPk(featureCd)
htdflSttnSearch(1, '20', '', featureCd, code.cityCd, code.sggCd);
setHtdflDetailModal({ isOpen: true, data: htdflSttnRes[0] });
setViewMode("detail")
}
else if(layerId =='하수처리시설') onClose();
else if(layerId =='하수처리시설') {
};
setViewMode("detail")
}
} else if (layerId === null && seletectedLayerNm) { setViewMode("list") }
}, [featureData]);
@@ -173,8 +168,10 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
) {
setFcltPk(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk);
fetchpbnstDetail(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk)
// onFeatureSelect(pbnstSttn.pbnstSttnRes[index]);
setActiveTab(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk)
setViewMode("detail")
// onClose()
}
};
const getSelectedLayers = () => {
@@ -187,7 +184,6 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
&& typeof featureData.getId === 'function' && source.hasFeature(featureData)) {
featureLayer = layer; // 피처가 속한 레이어 찾기)
}
console.log('layernm',layer.get('lyrNm'))
});
result = featureLayer.get('lyrNm');
@@ -275,6 +271,8 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
headId !== 'chBuildingYn') {
setRainDetailModal({ isOpen: true, data: rainTable[index] })
setViewMode('detail')
// onFeatureSelect(rainTable[index]);
// onClose();
} else if (headId === 'chBuildingYn' && index !== undefined && rainTable !== undefined) {
if (rainTable[index] && rainTable[index]?.chgBuilding[0]?.bdstChgNm !== null)
setRainBdstChgProps({ isOpen: true, chBuilding: rainTable[index].chgBuilding });
@@ -364,7 +362,6 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
}, [code, rswtSttnRes]);
// 엑셀 관련
const rswtSttnExcelDownload = useCallback(() => {
console.log('excel', rswtSttn.excelList, rswtrTable)
if (rswtSttn.excelList.length > 0) {
if (rswtSttn.excelList.length === 0) return;
excelDownload(
@@ -424,19 +421,15 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
}, [code, pbnstHasuRes]);
useEffect(() => {
if (!pbnst.isInit) {
pubHasuInit("1", "41");
pubHasuInit("1", "0");
}
}, [pbnst.isInit, pubHasuInit]);
useEffect(() => {
pubHasuInit(String(hasuPage), "41");
}, [hasuPage, pubHasuInit]);
pubHasuInit(String(hasuPage), "0");
}, [hasuPage]);
// 체크된 레이어에 따른 조건부 컴포넌트 렌더링 함수
const renderConditionalContent = () => {
// 특정 레이어가 체크되었는지 확인
const hasWaterTreatmentLayer = checkedLayersData.some(layer =>
layer.data?.lyrNm?.includes('하수처리') || layer.data?.lyrNm?.includes('재이용시설')
);
const actTabData = tabData.find((tab) => tab.id === activeTab);
let layerId = getSelectedLayers();
if (layerId === null || layerId === undefined) {
@@ -461,7 +454,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
</div>
{/* 높이 조정 */}
<UiTable
tableData={bdstTable || []}
tableData={hasuTable || []}
headlist={pubFacHeadList}
pageSize={10}
total={100000}
@@ -532,12 +525,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
if (viewMode == 'detail') {
// 빗물이용시설 상세
return (
<>
<div className="flex justify-between items-center mb-4">
<Title title="빗물이용시설 상세정보" />
</div>
<RainPrfmncSttnPopup rainForm={rainDetailModal.data as customRainBdst} isModal={false} />
</>
<SttnDetailModal type={"RNB"} formObj={rainDetailModal.data as customRainBdst} />
);
} else {
// 빗물이용시설 목록
@@ -572,12 +560,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
if (viewMode == 'detail') {
// 중수도시설 상세
return (
<>
<div className="flex justify-between items-center mb-4">
<Title title="중수도시설 상세정보" />
</div>
<RswtrPrfmncsSttnPopup rswtForm={rswtrDetailModal.data as customRswtBdst} isModal={false} />
</>
<SttnDetailModal type={"RST"} formObj={rswtrDetailModal.data as customRswtBdst}/>
);
} else {
// 중수도시설 목록
@@ -612,12 +595,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
if (viewMode == 'detail') {
// 온배수시설 상세
return (
<>
<div className="flex justify-between items-center mb-4">
<Title title="온배수시설 상세정보" />
</div>
<HtdflPrfmncSttnPopup htdflForm={htdflDetailModal.data as customHtdflBdst} isModal={false} />
</>
<SttnDetailModal type={"HTB"} formObj={htdflDetailModal.data as customHtdflBdst}/>
);
} else {
// 온배수시설 목록
+1 -1
View File
@@ -48,7 +48,7 @@ const NewWindowPortal: React.FC<NewWindowPortalProps> = ({ children, onClose, ti
if (newWindowRef.current && !newWindowRef.current.closed) return;
// 1. 새 창을 열고 참조를 저장합니다.
newWindowRef.current = window.open('', title, 'width=1400,height=1024,resizable=yes,scrollbars=yes');
newWindowRef.current = window.open('', title, 'width=900,height=800,resizable=yes,scrollbars=yes');
if (newWindowRef.current) {
newWindowRef.current.document.title = title;