잠재수요처 상세정보
diff --git a/apps/wr/src/shared/config/env.ts b/apps/wr/src/shared/config/env.ts
index 49cc16b3a..acd0e25e2 100644
--- a/apps/wr/src/shared/config/env.ts
+++ b/apps/wr/src/shared/config/env.ts
@@ -1,7 +1,7 @@
export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "WR";
export const PORT = process.env.NEXT_PUBLIC_PORT || "3001";
export const PROXY_HOST = process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
-export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL ||'http://con.mind-one.co.kr:11080/api/v1';
+export const SERVER_API_WR_URL = process.env.NEXT_PUBLIC_WR_SERVER_API_URL ||'http://con.mind-one.co.kr:11080/api/v1';
export const SERVER_API_FO_URL = process.env.NEXT_PUBLIC_FO_SERVER_API_URL||' http://con.mind-one.co.kr:11082/api/v1';
export const SERVER_API_CS_URL = process.env.NEXT_PUBLIC_CS_SERVER_API_URL||'http://dev.onasys.co.kr:8000';
export const SERVER_API_CS_TUS_URL = process.env.NEXT_PUBLIC_CS_TUS_UPLOAD ||'/attach-service/api/v1/tus/upload'
diff --git a/packages/common/business_components/src/ui/chart/DoubleBar.tsx b/packages/common/business_components/src/ui/chart/DoubleBar.tsx
index 9627485aa..be930f3af 100644
--- a/packages/common/business_components/src/ui/chart/DoubleBar.tsx
+++ b/packages/common/business_components/src/ui/chart/DoubleBar.tsx
@@ -83,7 +83,6 @@ export default function DoubleBarChart({chartConfig=undefined, chartData=[], cha
.map(key => item[key])
).flat());
};
- console.log(chartData);
const barMaxValue = getMaxValue(chartData, 'barVal');
return (
<>
diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js
index d25d06056..1e5a3ee3a 100644
--- a/packages/common/business_components/src/ui/map/Gis.js
+++ b/packages/common/business_components/src/ui/map/Gis.js
@@ -13,6 +13,7 @@ import GisToolBar from './GisToolBar';
import GisTree from './GisTree';
import './lib/css/gis.common.css';
import GisApp from './lib/gis.core';
+// import FacilityInfoPopup from './FacilityInfoPopup';
export const GisContext = createContext({ gisCore: null, gisMap: null, treeData: null, checkedLayerIds: null });
export const useGisContext = () => useContext(GisContext);
@@ -102,7 +103,6 @@ function Gis({
onCheckedLayersChange,
setData = () => {},
}) {
-
const mapRef = useRef();
const [mapObject, setMapObject] = useState({});
const [tabVisible, setTabVisible] = useState(true);
@@ -223,7 +223,6 @@ function Gis({
// 지도 생성 및 초기화
useEffect(() => {
-
if (!mapRef.current) return;
if (mapInstanceRef.current) return; // 이미 생성된 맵이 있다면 중단
@@ -330,6 +329,120 @@ function Gis({
}
}
+ // // 데이터 로드 및 팝업 생성 로직
+ // useEffect(() => {
+ // if (!mapInstanceRef.current) return; // 맵이 생성되지 않았으면 실행 안 함
+
+ // // 1. 팝업 데이터 가져오기 (feature.js의 getData와 유사)
+ // const fetchPopupData = async () => {
+ // // 실제 API 호출 로직으로 대체해야 합니다.
+ // // 예시: const response = await yourApiService.getFcltyWtCnt();
+ // // setFacilityInfoPopupData(response.data);
+
+ // // 임시 목업 데이터
+ // const mockData = [
+ // { ftrIdn: 1, ftrCde: 'SA206', bplcNm: '처리장A', fcltyUseYn: 'Y', x: 127.005, y: 37.282, aCnt: 10, cCnt: 5, eCnt: 3, mCnt: 8, iCnt: 2 },
+ // { ftrIdn: 2, ftrCde: 'SA112', bplcNm: '처리장B', fcltyUseYn: 'N', x: 127.010, y: 37.285, aCnt: 8, cCnt: 4, eCnt: 2, mCnt: 6, iCnt: 1 }
+ // ];
+ // setFacilityInfoPopupData(mockData);
+ // };
+
+ // fetchPopupData();
+
+ // }, [mapInstanceRef.current]); // 맵 인스턴스가 생성된 후 한 번만 실행
+
+ // // 데이터가 변경되면 오버레이를 생성/업데이트하는 로직
+ // useEffect(() => {
+ // const map = mapInstanceRef.current;
+ // if (!map || facilityInfoPopupData.length === 0) return;
+
+ // // 기존 오버레이 정리
+ // facilityOverlaysRef.current.forEach(overlay => map.removeOverlay(overlay));
+ // facilityOverlaysRef.current = [];
+
+ // facilityInfoPopupData.forEach(data => {
+ // const popupId = `${data.ftrIdn}_${data.ftrCde}`;
+
+ // // 팝업을 담을 div 엘리먼트 생성
+ // const popupElement = document.createElement('div');
+ // popupElement.id = popupId;
+
+ // // OpenLayers Overlay 생성
+ // const position = olProj.transform([Number(data.x), Number(data.y)], GisApp.FROM_PROJ, GisApp.TO_PROJ);
+ // const overlay = new Overlay({
+ // element: popupElement,
+ // position: position,
+ // offset: [-75, -210], // 팝업 너비의 절반, 높이만큼 오프셋 조정
+ // positioning: 'bottom-center',
+ // className: 'facility-popup-overlay' // 필요시 공통 클래스 추가
+ // });
+
+ // map.addOverlay(overlay);
+ // facilityOverlaysRef.current.push(overlay);
+
+ // // React 컴포넌트를 popupElement에 렌더링
+ // const root = createRoot(popupElement);
+ // root.render(
);
+ // });
+
+ // // 초기 가시성 업데이트
+ // updatePopupVisibility();
+
+ // }, [facilityInfoPopupData]); // 팝업 데이터가 변경될 때마다 실행
+
+ // // 레이어 가시성에 따라 팝업 가시성을 제어하는 함수
+ // const updatePopupVisibility = useCallback(() => {
+ // const map = mapInstanceRef.current;
+ // if (!map) return;
+
+ // const visibleLayers = new Set();
+ // map.getLayers().forEach(layer => {
+ // if (layer.getVisible()) {
+ // // feature.js의 로직처럼 typeName이나 ftrCde를 사용해 필터링
+ // const typeName = layer.get('typeName');
+ // if (typeName === 'VW_WTL_FCLTY_AS') { // 예시 레이어 이름
+ // visibleLayers.add(layer.get('ftrCde'));
+ // }
+ // }
+ // });
+
+ // facilityOverlaysRef.current.forEach(overlay => {
+ // const element = overlay.getElement();
+ // const ftrCde = element.querySelector('table')?.classList[0]; // FacilityPopup의 클래스에서 ftrCde 가져오기
+
+ // if (visibleLayers.has(ftrCde)) {
+ // element.style.display = '';
+ // } else {
+ // element.style.display = 'none';
+ // }
+ // });
+ // }, []);
+
+ // GisTree에서 체크 상태가 변경될 때 이 함수를 호출하도록 연결해야 합니다.
+ // 예시: GisTree 컴포넌트에 onCheck 콜백을 추가하고, 그 콜백에서 이 함수를 호출
+ // useEffect(() => {
+ // // 레이어 가시성이 변경될 때마다 팝업 가시성 업데이트
+ // const map = mapInstanceRef.current;
+ // if (!map) return;
+
+ // const handleLayerVisibilityChange = () => {
+ // updatePopupVisibility();
+ // };
+
+ // map.getLayers().on('change:length', handleLayerVisibilityChange);
+ // map.getLayers().forEach(layer => {
+ // layer.on('change:visible', handleLayerVisibilityChange);
+ // });
+
+ // return () => {
+ // // 클린업
+ // map.getLayers().un('change:length', handleLayerVisibilityChange);
+ // map.getLayers().forEach(layer => {
+ // layer.un('change:visible', handleLayerVisibilityChange);
+ // });
+ // };
+ // }, [updatePopupVisibility]);
+
// 체크된 레이어 정보를 처리하는 함수
const handleCheckedLayersChange = useCallback((checkedIds, checkedNodesData) => {
setTimeout(() => {
@@ -358,6 +471,8 @@ function Gis({
imageVisible={imgVisble}
/>
+ {/*
*/}
+
{/* DetailView가 존재할 때만 렌더링 isSearchModalOpen이 true면 visible=false로 팝업 숨김 */}
{isOpen && !isSearchModalOpen && (
)}
+ {/*
*/}
diff --git a/packages/common/business_components/src/ui/map/lib/gis.layer.js b/packages/common/business_components/src/ui/map/lib/gis.layer.js
index f0e29d31c..fee3f247b 100644
--- a/packages/common/business_components/src/ui/map/lib/gis.layer.js
+++ b/packages/common/business_components/src/ui/map/lib/gis.layer.js
@@ -142,7 +142,19 @@ GisOlLayer.prototype = {
let returnLayer = this.makeLayer(option);
//레이어 소스 생성
- let source = this.getVectorSourceBbox(option);
+ let source;
+
+ let lyrTyNm = option.lyrTyNm;
+ if(lyrTyNm == 'tb_ms_flood_dngr_map'
+ || lyrTyNm == 'tb_ms_sbmrg_dngr_map'
+ || lyrTyNm == 'tb_ms_swage_mhl'
+ || lyrTyNm == 'tb_ms_swage_ppl'
+ ) {
+ source = this.getVectorSourceBbox(option);
+ }else {
+ source = this.getVectorTileSource(option);
+ }
+
returnLayer.setSource(source);
//스타일 추가
returnLayer.setStyle(this.gisStyle.getLayerStyleFunction(returnLayer, option));
diff --git a/packages/common/business_components/src/ui/search_base_form/index.tsx b/packages/common/business_components/src/ui/search_base_form/index.tsx
index cd26f7742..f99963f14 100644
--- a/packages/common/business_components/src/ui/search_base_form/index.tsx
+++ b/packages/common/business_components/src/ui/search_base_form/index.tsx
@@ -24,6 +24,7 @@ type SearchBaseType = {
rightClassName?: string;
leftClassName?: string;
leftSelectClassName?: string;
+ buttonOrder?: ("query" | "init" | "excel")[];
}
export type ReturnType = {
partValue: string;
@@ -55,7 +56,8 @@ function SearchBaseForm ({
isAdmin=false,
rightClassName,
leftClassName,
- leftSelectClassName
+ leftSelectClassName,
+ buttonOrder
}: SearchBaseType) {
const [partValue, setPartValue] = useState
("A");
const [sidoValue, setSidoValue] = useState("0");
@@ -67,6 +69,30 @@ function SearchBaseForm ({
const [middleRegionValue, setMiddleRegionValue] = useState("0");
const [envPartValue, setEnvPartValue] = useState("0");
const [resetTrigger, setResetTrigger] = useState(false);
+ const renderButton = (type: "query" | "init" | "excel") => {
+ switch (type) {
+ case "query":
+ return (
+
+ );
+ case "init":
+ return (
+
+ );
+ case "excel":
+ return (
+
+ );
+ default:
+ return null;
+ }
+ };
const queryVal = () => {
console.log("조회버튼 클릭");
queryClick({
@@ -145,16 +171,8 @@ function SearchBaseForm ({
{leftChildren}
-
-
-
+ {(buttonOrder ?? ["excel", "init", "query"]).map(renderButton)}
{rightChildren}
diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx
index 4f369dc59..c3f5f8a60 100644
--- a/packages/common/business_components/src/ui/table/index.tsx
+++ b/packages/common/business_components/src/ui/table/index.tsx
@@ -81,6 +81,8 @@ export function UiTable({
const handlePageChange = (page: number) => {
setCur(page);
onPageChange(page);
+ if (index == 0)
+ setIdx(0)
};
const handleCellClick = (index: number, headId: string) => {
@@ -90,6 +92,7 @@ export function UiTable({
}
};
+
return (
<>
{headName ? (
@@ -116,14 +119,13 @@ export function UiTable({
head.id.length > 1 &&
(boldArray.includes(index) ? (
handleCellClick(index, head.id)}
key={`cell-${head.id}-${index}`}
>
@@ -131,39 +133,38 @@ export function UiTable({
? String(el[head.id] ?? "")
: String(el[head.id]).includes(".")
? String(el[head.id])
- .split(".")
- .map((part, index) =>
- index === 0
- ? part.replace(
- /\B(?=(\d{3})+(?!\d))/g,
- ",",
- )
- : part,
- )
- .join(".")
+ .split(".")
+ .map((part, index) =>
+ index === 0
+ ? part.replace(
+ /\B(?=(\d{3})+(?!\d))/g,
+ ",",
+ )
+ : part,
+ )
+ .join(".")
: String(el[head.id] ?? "").replace(
- /\B(?=(\d{3})+(?!\d))/g,
- ",",
- )}
+ /\B(?=(\d{3})+(?!\d))/g,
+ ",",
+ )}
) : (
handleCellClick(index, head.id)}
key={`cell-${head.id}-${index}`}
>
{
//체크박스 유형애서 readOnly가 필요한 경우를 위해서 ChkClass 를 사용해서 readOnly 처리함.
typeof el[head.id] === "object" &&
- el[head.id] !== null &&
- "chk" in (el[head.id] as object) &&
- "readonly" in (el[head.id] as object) ? (
+ el[head.id] !== null &&
+ "chk" in (el[head.id] as object) &&
+ "readonly" in (el[head.id] as object) ? (
index === 0
? part.replace(
- /\B(?=(\d{3})+(?!\d))/g,
- ",",
- )
+ /\B(?=(\d{3})+(?!\d))/g,
+ ",",
+ )
: part,
)
.join(".")