From cceb84aa995d16d5a364aff4e932707956e453a4 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Sun, 10 Aug 2025 20:07:51 +0900 Subject: [PATCH 01/28] =?UTF-8?q?=ED=9B=84=EB=B3=B4=EC=A7=80=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EB=B6=80=EB=B6=84=20=EA=B8=B0=EB=8A=A5=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 1 - .../(popUp-layout)/mapFeaturePopup/page.tsx | 93 ++++++++++++++++++- .../matMng/coMat/coMatRvw/page.tsx | 4 +- apps/wr/app/store/matDmd/coMatRvw/type.tsx | 4 +- .../ui/form/coMat/conCostForm/conCostForm.tsx | 66 +++++++------ 5 files changed, 133 insertions(+), 35 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 7451ae4b5..5722340e5 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -214,7 +214,6 @@ const Map = () => { const isFeature = props?.featureData; - console.log('isFeature 1', isFeature) if( typeof isFeature.getProperties === "function" ){ if ( diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index debea36c9..94c1411f3 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -7,6 +7,95 @@ import { Title, UiTable } from "@common/business_components/ui"; import { useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; + +export const htdflData ={ + "bdstInfoSn": 54, + "ctpvCd": 11, + "sggCd": 11110, + "daddr": "청라동 100-80", + "bdstNm": "한국중부발전(주)", + "frstArchPrmsnDt": "2013-01-01", + "archArea": "-1.000000000", + "ctpvNm": null, + "sggNm": null, + "lat": 37.57096, + "lot": 126.98143, + "regDt": "2025-04-16", + "rgtr": null, + "mdfcnDt": "2025-04-16", + "mdfr": null, + "reuseBuilding": [ + { + "bdstRuseFcltSn": 4881, + "bdstInfoSn": 54, + "instlCmptnDt": "2025-06-20", + "instlCst": 300, + "operMngCd": null, + "anlOperCst": 400, + "instlCstSprtYn": null, + "instlCstSprtAmt": 0, + "grntchBdstCertYn": null, + "grntchBdstCertYr": null, + "grntchBdstCertNo": "", + "grntchBdstCertGrd": "", + "crgRdctYn": null, + "crgRdctBss": null, + "crgRdctAmt": 0, + "ruseFcltFlg": "HTB", + "bdstUsgCd": 2, + "lawTrgtYn": "N", + "regDt": "2025-04-16", + "rgtr": null, + "mdfcnDt": "2025-04-16", + "mdfr": null, + "htdflObj": { + "bdstRuseFcltSn": 4881, + "etgtType": "", + "fclCpct": 400, + "plwtYn": "Y", + "orgwtWtritSpt": "공장내", + "orgwtOcrnProcs": "1", + "wtritEntrcTp": 3, + "amtgnr": 1, + "prcsProcsYn": "Y", + "prcsFcltCpct": 14, + "regDt": "2025-04-16", + "rgtr": null, + "mdfcnDt": "2025-04-16", + "mdfr": null, + "fmYn": "Y", + "utztnCpct": 1, + "utztnUsg": "1", + "grssClfg": 0, + "combResdch": 0, + "trbt": 4, + "bod": 4, + "smll": "불쾌하지않을것", + "crmty": 4, + "tn": 10, + "tph": 10, + "ph": '1~3', + "clIonQnt": 1, + "cdtnv": 0, + "emsnExitTp": 5 + } + } + ], + "chgBuilding": [ + { + "bdstInfoSn": 54, + "archChgPrmsnDt": null, + "archChgArea": null, + "bdstChgNm": null, + "regDt": "2025-04-16", + "rgtr": null, + "mdfcnDt": "2025-04-16", + "mdfr": null + } + ] +} + + export default function MapFeaturePopup() { const [isFeatureCd, setIsFeatureCd] = useState(null); const { @@ -61,7 +150,9 @@ export default function MapFeaturePopup() { }); } else if (layerNm === "온배수시설") { htdfMapDetile(isFeatureCd).then((res) => { - setIsDetail(res); +//가짜데이터로 하였음!!!!!!!!! 기능 수정시 res를 넣어야함 + console.log(res) + setIsDetail(htdflData); }); } else if (layerNm === "잠재수요처") { ldrmntMapDetile(isFeatureCd).then((res) => { diff --git a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx index 996b624d8..b85a04d82 100644 --- a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx +++ b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx @@ -389,9 +389,9 @@ export default function CoMatRvw() { className="w-full pr-16 border py-2 text-right rounded-md" placeholder="" value={ - field.value != -1 + field.value != -1 ||field.value != undefined ? `${field.value}` - : "불검출" + : "불검출" } readOnly /> diff --git a/apps/wr/app/store/matDmd/coMatRvw/type.tsx b/apps/wr/app/store/matDmd/coMatRvw/type.tsx index 58d539538..ec0f0e09c 100644 --- a/apps/wr/app/store/matDmd/coMatRvw/type.tsx +++ b/apps/wr/app/store/matDmd/coMatRvw/type.tsx @@ -79,11 +79,11 @@ export const DmdCoReqSchema = z.object({ grssClfg: z.number().nullish(), combResdch: z.number().nullish(), trbt: z.number().nullish(), - smll: z.number().nullish(), + smll: z.string().nullish(), crmty: z.number().nullish(), tn: z.number().nullish(), tph: z.number().nullish(), - ph: z.number().nullish(), + ph: z.string().nullish(), clIonQnt: z.number().nullish(), cdtnv: z.number().nullish(), rmrk: z.string().nullish(), diff --git a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx index 515121e4e..7f87fe1fd 100644 --- a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx +++ b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx @@ -67,6 +67,7 @@ export default function ConCostForm({ useEffect(() => { // 다른 행을 선택하면(selectionVersion 변경) 체크박스 상태를 초기화합니다. setCheckFinish(false); + setLastSub(null) }, [selectionVersion]); //공급처 팝업 값 셋팅 @@ -173,12 +174,13 @@ export default function ConCostForm({ return; } - const splycd = form.getValues("splyCndtList"); - const pk = - splycd && splycd[0]?.ruseUtztnFcltCd - ? splycd[0]?.ruseUtztnFcltCd - : "11000SW001R1"; + // const pk = + // splycd && splycd[0]?.ruseUtztnFcltCd + // ? splycd[0]?.ruseUtztnFcltCd + // : "11000SW001R1"; + const pk =lastSub?.ruseUtztnFcltCd??null + if (type === "mat") { if (value.demandCst) { const data: DedMatUpdateType = { @@ -190,31 +192,37 @@ export default function ConCostForm({ flg: checkFinish ? "Checked" : "Sub", rgtr: TEST_UUID, }; - if (checkFinish) { - toast((t) => ( - - 검토완료 변경시 공사비는 변경할수 없습니다. -
- 진행하시겠습니까? -
- - -
-
- )); - } else { - coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data); + if(pk !==null){ + + if (checkFinish) { + toast((t) => ( + + 검토완료 변경시 공사비는 변경할수 없습니다. +
+ 진행하시겠습니까? +
+ + +
+
+ )); + } else { + coMatRvwUpdate(pk, form.getValues("dmdInfoId"), data); + } + }else{ + toast.error('후보지를 먼저 선택해주세요') } } } else if (type === "hist") { From be43fd38a7c91dcafdf2a04a8525ffa8f9f987af Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 21:32:21 +0900 Subject: [PATCH 02/28] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=A7=80=EB=8F=84=EB=B3=B4=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 9 +- apps/wr/app/(map-layout)/map/popup/page.tsx | 153 -------- apps/wr/app/layout.tsx | 16 +- apps/wr/app/map/searchBar/SearchInputText.tsx | 122 ------ apps/wr/app/map/searchBar/comboSearchBar.tsx | 298 --------------- apps/wr/app/map/searchBar/procSearchBar.tsx | 298 --------------- apps/wr/app/map/searchBar/searchBar.tsx | 351 ------------------ apps/wr/app/store/store.tsx | 2 +- apps/wr/middleware.ts | 13 +- .../src/ui/map/searchBar/searchBar.tsx | 34 +- 10 files changed, 41 insertions(+), 1255 deletions(-) delete mode 100644 apps/wr/app/(map-layout)/map/popup/page.tsx delete mode 100644 apps/wr/app/map/searchBar/SearchInputText.tsx delete mode 100644 apps/wr/app/map/searchBar/comboSearchBar.tsx delete mode 100644 apps/wr/app/map/searchBar/procSearchBar.tsx delete mode 100644 apps/wr/app/map/searchBar/searchBar.tsx diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 7451ae4b5..4130fff63 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -56,13 +56,11 @@ const Map = () => { const messageHandler = (event: MessageEvent) => { if (event.data.type === "POPUP_CLOSED") { if (event.data.target === "detail") { - console.log("디테일 팝업 닫힘 감지됨"); setFeatureData(null); setIsOpen(false); setIsSearchModalOpen(true); popupDetailRef.current = null; } else { - console.log("기타 팝업 닫힘 감지됨"); popupRef.current = null; } } @@ -74,10 +72,8 @@ const Map = () => { }, []); useEffect(() => { - console.log("isFeatured ", isFeatured); if (isFeatured) { - console.log("isFeatured ", isFeatured); onFeatureSelect(isFeatured); } }, [isFeatured]); @@ -93,7 +89,7 @@ const Map = () => { // SearchModal, GisContent 등에서 호출 const onFeatureFocus = (data: any) => { - console.log(data); + console.log("onFeatureFocus"); }; const onFeatureSelect = (data: any) => { @@ -114,7 +110,6 @@ const Map = () => { let foundFeature: any = null; let featureId = data.fid; const layerName = data.layerNm; - console.log("선택된 레이어 이름:", data, layerName); if (layerName === "하수재이용시설") { // 재이용시설 featureId = `${layerName}.${data.searchPk}`; @@ -134,7 +129,6 @@ const Map = () => { //수요처 featureId = `${layerName}.${data.dmdInfoId.replaceAll("-", "")}`; } else { - console.warn("해당 레이어에 대한 featureId 매핑 없음", layerName); featureId = `${layerName}.${data.fid || data.id || data.ftrIdn}`; } map @@ -214,7 +208,6 @@ const Map = () => { const isFeature = props?.featureData; - console.log('isFeature 1', isFeature) if( typeof isFeature.getProperties === "function" ){ if ( diff --git a/apps/wr/app/(map-layout)/map/popup/page.tsx b/apps/wr/app/(map-layout)/map/popup/page.tsx deleted file mode 100644 index ca7a07b43..000000000 --- a/apps/wr/app/(map-layout)/map/popup/page.tsx +++ /dev/null @@ -1,153 +0,0 @@ -// "use client"; - -// import Gis from "@common/business_components/ui/map/Gis"; -// import { useEffect, useRef, useState, useCallback } from "react"; -// import { mapService } from "../service"; -// import NewWindowPopup from "../components/newWindowPopup"; -// import GisApp from "@common/business_components/ui/map/lib/gis.core"; - -// const Map = () => { -// const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정 -// const gisMaps = useRef(null); -// const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태 -// const [isSearchModalOpen, setIsSearchModalOpen] = useState(true); // SearchModal 열림 상태 -// const [featureData, setFeatureData] = useState(null); // 선택된 피쳐 데이터 -// const [checkedLayers, setCheckedLayers] = useState([]); -// const [checkedLayersData, setCheckedLayersData] = useState([]); - -// const fetchData = async () => { -// try { -// const response = await mapService.getLyrStngs(); -// setTreeData(response); // API 응답 저장 -// } catch (error) { -// console.error("데이터 불러오기 실패:", error); -// } -// }; - -// // 팝업 닫기 핸들러를 useCallback으로 메모이제이션 -// const handlePopupClose = useCallback(() => { -// setIsOpen(false); -// setFeatureData(null); -// }, []); - -// // 컴포넌트 마운트 시 1회 실행 -// useEffect(() => { -// fetchData(); -// }, []); - -// // 체크된 레이어 정보를 받는 핸들러 -// const handleCheckedLayersChange = (checkedIds: string[], checkedNodesData: any[]) => { -// setCheckedLayers(checkedIds); -// setCheckedLayersData(checkedNodesData); -// }; - -// // SearchModal, GisContent 등에서 호출 -// const onFeatureSelect = (data: any) => { -// const map = gisMaps.current; -// if (!map) { -// console.warn("지도가 초기화되지 않았습니다."); -// return; -// } - -// // 항상 같은 select 객체 사용 -// const select = GisApp.Module.select as any; -// if (!select) return; - -// // 1. 기존 선택 초기화 -// select.resetSelectedFeature(); - -// // 2. data가 OpenLayers Feature 인스턴스인지 확인 -// let foundFeature: any = null; -// if ( -// data && -// typeof data.getGeometry === "function" && -// typeof data.setStyle === "function" -// ) { -// // 이미 Feature 인스턴스라면 그대로 사용 -// foundFeature = data; -// } else { -// // 아니면 featureId로 맵에서 Feature 인스턴스를 찾아서 사용 -// const featureId = data.fid || data.ftrIdn || data.id; -// map -// .getLayers() -// .getArray() -// .forEach((layer: any) => { -// const source = layer.getSource?.(); -// if (source?.getFeatureById) { -// const feature = source.getFeatureById(String(featureId).trim()); -// if (feature) foundFeature = feature; -// } -// }); -// } - -// // 3. 피처 선택 -// if (foundFeature) { -// const geometry = foundFeature.getGeometry(); -// if (geometry) { -// const extent = geometry.getExtent(); - -// map.getView().fit(extent, { -// duration: 300, -// padding: [50, 50, 50, 50], -// maxZoom: 16, -// constrainResolution: true, -// nearest: true, -// }); -// } -// select.selectFeature(foundFeature, true); -// } else { -// console.warn("OpenLayers Feature를 찾을 수 없습니다:", data); -// } - -// setFeatureData(data); -// setIsOpen(true); -// setIsSearchModalOpen(false); -// }; - -// // MapSearchBar 래퍼 컴포넌트 -// // const CustomMapSearchBar = (props: any) => { -// // return ( -// // -// // ); -// // }; - -// return ( -//
-// -// // -// { - -// console.log('p' ,props) -// } -// } -// onFeatureSelect={onFeatureSelect} -// setIsOpen={setIsOpen} -// setFeatureData={setFeatureData} -// featureData={featureData} -// setIsSearchModalOpen={setIsSearchModalOpen} -// isOpen={isOpen} -// isSearchModalOpen={isSearchModalOpen} -// onCheckedLayersChange={handleCheckedLayersChange} -// imgVisble={true} -// searchBar={undefined} -// /> -//
-// ); -// }; - -// export default Map; diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx index fe4c3aff0..953c1d7ab 100644 --- a/apps/wr/app/layout.tsx +++ b/apps/wr/app/layout.tsx @@ -4,6 +4,8 @@ import i18next from "i18next"; import { I18nextProvider } from "react-i18next"; import koBase from "../public/locales/ko/message.json"; import { StoreProvider } from "./store"; +import { LoginApi } from "@/src/entities/auth"; +import { useEffect, useMemo } from "react"; export default function RootLayout({ children, @@ -20,13 +22,21 @@ export default function RootLayout({ }, }); + useEffect(() => { + // 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치 + void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }) + .catch((e) => { + console.error("Auto login failed:", e); + }); + }, []); + return ( - - {children} - + + {children} + diff --git a/apps/wr/app/map/searchBar/SearchInputText.tsx b/apps/wr/app/map/searchBar/SearchInputText.tsx deleted file mode 100644 index 97ba51fb7..000000000 --- a/apps/wr/app/map/searchBar/SearchInputText.tsx +++ /dev/null @@ -1,122 +0,0 @@ -// SearchInputText.tsx -"use client"; -import { Input } from "@common/components/ui"; -import { useEffect, useRef, useState } from "react"; - -interface SearchInputTextProps { - initValue?: string; - setValue: (val: string) => void; - setRtnData: (val: { fnm: string; fid: string }) => void; - searchList: { fnm: string; fid: string }[]; - onEnter?: () => void; - className?: string; -} - -export default function SearchInputText({ - initValue, - setValue, - setRtnData, - searchList, - onEnter, - className, -}: SearchInputTextProps) { - const [showResults, setShowResults] = useState(false); - const [text, setText] = useState(initValue ?? ""); - const [highlightIndex, setHighlightIndex] = useState(-1); - const wrapperRef = useRef(null); - - useEffect(() => { - setText(initValue ?? ""); - }, [initValue]); - - useEffect(() => { - if (searchList.length > 0) { - setShowResults(true); - } else { - setShowResults(false); - } - setHighlightIndex(-1); - }, [searchList]); - - useEffect(() => { - function handleClickOutside(event: MouseEvent) { - if ( - wrapperRef.current && - !(wrapperRef.current as any).contains(event.target) - ) { - setShowResults(false); - } - } - document.addEventListener("mousedown", handleClickOutside); - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, [wrapperRef]); - - const handleChange = (e: React.ChangeEvent) => { - setText(e.target.value); - setValue(e.target.value); - setHighlightIndex(-1); - }; - - const handleSelect = (item: { fnm: string; fid: string }) => { - setText(item.fnm); - setValue(item.fnm); - setRtnData(item); - setShowResults(false); - }; - - const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Enter") { - if (highlightIndex >= 0 && highlightIndex < searchList.length) { - const selected = searchList[highlightIndex]; - if (selected) handleSelect(selected); - } else if (onEnter) { - onEnter(); - } - } else if (e.key === "ArrowDown") { - e.preventDefault(); - setHighlightIndex((prev) => - prev < searchList.length - 1 ? prev + 1 : prev - ); - } else if (e.key === "ArrowUp") { - e.preventDefault(); - setHighlightIndex((prev) => (prev > 0 ? prev - 1 : -1)); - } - }; - - return ( -
- - {showResults && ( -
- {searchList.length > 0 ? ( - searchList.map((item, index) => ( -
handleSelect(item)} - > - {item.fnm} -
- )) - ) : ( -
- 검색 결과가 없습니다. -
- )} -
- )} -
- ); -} diff --git a/apps/wr/app/map/searchBar/comboSearchBar.tsx b/apps/wr/app/map/searchBar/comboSearchBar.tsx deleted file mode 100644 index 15736d710..000000000 --- a/apps/wr/app/map/searchBar/comboSearchBar.tsx +++ /dev/null @@ -1,298 +0,0 @@ -"use client"; -import { SelectBox, type SelectDataType } from "@common/business_components/ui"; -import { Button } from "@common/components/ui"; -import { useCallback, useEffect, useState } from "react"; - -const geoserverUrl = - "/geoserver/hasudo/ows?service=WFS&version=1.0.0&request=GetFeature&outputFormat=application/json"; - -const FACILITY_TYPE_URL_MAP: Record = { - tb_il_swage_prcs_fclt: geoserverUrl, //하수처리시설 - tb_wr_bdst_ruse_fclt: - "/reuse-service/reuseFc/pubDetailList/{year}/{sggCd}/1/1000", //재이용시설 post - tb_wr_rnwtr_utztn_fclt: "/reuse-service/reuseFc/rainyInfoList/1/1000/{sggCd}", //빗물이용시설 get - tb_wr_rswtr_fclt: "/reuse-service/reuseFc/waterreuseFc/1/1000/{sggCd}", //중수도시설 get - tb_wr_htdfl_fclt: "/reuse-service/drain/facilityList/1/1000/{sggCd}", //온배수시설 get - tb_wr_ruse_fclt_dmd_co: "/reuse-service/reuseFc/request/1/1000/{sggCd}", //수요처 get - tb_wr_tmpr_dmd_co: - "/reuse-service/reuseFc/request/temp/1/1000/{sidoNm} {sggNm}", //잠재수요처 get -}; - -interface SearchBarProps { - onFeatureSelect: (feature: any) => void; - gisMaps: React.RefObject; - facilityTypes: { text: string; val: string }[]; -} - -export function SearchBar({ - onFeatureSelect, - gisMaps, - facilityTypes, -}: SearchBarProps) { - const [sidoValue, setSidoValue] = useState("0"); - const [sigunValue, setSigunValue] = useState("0"); - const [sidoData, setSidoData] = useState([ - { text: "선택", val: "0" }, - ]); - const [sigunData, setSigunData] = useState([ - { text: "선택", val: "0" }, - ]); - const [filteredSigunData, setFilteredSigunData] = useState([ - { text: "선택", val: "0" }, - ]); - - const [facilityData, setFacilityData] = useState([ - { text: "선택", val: "0" }, - ]); - const [facilityValue, setFacilityValue] = useState("0"); - - const [facilityType, setFacilityType] = useState( - facilityTypes?.length === 1 && facilityTypes[0] ? facilityTypes[0].val : "0" - ); - - //시도, 시군구 조회 - const fetchSido = async () => { - const url = `/cms-service/api/v1/code/cache/ADSTDSTRCD/Y`; - const res = await fetch(url); - const json = await res.json(); - const sidoList = json - .filter( - (item: any) => - typeof item.lwpoCd === "string" && item.lwpoCd.length === 2 - ) - .map((feature: any) => ({ - val: feature.lwpoCd, - text: feature.lwpoCdNm, - })); - setSidoData([{ text: "선택", val: "0" }, ...sidoList]); - - const sigunList = json - .filter( - (item: any) => - typeof item.lwpoCd === "string" && item.lwpoCd.length !== 2 - ) - .map((feature: any) => ({ - val: feature.lwpoCd, - text: feature.lwpoCdNm, - })); - setSigunData(sigunList); - }; - - //시설명 콤보박스 조회 - const fetchFacilitiesBySggNm = async ( - sggCd: string, - sggNm: string, - sidoNm: string, - currentFacilityType?: string - ) => { - const type = currentFacilityType ?? facilityType; - if (!type || type === "0") return; - - const baseUrlTemplate = FACILITY_TYPE_URL_MAP[type]; - if (!baseUrlTemplate) return; - - const year = new Date().getFullYear().toString(); - let url = baseUrlTemplate - .replace("{year}", year) - .replace("{sggCd}", sggCd) - .replace("{sidoNm}", encodeURIComponent(sidoNm)) - .replace("{sggNm}", encodeURIComponent(sggNm)); - - let list: SelectDataType[] = []; - - if ( - type === "tb_il_swage_prcs_fclt" //하수처리시설 - ) { - const cqlFilter = `ctpv_nm='${encodeURIComponent(sidoNm)}' AND sgg_nm='${encodeURIComponent(sggNm)}'`; - url = `${url}&typeName=hasudo:${type}&cql_filter=${cqlFilter}`; - const res = await fetch(url); - const json = await res.json(); - list = json.features.map((f: any) => ({ - text: f.properties.swtrmt_fclt_nm ?? "(이름없음)", - val: f.id, - })); - } else if ( - type === "tb_wr_bdst_ruse_fclt" // 재이용시설 - ) { - //재용에서 참조하는 하수처리시설 목록 - const paramsRes = await fetch("/reuse-service/reuseFc/pubFc"); - const paramsJson = await paramsRes.json(); - const params = paramsJson.data; - - const res = await fetch(url, { - method: "POST", - headers: { - accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.ruseUtztnFcltNm ?? "(이름없음)", - val: item.pbnstRuseFcltId, - })); - } else if ( - type === "tb_wr_ruse_fclt_dmd_co" //수요처 - ) { - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.dmdInfoId, - })); - } else if ( - type === "tb_wr_tmpr_dmd_co" //잠재수요처 - ) { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.fctryMngSn, - })); - } else { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.bdstNm ?? "(이름없음)", - val: item.bdstInfoSn, - })); - } - - setFacilityData([{ text: "선택", val: "0" }, ...list]); - setFacilityValue("0"); - }; - - //시도, 시군구 초기 데이터 조회 - useEffect(() => { - fetchSido(); - }, []); - - //시군구 데이터 초기화 - const initializeSigunData = useCallback( - (sidoCd: string) => { - if (sidoCd === "0") { - setFilteredSigunData([{ text: "선택", val: "0" }]); - setSigunValue("0"); - return; - } - const prefix = sidoCd.substring(0, 2); - const filtered = sigunData.filter((item) => item.val.startsWith(prefix)); - setFilteredSigunData([{ text: "선택", val: "0" }, ...filtered]); - setSigunValue("0"); - }, - [sigunData] - ); - - //콤보박스 선택시 연관 콤보박스 처리 - const onSelectValue = useCallback( - (val: string, type: string) => { - if (type === "ctpvCd") { - setSidoValue(val); - initializeSigunData(val); - setFacilityData([{ text: "선택", val: "0" }]); - setFacilityValue("0"); - } else if (type === "sggCd") { - setSigunValue(val); - const sidoNm = - sidoData.find((item) => item.val === sidoValue)?.text || ""; - const sggNm = sigunData.find((item) => item.val === val)?.text || ""; - const sggCd = sigunData.find((item) => item.val === val)?.val || ""; - if (sggNm && sidoNm) - fetchFacilitiesBySggNm(sggCd, sggNm, sidoNm, facilityType); - } else if (type === "facilityType") { - setFacilityType(val); - setFacilityValue("0"); - setFacilityData([{ text: "선택", val: "0" }]); - const sidoNm = - sidoData.find((item) => item.val === sidoValue)?.text || ""; - const sggNm = - sigunData.find((item) => item.val === sigunValue)?.text || ""; - const sggCd = - sigunData.find((item) => item.val === sigunValue)?.val || ""; - if (sggNm && sidoNm) fetchFacilitiesBySggNm(sggCd, sggNm, sidoNm, val); - } else if (type === "fcltCd") { - setFacilityValue(val); - } - }, - [initializeSigunData, sigunData, sigunValue, sidoData, sidoValue] - ); - - //조회 버튼 클릭 - const handleSearch = () => { - if (!gisMaps.current || facilityValue === "0") return; - const layers = gisMaps.current.getLayers().getArray(); - for (const layer of layers) { - const source = layer.getSource?.(); - const feature = source?.getFeatureById?.(facilityValue); - if (feature) { - onFeatureSelect(feature); - return; - } - } - alert("해당 처리시설을 지도에서 찾을 수 없습니다."); - }; - - return ( -
-
-
-
- {facilityTypes.length > 1 && ( - - onSelectValue(val.toString(), "facilityType") - } - value={facilityType} - /> - )} - onSelectValue(val.toString(), "ctpvCd")} - value={sidoValue} - /> - onSelectValue(val.toString(), "sggCd")} - value={sigunValue} - /> - onSelectValue(val.toString(), "fcltCd")} - value={facilityValue} - /> -
-
- -
-
-
-
- ); -} diff --git a/apps/wr/app/map/searchBar/procSearchBar.tsx b/apps/wr/app/map/searchBar/procSearchBar.tsx deleted file mode 100644 index 15736d710..000000000 --- a/apps/wr/app/map/searchBar/procSearchBar.tsx +++ /dev/null @@ -1,298 +0,0 @@ -"use client"; -import { SelectBox, type SelectDataType } from "@common/business_components/ui"; -import { Button } from "@common/components/ui"; -import { useCallback, useEffect, useState } from "react"; - -const geoserverUrl = - "/geoserver/hasudo/ows?service=WFS&version=1.0.0&request=GetFeature&outputFormat=application/json"; - -const FACILITY_TYPE_URL_MAP: Record = { - tb_il_swage_prcs_fclt: geoserverUrl, //하수처리시설 - tb_wr_bdst_ruse_fclt: - "/reuse-service/reuseFc/pubDetailList/{year}/{sggCd}/1/1000", //재이용시설 post - tb_wr_rnwtr_utztn_fclt: "/reuse-service/reuseFc/rainyInfoList/1/1000/{sggCd}", //빗물이용시설 get - tb_wr_rswtr_fclt: "/reuse-service/reuseFc/waterreuseFc/1/1000/{sggCd}", //중수도시설 get - tb_wr_htdfl_fclt: "/reuse-service/drain/facilityList/1/1000/{sggCd}", //온배수시설 get - tb_wr_ruse_fclt_dmd_co: "/reuse-service/reuseFc/request/1/1000/{sggCd}", //수요처 get - tb_wr_tmpr_dmd_co: - "/reuse-service/reuseFc/request/temp/1/1000/{sidoNm} {sggNm}", //잠재수요처 get -}; - -interface SearchBarProps { - onFeatureSelect: (feature: any) => void; - gisMaps: React.RefObject; - facilityTypes: { text: string; val: string }[]; -} - -export function SearchBar({ - onFeatureSelect, - gisMaps, - facilityTypes, -}: SearchBarProps) { - const [sidoValue, setSidoValue] = useState("0"); - const [sigunValue, setSigunValue] = useState("0"); - const [sidoData, setSidoData] = useState([ - { text: "선택", val: "0" }, - ]); - const [sigunData, setSigunData] = useState([ - { text: "선택", val: "0" }, - ]); - const [filteredSigunData, setFilteredSigunData] = useState([ - { text: "선택", val: "0" }, - ]); - - const [facilityData, setFacilityData] = useState([ - { text: "선택", val: "0" }, - ]); - const [facilityValue, setFacilityValue] = useState("0"); - - const [facilityType, setFacilityType] = useState( - facilityTypes?.length === 1 && facilityTypes[0] ? facilityTypes[0].val : "0" - ); - - //시도, 시군구 조회 - const fetchSido = async () => { - const url = `/cms-service/api/v1/code/cache/ADSTDSTRCD/Y`; - const res = await fetch(url); - const json = await res.json(); - const sidoList = json - .filter( - (item: any) => - typeof item.lwpoCd === "string" && item.lwpoCd.length === 2 - ) - .map((feature: any) => ({ - val: feature.lwpoCd, - text: feature.lwpoCdNm, - })); - setSidoData([{ text: "선택", val: "0" }, ...sidoList]); - - const sigunList = json - .filter( - (item: any) => - typeof item.lwpoCd === "string" && item.lwpoCd.length !== 2 - ) - .map((feature: any) => ({ - val: feature.lwpoCd, - text: feature.lwpoCdNm, - })); - setSigunData(sigunList); - }; - - //시설명 콤보박스 조회 - const fetchFacilitiesBySggNm = async ( - sggCd: string, - sggNm: string, - sidoNm: string, - currentFacilityType?: string - ) => { - const type = currentFacilityType ?? facilityType; - if (!type || type === "0") return; - - const baseUrlTemplate = FACILITY_TYPE_URL_MAP[type]; - if (!baseUrlTemplate) return; - - const year = new Date().getFullYear().toString(); - let url = baseUrlTemplate - .replace("{year}", year) - .replace("{sggCd}", sggCd) - .replace("{sidoNm}", encodeURIComponent(sidoNm)) - .replace("{sggNm}", encodeURIComponent(sggNm)); - - let list: SelectDataType[] = []; - - if ( - type === "tb_il_swage_prcs_fclt" //하수처리시설 - ) { - const cqlFilter = `ctpv_nm='${encodeURIComponent(sidoNm)}' AND sgg_nm='${encodeURIComponent(sggNm)}'`; - url = `${url}&typeName=hasudo:${type}&cql_filter=${cqlFilter}`; - const res = await fetch(url); - const json = await res.json(); - list = json.features.map((f: any) => ({ - text: f.properties.swtrmt_fclt_nm ?? "(이름없음)", - val: f.id, - })); - } else if ( - type === "tb_wr_bdst_ruse_fclt" // 재이용시설 - ) { - //재용에서 참조하는 하수처리시설 목록 - const paramsRes = await fetch("/reuse-service/reuseFc/pubFc"); - const paramsJson = await paramsRes.json(); - const params = paramsJson.data; - - const res = await fetch(url, { - method: "POST", - headers: { - accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.ruseUtztnFcltNm ?? "(이름없음)", - val: item.pbnstRuseFcltId, - })); - } else if ( - type === "tb_wr_ruse_fclt_dmd_co" //수요처 - ) { - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.dmdInfoId, - })); - } else if ( - type === "tb_wr_tmpr_dmd_co" //잠재수요처 - ) { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.fctryMngSn, - })); - } else { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.bdstNm ?? "(이름없음)", - val: item.bdstInfoSn, - })); - } - - setFacilityData([{ text: "선택", val: "0" }, ...list]); - setFacilityValue("0"); - }; - - //시도, 시군구 초기 데이터 조회 - useEffect(() => { - fetchSido(); - }, []); - - //시군구 데이터 초기화 - const initializeSigunData = useCallback( - (sidoCd: string) => { - if (sidoCd === "0") { - setFilteredSigunData([{ text: "선택", val: "0" }]); - setSigunValue("0"); - return; - } - const prefix = sidoCd.substring(0, 2); - const filtered = sigunData.filter((item) => item.val.startsWith(prefix)); - setFilteredSigunData([{ text: "선택", val: "0" }, ...filtered]); - setSigunValue("0"); - }, - [sigunData] - ); - - //콤보박스 선택시 연관 콤보박스 처리 - const onSelectValue = useCallback( - (val: string, type: string) => { - if (type === "ctpvCd") { - setSidoValue(val); - initializeSigunData(val); - setFacilityData([{ text: "선택", val: "0" }]); - setFacilityValue("0"); - } else if (type === "sggCd") { - setSigunValue(val); - const sidoNm = - sidoData.find((item) => item.val === sidoValue)?.text || ""; - const sggNm = sigunData.find((item) => item.val === val)?.text || ""; - const sggCd = sigunData.find((item) => item.val === val)?.val || ""; - if (sggNm && sidoNm) - fetchFacilitiesBySggNm(sggCd, sggNm, sidoNm, facilityType); - } else if (type === "facilityType") { - setFacilityType(val); - setFacilityValue("0"); - setFacilityData([{ text: "선택", val: "0" }]); - const sidoNm = - sidoData.find((item) => item.val === sidoValue)?.text || ""; - const sggNm = - sigunData.find((item) => item.val === sigunValue)?.text || ""; - const sggCd = - sigunData.find((item) => item.val === sigunValue)?.val || ""; - if (sggNm && sidoNm) fetchFacilitiesBySggNm(sggCd, sggNm, sidoNm, val); - } else if (type === "fcltCd") { - setFacilityValue(val); - } - }, - [initializeSigunData, sigunData, sigunValue, sidoData, sidoValue] - ); - - //조회 버튼 클릭 - const handleSearch = () => { - if (!gisMaps.current || facilityValue === "0") return; - const layers = gisMaps.current.getLayers().getArray(); - for (const layer of layers) { - const source = layer.getSource?.(); - const feature = source?.getFeatureById?.(facilityValue); - if (feature) { - onFeatureSelect(feature); - return; - } - } - alert("해당 처리시설을 지도에서 찾을 수 없습니다."); - }; - - return ( -
-
-
-
- {facilityTypes.length > 1 && ( - - onSelectValue(val.toString(), "facilityType") - } - value={facilityType} - /> - )} - onSelectValue(val.toString(), "ctpvCd")} - value={sidoValue} - /> - onSelectValue(val.toString(), "sggCd")} - value={sigunValue} - /> - onSelectValue(val.toString(), "fcltCd")} - value={facilityValue} - /> -
-
- -
-
-
-
- ); -} diff --git a/apps/wr/app/map/searchBar/searchBar.tsx b/apps/wr/app/map/searchBar/searchBar.tsx deleted file mode 100644 index ab3dacb0e..000000000 --- a/apps/wr/app/map/searchBar/searchBar.tsx +++ /dev/null @@ -1,351 +0,0 @@ -"use client"; -import { SelectBox, type SelectDataType } from "@common/business_components/ui"; -import { Button } from "@common/components/ui"; -import { useCallback, useEffect, useState } from "react"; -import SearchInputText from "./SearchInputText"; - -const FACILITY_TYPE_URL_MAP: Record = { - tb_il_swage_prcs_fclt: - "/geoserver/hasudo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=hasudo:tb_il_swage_prcs_fclt&outputFormat=application/json&propertyName=swtrmt_fclt_cd,swtrmt_fclt_nm&cql_filter=", - tb_wr_bdst_ruse_fclt: - "/reuse-service/reuseFc/pubDetailList/{year}/{sggCd}/1/1000/", - tb_wr_rnwtr_utztn_fclt: - "/reuse-service/reuseFc/rainyInfoList/1/1000/{sggCd}/{fcltyNm}", - tb_wr_rswtr_fclt: - "/reuse-service/reuseFc/waterreuseFc/1/1000/{sggCd}/{fcltyNm}", - tb_wr_htdfl_fclt: - "/reuse-service/drain/facilityList/1/1000/{sggCd}/{fcltyNm}", - tb_wr_ruse_fclt_dmd_co: - "/reuse-service/reuseFc/request/1/1000/{sggCd}/{fcltyNm}", - tb_wr_tmpr_dmd_co: - "/reuse-service/reuseFc/request/temp/1/1000/{sidoNm} {sggNm}/{fcltyNm}", -}; - -interface SearchBarProps { - gisMaps: React.RefObject; - facilityTypes: { text: string; val: string }[]; - onFeatureFocus: any; -} - -export function SearchBar({ - gisMaps, - facilityTypes, - onFeatureFocus, -}: SearchBarProps) { - console.log('gisMaps ', gisMaps) - console.log('onFeatureFocus ', onFeatureFocus) - - const [sidoValue, setSidoValue] = useState("0"); - const [sigunValue, setSigunValue] = useState("0"); - const [facilityType, setFacilityType] = useState( - facilityTypes?.length === 1 && facilityTypes[0] ? facilityTypes[0].val : "0" - ); - const [fcltyNm, setFcltyNm] = useState(""); - const [searchList, setSearchList] = useState<{ fnm: string; fid: string }[]>( - [] - ); - - const [sidoData, setSidoData] = useState([ - { text: "시도", val: "0" }, - ]); - const [sigunData, setSigunData] = useState([ - { text: "시군구", val: "0" }, - ]); - const [filteredSigunData, setFilteredSigunData] = useState([ - { text: "시군구", val: "0" }, - ]); - - const fetchSido = async () => { - const res = await fetch("/cms-service/api/v1/code/cache/ADSTDSTRCD/Y"); - const json = await res.json(); - const sidoList = json - .filter((item: any) => item.lwpoCd?.length === 2) - .map((item: any) => ({ val: item.lwpoCd, text: item.lwpoCdNm })); - const sigunList = json - .filter((item: any) => item.lwpoCd?.length > 2) - .map((item: any) => ({ val: item.lwpoCd, text: item.lwpoCdNm })); - setSidoData([{ text: "시도", val: "0" }, ...sidoList]); - setSigunData(sigunList); - }; - - const initializeSigunData = useCallback( - (sidoCd: string) => { - if (sidoCd === "0") { - setFilteredSigunData([{ text: "시도", val: "0" }]); - setSigunValue("0"); - return; - } - const prefix = sidoCd.substring(0, 2); - const filtered = sigunData.filter((item) => item.val.startsWith(prefix)); - setFilteredSigunData([{ text: "시군구", val: "0" }, ...filtered]); - setSigunValue("0"); - }, - [sigunData] - ); - - useEffect(() => { - fetchSido(); - }, []); - - const onSelectValue = useCallback( - (val: string, type: string) => { - if (type === "ctpvCd") { - setSidoValue(val); - initializeSigunData(val); - setSearchList([]); - setFcltyNm(""); - } else if (type === "sggCd") { - setSigunValue(val); - setSearchList([]); - setFcltyNm(""); - } else if (type === "facilityType") { - setFacilityType(val); - setSearchList([]); - setFcltyNm(""); - } - }, - [initializeSigunData] - ); - - const handleSearch = async () => { - if (!fcltyNm) return alert("시설명을 입력하세요."); - - const sidoNm = sidoData.find((item) => item.val === sidoValue)?.text || ""; - const sggNm = sigunData.find((item) => item.val === sigunValue)?.text || ""; - - const type = facilityType; - const baseUrlTemplate = FACILITY_TYPE_URL_MAP[type]; - if (!baseUrlTemplate) return; - - let url = baseUrlTemplate; - const year = new Date().getFullYear().toString(); - url = url - .replace("{year}", year) - .replace("{sggCd}", sigunValue) - .replace("{sidoNm}", encodeURIComponent(sidoNm)) - .replace("{sggNm}", encodeURIComponent(sggNm)) - .replace("{fcltyNm}", encodeURIComponent(fcltyNm)); - - let list: SelectDataType[] = []; - - if (type === "tb_il_swage_prcs_fclt") { - const cqlFilter = `ctpv_nm='${sidoNm}' and sgg_nm='${sggNm}' and swtrmt_fclt_nm like '%${fcltyNm}%'`; - url += encodeURIComponent(cqlFilter); - const res = await fetch(url); - const json = await res.json(); - list = json.features.map((f: any) => ({ - text: f.properties.swtrmt_fclt_nm ?? "(이름없음)", - val: f.id, - })); - } else if ( - type === "tb_wr_bdst_ruse_fclt" // 재이용시설 - ) { - //재이용에서 참조하는 하수처리시설 목록 - const procRes = await fetch("/reuse-service/reuseFc/pubFc"); - const procJson = await procRes.json(); - const procData = procJson.data; - const procResult = procData - .filter((code: string) => code.slice(0, 5) === sigunValue) - .map((code: string) => { - return code; - }); - - //처리시설명으로 처리시설코드 조회 - let procUrl2 = - "/operation-service/prcsFclt/ruseInfo/1/1000/A/{sggCd}/0/1/SW/{fcltyNm}"; - procUrl2 = procUrl2 - .replace("{sggCd}", sigunValue) - .replace("{fcltyNm}", encodeURIComponent(fcltyNm)); - const procRes2 = await fetch(procUrl2, { - method: "POST", - headers: { - accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(procResult), - }); - const procJson2 = await procRes2.json(); - const procResult2 = (procJson2.data || []).map((item: any) => item.fid); - - //최종 처리시설코드로 재이용시설조회 - const res = await fetch(url, { - method: "POST", - headers: { - accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(procResult2), - }); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.ruseUtztnFcltNm ?? "(이름없음)", - val: item.pbnstRuseFcltId, - })); - } else if ( - type === "tb_wr_ruse_fclt_dmd_co" //수요처 - ) { - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.dmdInfoId, - })); - } else if ( - type === "tb_wr_tmpr_dmd_co" //잠재수요처 - ) { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.dmdCoNm ?? "(이름없음)", - val: item.fctryMngSn, - })); - } else { - // GET 방식 - const res = await fetch(url); - const json = await res.json(); - list = (json.data || []).map((item: any) => ({ - text: item.bdstNm ?? "(이름없음)", - val: item.bdstInfoSn, - })); - } - - if (list.length === 0) { - alert("검색 결과가 없습니다."); - setSearchList([]); - setFcltyNm(""); - return; - } - - const newList = list.map((item: any) => { - const code = item.val; - const name = item.text; - return { fnm: name, fid: code }; - }); - setSearchList(newList); - }; - - const moveFocus = (feature: any) => { - console.log('feature ' ,feature) - - // console.log('searchbar:moveFocus') - // const map = gisMaps.current; - // if (!map) { - // console.warn("지도가 초기화되지 않았습니다."); - // return; - // } - - // // 항상 같은 select 객체 사용 - // const select = GisApp.Module.select as any; - // if (!select) return; - - // // 1. 기존 선택 초기화 - // select.resetSelectedFeature(); - - // // 2. data가 OpenLayers Feature 인스턴스인지 확인 - // let foundFeature: any = null; - // let featureId = data.fid; - // const layerName = data.layerNm; - // map - // .getLayers() - // .getArray() - // .forEach((layer: any) => { - // const source = layer.getSource?.(); - // if (source?.getFeatureById) { - // const feature = source.getFeatureById(String(featureId).trim()); - // if (feature) foundFeature = feature; - // } - // }); - - // // 3. 피처 선택 - // if (foundFeature) { - // const geometry = foundFeature.getGeometry(); - // if (geometry) { - // const extent = geometry.getExtent(); - - // map.getView().fit(extent, { - // duration: 300, - // padding: [50, 50, 50, 50], - // maxZoom: 16, - // constrainResolution: true, - // nearest: true, - // }); - // } - // // select.selectFeature(foundFeature, true); - // } else { - // console.warn("OpenLayers Feature를 찾을 수 없습니다:", data); - // } - }; - - return ( -
-
-
-
- {facilityTypes.length > 1 && ( - - onSelectValue(val.toString(), "facilityType") - } - value={facilityType} - /> - )} - onSelectValue(val.toString(), "ctpvCd")} - value={sidoValue} - /> - onSelectValue(val.toString(), "sggCd")} - value={sigunValue} - /> - { - setFcltyNm(val); - }} - setRtnData={(selected: { fnm: string; fid: string }) => { - // 선택된 항목이 있을 경우 onFeatureSelect 실행 - const type = facilityType; - moveFocus({ - layerNm: type, - ...selected, - }); - }} - searchList={searchList} - onEnter={handleSearch} - className="mr-5 w-[150px]" - /> -
-
- -
-
-
-
- ); -} diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index c7dcf1ca8..bbff85bcb 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -342,7 +342,7 @@ export const StoreZus = ( getMiddleRegionCd(set); getUnitWaterShedCd(set); getEnvPartCd(set); - LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }); + // LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }); return { ...initState, ...comFcltSearchAction(set), diff --git a/apps/wr/middleware.ts b/apps/wr/middleware.ts index c5c7f8c01..e47a2a8f5 100644 --- a/apps/wr/middleware.ts +++ b/apps/wr/middleware.ts @@ -16,15 +16,6 @@ export function middleware(req: NextRequest) { console.log(`[Middleware] Request URL: ${req.url}`); const searchParams = req.nextUrl.searchParams; - // if (pathname.startsWith("/server")) { - // const queryParams = searchParams.toString(); - // const newUrl = `${serverApiUrl}${pathname.replace("/server", "")}${ - // queryParams ? `?${queryParams}` : "" - // }`; - // console.log(`[Middleware] Rewriting from '/server' path to: ${newUrl}`); - // return NextResponse.rewrite(new URL(newUrl)); - // } - if (pathname.startsWith("/server")) { const decodedParams = Array.from(searchParams.entries()) .map(([key, value]) => `${key}=${decodeURIComponent(value)}`) @@ -46,7 +37,6 @@ export function middleware(req: NextRequest) { const Authorization = req.cookies.get(CLAIM_NAME)?.value; const newUrl = `${serverApiUrl}${pathname}`; - console.log("Authorization cms-service ", Authorization); if (Authorization) requestHeaders.set(CLAIM_NAME, Authorization); //if (userId) requestHeaders.set(AUTH_USER_ID, userId); @@ -90,7 +80,6 @@ export function middleware(req: NextRequest) { if (pathname.startsWith("/geoserver")) { let queryParams = searchParams.toString(); const typename = searchParams.get("TYPENAME"); - console.log("typename ", typename); const startYmd = searchParams.get("START_YMD") ?? null; const endYmd = searchParams.get("END_YMD") ?? null; @@ -129,7 +118,7 @@ export function middleware(req: NextRequest) { newUrl = `${SEWERAGE_API_URL}/v1/map/geometry${queryParams ? `?${queryParams}` : ""}`; } - console.log(`[Middleware] Rewriting from '/geoserver' path to: ${newUrl}`); + //console.log(`[Middleware] Rewriting from '/geoserver' path to: ${newUrl}`); return NextResponse.rewrite(new URL(newUrl)); } diff --git a/packages/common/business_components/src/ui/map/searchBar/searchBar.tsx b/packages/common/business_components/src/ui/map/searchBar/searchBar.tsx index e750ab1a7..3f5fc1820 100644 --- a/packages/common/business_components/src/ui/map/searchBar/searchBar.tsx +++ b/packages/common/business_components/src/ui/map/searchBar/searchBar.tsx @@ -69,7 +69,7 @@ export const SearchBar = ({ const initializeSigunData = useCallback( (sidoCd: string) => { if (sidoCd === "0") { - setFilteredSigunData([{ text: "시도", val: "0" }]); + setFilteredSigunData([{ text: "시군구", val: "0" }]); setSigunValue("0"); return; } @@ -110,7 +110,6 @@ export const SearchBar = ({ const sidoNm = sidoData.find((item) => item.val === sidoValue)?.text || ""; const sggNm = sigunData.find((item) => item.val === sigunValue)?.text || ""; - const type = facilityType; const baseUrlTemplate = FACILITY_TYPE_URL_MAP[type]; if (!baseUrlTemplate) return; @@ -149,8 +148,7 @@ export const SearchBar = ({ }); //처리시설명으로 처리시설코드 조회 - let procUrl2 = - "/operation-service/prcsFclt/ruseInfo/1/1000/A/{sggCd}/0/1/SW/{fcltyNm}"; + let procUrl2 = "/operation-service/prcsFclt/ruseInfo/1/1000/A/{sggCd}/0/1/SW/{fcltyNm}"; procUrl2 = procUrl2 .replace("{sggCd}", sigunValue) .replace("{fcltyNm}", encodeURIComponent(fcltyNm)); @@ -163,7 +161,7 @@ export const SearchBar = ({ body: JSON.stringify(procResult), }); const procJson2 = await procRes2.json(); - const procResult2 = (procJson2.data || []).map((item: any) => item.fid); + const procResult2 = (procJson2.data || []).map((item: any) => item.bscFctCd); //최종 처리시설코드로 재이용시설조회 const res = await fetch(url, { @@ -179,6 +177,7 @@ export const SearchBar = ({ text: item.ruseUtztnFcltNm ?? "(이름없음)", val: item.pbnstRuseFcltId, })); + } else if ( type === "tb_wr_ruse_fclt_dmd_co" //수요처 ) { @@ -225,6 +224,23 @@ export const SearchBar = ({ //해당 시설물로 이동 const handleFeatureFocus = (data: any) => { + + let featureId = data.fid; + const layerNm = data.layerNm; + + if (!isNaN(Number(featureId))) { + // 숫자면 문자열로 변환 + featureId = String(featureId); + } + + if (layerNm === "tb_wr_bdst_ruse_fclt") { + featureId = featureId.slice(0, 11); + } + + if (!featureId.includes(".")) { + featureId = layerNm + "." + featureId; + } + const map = gisMaps.current; if (!map) { console.warn("지도가 초기화되지 않았습니다."); @@ -237,7 +253,7 @@ export const SearchBar = ({ //select.resetSelectedFeature(); // 2. data가 OpenLayers Feature 인스턴스인지 확인 let foundFeature: any = null; - let featureId = data.fid; + map .getLayers() .getArray() @@ -285,7 +301,7 @@ export const SearchBar = ({ { text: "시설 구분", val: "0" }, ...facilityTypes, ]} - onSelectValue={(val:any) => + onSelectValue={(val: any) => onSelectValue(val.toString(), "facilityType") } value={facilityType} @@ -297,7 +313,7 @@ export const SearchBar = ({ selectClass="rounded-lg bg-white" label="" selectArray={sidoData} - onSelectValue={(val:any) => onSelectValue(val.toString(), "ctpvCd")} + onSelectValue={(val: any) => onSelectValue(val.toString(), "ctpvCd")} value={sidoValue} /> onSelectValue(val.toString(), "sggCd")} + onSelectValue={(val: any) => onSelectValue(val.toString(), "sggCd")} value={sigunValue} /> Date: Sun, 10 Aug 2025 21:45:24 +0900 Subject: [PATCH 03/28] =?UTF-8?q?=EB=B9=8C=EB=93=9C=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 4130fff63..ef337e39c 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -42,16 +42,6 @@ const Map = () => { fetchData(); }, []); - useEffect(() => { - const bc = new BroadcastChannel("mapDetailPopUp"); - bc.onmessage = (event) => { - if (event.data.type === "SELECT_FEATURE") { - onFeatureSelect(event.data.feature); - closePopup(); - } - }; - }, []); - useEffect(() => { const messageHandler = (event: MessageEvent) => { if (event.data.type === "POPUP_CLOSED") { @@ -71,13 +61,6 @@ const Map = () => { }; }, []); - useEffect(() => { - - if (isFeatured) { - onFeatureSelect(isFeatured); - } - }, [isFeatured]); - // 체크된 레이어 정보를 받는 핸들러 const handleCheckedLayersChange = ( checkedIds: string[], @@ -88,7 +71,7 @@ const Map = () => { }; // SearchModal, GisContent 등에서 호출 - const onFeatureFocus = (data: any) => { + const onFeatureFocus = (_data: any) => { console.log("onFeatureFocus"); }; @@ -168,6 +151,23 @@ const Map = () => { setIsSearchModalOpen(false); }; + useEffect(() => { + + if (isFeatured) { + onFeatureSelect(isFeatured); + } + }, [isFeatured, onFeatureSelect]); + + useEffect(() => { + const bc = new BroadcastChannel("mapDetailPopUp"); + bc.onmessage = (event) => { + if (event.data.type === "SELECT_FEATURE") { + onFeatureSelect(event.data.feature); + closePopup(); + } + }; + }, [onFeatureSelect]); + const getSelectedLayers = (isFeature: any) => { const map = gisMaps.current; if (!map) { From 94306f052e50b22d382be6b202e32219637c44a3 Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 21:55:26 +0900 Subject: [PATCH 04/28] =?UTF-8?q?=EB=A7=9D=ED=95=A0=20=EB=B9=8C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/layout.tsx | 2 +- apps/wr/app/store/store.tsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx index 953c1d7ab..17945be51 100644 --- a/apps/wr/app/layout.tsx +++ b/apps/wr/app/layout.tsx @@ -5,7 +5,7 @@ import { I18nextProvider } from "react-i18next"; import koBase from "../public/locales/ko/message.json"; import { StoreProvider } from "./store"; import { LoginApi } from "@/src/entities/auth"; -import { useEffect, useMemo } from "react"; +import { useEffect } from "react"; export default function RootLayout({ children, diff --git a/apps/wr/app/store/store.tsx b/apps/wr/app/store/store.tsx index bbff85bcb..e19ec2216 100644 --- a/apps/wr/app/store/store.tsx +++ b/apps/wr/app/store/store.tsx @@ -161,7 +161,6 @@ import { type rswtStatState, type rswtStatType, } from "./stats/rswtStat"; -import { LoginApi } from "@/src/entities/auth"; import { authActionsExport, authStateExport, @@ -342,7 +341,6 @@ export const StoreZus = ( getMiddleRegionCd(set); getUnitWaterShedCd(set); getEnvPartCd(set); - // LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }); return { ...initState, ...comFcltSearchAction(set), From d85e8c057248e4250145e938eb1d489dc4426353 Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 21:57:09 +0900 Subject: [PATCH 05/28] =?UTF-8?q?=EB=B9=8C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index ef337e39c..85eb17dba 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -70,10 +70,6 @@ const Map = () => { setCheckedLayersData(checkedNodesData); }; - // SearchModal, GisContent 등에서 호출 - const onFeatureFocus = (_data: any) => { - console.log("onFeatureFocus"); - }; const onFeatureSelect = (data: any) => { const map = gisMaps.current; From 1a4fa66519d3bc1ebbf64f9cd1ee518d029865e0 Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 21:57:58 +0900 Subject: [PATCH 06/28] =?UTF-8?q?=EB=B9=8C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 85eb17dba..1e20f4888 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -70,6 +70,11 @@ const Map = () => { setCheckedLayersData(checkedNodesData); }; + // SearchModal, GisContent 등에서 호출 + const onFeatureFocus = (data: any) => { + console.log("onFeatureFocus"); + console.log(data); + }; const onFeatureSelect = (data: any) => { const map = gisMaps.current; From 6d9327bf00e9b36bdd506b6c2ed665855daeabe9 Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 22:20:22 +0900 Subject: [PATCH 07/28] =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/(map-layout)/map/mainMap/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/wr/app/(map-layout)/map/mainMap/page.tsx b/apps/wr/app/(map-layout)/map/mainMap/page.tsx index 1e20f4888..1922a8a3f 100644 --- a/apps/wr/app/(map-layout)/map/mainMap/page.tsx +++ b/apps/wr/app/(map-layout)/map/mainMap/page.tsx @@ -71,12 +71,12 @@ const Map = () => { }; // SearchModal, GisContent 등에서 호출 - const onFeatureFocus = (data: any) => { + const onFeatureFocus = () => { console.log("onFeatureFocus"); - console.log(data); }; const onFeatureSelect = (data: any) => { + const map = gisMaps.current; if (!map) { console.warn("지도가 초기화되지 않았습니다."); @@ -142,7 +142,7 @@ const Map = () => { } select.selectFeature(foundFeature, true); } else { - console.warn("OpenLayers Feature를 찾을 수 없습니다:", data); + console.warn("OpenLayers Feature를 찾을 수 없습니다:"); } const currentId = data?.fid || data?.id || data?.ftrIdn; const lastId = featureData?.fid || featureData?.id || featureData?.ftrIdn; @@ -157,7 +157,7 @@ const Map = () => { if (isFeatured) { onFeatureSelect(isFeatured); } - }, [isFeatured, onFeatureSelect]); + }, [isFeatured]); useEffect(() => { const bc = new BroadcastChannel("mapDetailPopUp"); @@ -167,7 +167,7 @@ const Map = () => { closePopup(); } }; - }, [onFeatureSelect]); + }, []); const getSelectedLayers = (isFeature: any) => { const map = gisMaps.current; From 21af492743e9091da8ecebd2ff5a5fe57a75579d Mon Sep 17 00:00:00 2001 From: yschoi Date: Sun, 10 Aug 2025 22:32:10 +0900 Subject: [PATCH 08/28] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20layout=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/layout.tsx | 12 +++++++++++- apps/fo/app/store/store.tsx | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/fo/app/layout.tsx b/apps/fo/app/layout.tsx index af0725a7b..842ec5ed1 100644 --- a/apps/fo/app/layout.tsx +++ b/apps/fo/app/layout.tsx @@ -1,17 +1,27 @@ "use client" import "./globals.css"; import { StoreProvider } from "./store"; +import { LoginApi } from "@/src/entities/auth"; +import { useEffect } from "react"; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + + useEffect(() => { + // 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치 + void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" }) + .catch((e) => { + console.error("Auto login failed:", e); + }); + }, []); return ( - {children} + {children} diff --git a/apps/fo/app/store/store.tsx b/apps/fo/app/store/store.tsx index 589bc4d78..f7f2222c6 100644 --- a/apps/fo/app/store/store.tsx +++ b/apps/fo/app/store/store.tsx @@ -1,4 +1,3 @@ -import { LoginApi } from '@/src/entities/auth/api/login-service'; import { createStore } from 'zustand/vanilla'; import { CommonReducer, commonState, type CommonStore, type CommonType } from './common'; import { dashBoardInitState, dashBoardReducer, type DashBoardStore, type DashBoardType } from './dashboard'; @@ -59,7 +58,6 @@ export const StoreZus = } ) => { return createStore()((set) => { - LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"}) return { ...initState, ...CommonReducer(set), From d86d0b0fcad7b9d0371fc30ee706e5d0ee66ad5b Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 09:21:40 +0900 Subject: [PATCH 09/28] =?UTF-8?q?=ED=94=BC=EC=B2=98=20=EC=A2=8C=ED=91=9C?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EC=97=86=EC=9D=84=EB=95=8C=20=EC=95=8C?= =?UTF-8?q?=EB=9E=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/(map-layout)/map/page.tsx | 2 -- .../business_components/src/ui/map/searchBar/procSearchBar.tsx | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/fo/app/pages/(map-layout)/map/page.tsx b/apps/fo/app/pages/(map-layout)/map/page.tsx index 7c1d78164..d27dbe834 100644 --- a/apps/fo/app/pages/(map-layout)/map/page.tsx +++ b/apps/fo/app/pages/(map-layout)/map/page.tsx @@ -80,8 +80,6 @@ const Map = () => { const mayGet = (k: string) => (feature.get ? feature.get(k) : undefined); const safe = (v: any) => (v === undefined || v === null ? "-" : String(v)); - console.log(feature); - // 레이어 유형별 대표 필드 추출(없으면 "-") if (layerType === "tb_il_swage_prcs_fclt") { // 하수처리시설 diff --git a/packages/common/business_components/src/ui/map/searchBar/procSearchBar.tsx b/packages/common/business_components/src/ui/map/searchBar/procSearchBar.tsx index 33388ce62..21239bd7b 100644 --- a/packages/common/business_components/src/ui/map/searchBar/procSearchBar.tsx +++ b/packages/common/business_components/src/ui/map/searchBar/procSearchBar.tsx @@ -249,6 +249,7 @@ export const ProcSearchBar = ({ gisMaps, facilityTypes }: SearchBarProps) => { nearest: true, }); } else { + alert("위치정보를 찾을 수 없습니다.") console.warn("geometry를 찾을 수 없습니다:", data); } } else { From bde50388d1fa90939167543fb5beae71cfa4438b Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 09:34:05 +0900 Subject: [PATCH 10/28] =?UTF-8?q?=EC=8B=9C=EC=84=A4=EC=9A=A9=EB=9F=89=20?= =?UTF-8?q?=EC=B2=9C=EB=8B=A8=EC=9C=84=20=EC=BD=A4=EB=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/(map-layout)/map/page.tsx | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/fo/app/pages/(map-layout)/map/page.tsx b/apps/fo/app/pages/(map-layout)/map/page.tsx index d27dbe834..f41439b92 100644 --- a/apps/fo/app/pages/(map-layout)/map/page.tsx +++ b/apps/fo/app/pages/(map-layout)/map/page.tsx @@ -73,6 +73,17 @@ const Map = () => { fetchData(); }, []); + function formatWithCommas(value: any) { + if (value === null || value === undefined) return value; + const num = Number(value); + return isNaN(num) ? value : num.toLocaleString(); + } + + function formatDateString(dateStr: string) { + if (typeof dateStr !== "string" || dateStr.length !== 8) return dateStr; + return `${dateStr.slice(0, 4)}-${dateStr.slice(4, 6)}-${dateStr.slice(6)}`; + } + // ===== 오버레이 콘텐츠 빌더 ===== const buildOverlayContent = (layerType: string, feature: FeatureData) => { const props: Record = {}; @@ -84,9 +95,9 @@ const Map = () => { if (layerType === "tb_il_swage_prcs_fclt") { // 하수처리시설 props["하수처리시설명"] = mayGet("swtrmt_fclt_nm"); - props["시설용량(m³/d)"] = mayGet("fclt_cpct"); + props["시설용량(m³/d)"] = formatWithCommas(mayGet("fclt_cpct")); props["주소"] = mayGet("rdnm_addr"); - props["가동개시일"] = mayGet("oprtng_strt_ymd"); + props["가동개시일"] = formatDateString(mayGet("oprtng_strt_ymd")); props["공법"] = mayGet("rprs_msrc_cn"); } else if (layerType === "tb_ms_swage_prcs_zone") { // 처리구역(존) @@ -116,14 +127,14 @@ const Map = () => {
${title}
${Object.entries(props) - .map( - ([k, v]) => ` + .map( + ([k, v]) => ` ` - ) - .join("")} + ) + .join("")}
${k} ${safe(v)}
`; return el; From ce9c536858ceb6cabab5f425e0d5039e4de4cbfc Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 09:45:58 +0900 Subject: [PATCH 11/28] =?UTF-8?q?=EA=B0=80=EB=8F=99=EA=B0=9C=EC=8B=9C?= =?UTF-8?q?=EC=9D=BC=20=EA=B3=B5=EB=B0=B1=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/(map-layout)/map/page.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/fo/app/pages/(map-layout)/map/page.tsx b/apps/fo/app/pages/(map-layout)/map/page.tsx index f41439b92..ad3f70295 100644 --- a/apps/fo/app/pages/(map-layout)/map/page.tsx +++ b/apps/fo/app/pages/(map-layout)/map/page.tsx @@ -80,6 +80,7 @@ const Map = () => { } function formatDateString(dateStr: string) { + dateStr = dateStr.trim(); if (typeof dateStr !== "string" || dateStr.length !== 8) return dateStr; return `${dateStr.slice(0, 4)}-${dateStr.slice(4, 6)}-${dateStr.slice(6)}`; } From 3d480a40a7070dc948f92dec87d01d4331b5196a Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 09:47:20 +0900 Subject: [PATCH 12/28] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/store/rdi/index.tsx | 1 - apps/fo/src/entities/auth/api/login-service.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/apps/fo/app/store/rdi/index.tsx b/apps/fo/app/store/rdi/index.tsx index b1eccc2b7..fd9ca52b6 100644 --- a/apps/fo/app/store/rdi/index.tsx +++ b/apps/fo/app/store/rdi/index.tsx @@ -219,7 +219,6 @@ type SetStateFunction = (state: RdiType | ((state: RdiType) => RdiType)) => void export type RdiStore = RdiType & RdiActions; export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunction) => { - console.log("tableActionsExport"); return { searchRdiList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { set((state: RdiType) => ({ diff --git a/apps/fo/src/entities/auth/api/login-service.ts b/apps/fo/src/entities/auth/api/login-service.ts index 3f2d958c6..760858b99 100644 --- a/apps/fo/src/entities/auth/api/login-service.ts +++ b/apps/fo/src/entities/auth/api/login-service.ts @@ -28,9 +28,6 @@ export class LoginApiService implements LoginService { const accessToken = response.headers.get(ACCESS_TOKEN); const tokenId = response.headers.get(AUTH_USER_ID); - console.log('accessToken ', accessToken) - console.log('tokenId ', tokenId) - if (!accessToken || !tokenId) { throw new Error("Missing required authentication tokens"); } From 1e0ef0c71325fa2d3fa94a967ccf00bc9f2e934c Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 10:23:47 +0900 Subject: [PATCH 13/28] =?UTF-8?q?=EC=98=A8=EB=B0=B0=EC=88=98=20=EC=8B=9C?= =?UTF-8?q?=EC=84=A4=20=EC=A7=80=EB=8F=84=20=ED=91=9C=EC=B6=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(popUp-layout)/mapFeaturePopup/page.tsx | 93 +------------------ apps/wr/middleware.ts | 1 - 2 files changed, 1 insertion(+), 93 deletions(-) diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index 94c1411f3..debea36c9 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -7,95 +7,6 @@ import { Title, UiTable } from "@common/business_components/ui"; import { useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; - -export const htdflData ={ - "bdstInfoSn": 54, - "ctpvCd": 11, - "sggCd": 11110, - "daddr": "청라동 100-80", - "bdstNm": "한국중부발전(주)", - "frstArchPrmsnDt": "2013-01-01", - "archArea": "-1.000000000", - "ctpvNm": null, - "sggNm": null, - "lat": 37.57096, - "lot": 126.98143, - "regDt": "2025-04-16", - "rgtr": null, - "mdfcnDt": "2025-04-16", - "mdfr": null, - "reuseBuilding": [ - { - "bdstRuseFcltSn": 4881, - "bdstInfoSn": 54, - "instlCmptnDt": "2025-06-20", - "instlCst": 300, - "operMngCd": null, - "anlOperCst": 400, - "instlCstSprtYn": null, - "instlCstSprtAmt": 0, - "grntchBdstCertYn": null, - "grntchBdstCertYr": null, - "grntchBdstCertNo": "", - "grntchBdstCertGrd": "", - "crgRdctYn": null, - "crgRdctBss": null, - "crgRdctAmt": 0, - "ruseFcltFlg": "HTB", - "bdstUsgCd": 2, - "lawTrgtYn": "N", - "regDt": "2025-04-16", - "rgtr": null, - "mdfcnDt": "2025-04-16", - "mdfr": null, - "htdflObj": { - "bdstRuseFcltSn": 4881, - "etgtType": "", - "fclCpct": 400, - "plwtYn": "Y", - "orgwtWtritSpt": "공장내", - "orgwtOcrnProcs": "1", - "wtritEntrcTp": 3, - "amtgnr": 1, - "prcsProcsYn": "Y", - "prcsFcltCpct": 14, - "regDt": "2025-04-16", - "rgtr": null, - "mdfcnDt": "2025-04-16", - "mdfr": null, - "fmYn": "Y", - "utztnCpct": 1, - "utztnUsg": "1", - "grssClfg": 0, - "combResdch": 0, - "trbt": 4, - "bod": 4, - "smll": "불쾌하지않을것", - "crmty": 4, - "tn": 10, - "tph": 10, - "ph": '1~3', - "clIonQnt": 1, - "cdtnv": 0, - "emsnExitTp": 5 - } - } - ], - "chgBuilding": [ - { - "bdstInfoSn": 54, - "archChgPrmsnDt": null, - "archChgArea": null, - "bdstChgNm": null, - "regDt": "2025-04-16", - "rgtr": null, - "mdfcnDt": "2025-04-16", - "mdfr": null - } - ] -} - - export default function MapFeaturePopup() { const [isFeatureCd, setIsFeatureCd] = useState(null); const { @@ -150,9 +61,7 @@ export default function MapFeaturePopup() { }); } else if (layerNm === "온배수시설") { htdfMapDetile(isFeatureCd).then((res) => { -//가짜데이터로 하였음!!!!!!!!! 기능 수정시 res를 넣어야함 - console.log(res) - setIsDetail(htdflData); + setIsDetail(res); }); } else if (layerNm === "잠재수요처") { ldrmntMapDetile(isFeatureCd).then((res) => { diff --git a/apps/wr/middleware.ts b/apps/wr/middleware.ts index e47a2a8f5..7758ec5ec 100644 --- a/apps/wr/middleware.ts +++ b/apps/wr/middleware.ts @@ -28,7 +28,6 @@ export function middleware(req: NextRequest) { } if (pathname === "/") { - console.log(" maim 화면이동 "); return NextResponse.redirect(new URL("/map/mainMap", req.url)); } From 2fd1159615b68e8c82875375ab3f7532c26fa354 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 11 Aug 2025 10:29:13 +0900 Subject: [PATCH 14/28] =?UTF-8?q?Revert=20"[common/features]=20feat:=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=B3=80=EC=88=98=20URL=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=8F=84=EC=9E=85"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e4d52611d797e02e29fddede9d04f452b018f067. --- apps/common/features/.gitignore | 3 +- apps/common/features/cli.js | 44 ---- apps/common/features/package.json | 8 +- apps/common/features/src/app/index.tsx | 4 - apps/common/features/src/shared/config/api.ts | 8 +- apps/common/features/src/shared/lib/env.ts | 14 -- apps/common/features/src/shared/lib/index.ts | 1 - pnpm-lock.yaml | 220 ++++++++++++------ 8 files changed, 157 insertions(+), 145 deletions(-) delete mode 100644 apps/common/features/cli.js delete mode 100644 apps/common/features/src/shared/lib/env.ts diff --git a/apps/common/features/.gitignore b/apps/common/features/.gitignore index b660a552e..e8d8437ee 100644 --- a/apps/common/features/.gitignore +++ b/apps/common/features/.gitignore @@ -37,5 +37,4 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts -.env* -__ENV__.js \ No newline at end of file +.env* \ No newline at end of file diff --git a/apps/common/features/cli.js b/apps/common/features/cli.js deleted file mode 100644 index 9f165f497..000000000 --- a/apps/common/features/cli.js +++ /dev/null @@ -1,44 +0,0 @@ -import { findUp } from "find-up"; -import { config } from "dotenv"; -import fs from "fs"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; - -async function parseDotenv(nodeEnv) { - const envFilePath = await findUp(`.env.${nodeEnv}`); - - const parsedEnv = config({ path: envFilePath }).parsed || {}; - - return parsedEnv; -} - -function writeEnv(parsedEnv) { - const scriptFilePath = `${fs.realpathSync(process.cwd())}/public/__ENV__.js`; - - fs.writeFileSync( - scriptFilePath, - `window.__ENV__ = ${JSON.stringify(parsedEnv)}`, - ); -} - -yargs(hideBin(process.argv)) - .command( - "next-env", - "Create Next.js runtime environment js", - function builder(y) { - return y.option("env", { - alias: "e", - type: "string", - description: "Environment name(ex: development, production)", - }); - }, - async function handler(args) { - const nodeEnv = args.e || args.env || "development"; - - const parsedEnv = await parseDotenv(nodeEnv); // dotenv 파싱 - writeEnv(parsedEnv); // 환경 변수 스크립트 파일 생성 - - return parsedEnv; - }, - ) - .parse(); diff --git a/apps/common/features/package.json b/apps/common/features/package.json index bfa43377e..304e88bae 100644 --- a/apps/common/features/package.json +++ b/apps/common/features/package.json @@ -1,12 +1,11 @@ { "name": "features", "version": "0.1.0", - "type": "module", "private": true, "scripts": { - "dev": "node cli.js next-env -e ${NODE_ENV:-development} && next dev -p 13000", + "dev": "next dev -p 13000", "build": "next build", - "start": "node cli.js next-env -e ${NODE_ENV:-production} && next start -p 13000", + "start": "next start -p 13000", "lint": "next lint" }, "dependencies": { @@ -28,8 +27,6 @@ "axios": "^1.8.1", "chart.js": "^4.4.8", "dayjs": "^1.11.13", - "dotenv": "^17.2.1", - "find-up": "^7.0.0", "js-cookie": "^3.0.5", "next": "15.3.0", "next-themes": "^0.4.6", @@ -48,7 +45,6 @@ "@types/js-cookie": "^3.0.6", "@types/node": "^22.13.1", "@types/webpack": "^5.28.5", - "@types/yargs": "^17.0.33", "eslint": "^9", "eslint-config-next": "15.1.7", "postcss": "^8", diff --git a/apps/common/features/src/app/index.tsx b/apps/common/features/src/app/index.tsx index eb6e75d00..692b55ef0 100644 --- a/apps/common/features/src/app/index.tsx +++ b/apps/common/features/src/app/index.tsx @@ -4,16 +4,12 @@ import "@fontsource-variable/noto-sans-kr"; import { AppProvider } from "./providers"; import { cookies } from "next/headers"; -import Script from "next/script"; const App = async ({ children }: Readonly<{ children: React.ReactNode }>) => { const theme = (await cookies()).get("site-theme-key"); return ( - -