From 7cbb58ff326ef5c0108fc5c005ebd3d5067d80eb Mon Sep 17 00:00:00 2001 From: mind-one001 Date: Wed, 23 Sep 2026 14:58:14 +0900 Subject: [PATCH] =?UTF-8?q?=EB=85=B8=ED=9B=84=EA=B4=80=EB=A1=9C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/agedPipe/AgedPipePopupPage.tsx | 76 ++++++++++++------- .../map/components/agedPipe/agedPipeUtils.ts | 29 +++++-- .../001-fe-SN-노후관로목록표시변경-결과.md | 55 ++++++++++++++ apps/sn/scripts/aged-pipe-list.test.cjs | 64 ++++++++++++++++ .../windowPopup/model/popupDefinitions.ts | 5 +- 5 files changed, 194 insertions(+), 35 deletions(-) create mode 100644 apps/sn/docs/작업계획/SN-노후관로목록표시변경/001-fe-SN-노후관로목록표시변경-결과.md create mode 100644 apps/sn/scripts/aged-pipe-list.test.cjs diff --git a/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx b/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx index 7fe989125..abeec2245 100644 --- a/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx +++ b/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx @@ -18,11 +18,13 @@ import { AGED_PIPE_LIST_HEADLIST, AGED_PIPE_PAGE_SIZE, buildAgedPipeCqlFilters, + getAgedPipeManagementName, normalizeAgedPipeFilters, toDisplayPipeRow, validateElapsedYears, type AgedPipeFilters, type AgedPipeRow, + type AgedPipeManagementAgency, } from "./agedPipeUtils"; import { downloadAgedPipeExcel } from "./agedPipeExport"; import MapPopupDataTable from "@/features/windowPopup/ui/MapPopupDataTable"; @@ -53,6 +55,15 @@ export default function AgedPipePopupPage() { const [appliedFilters, setAppliedFilters] = useState(initialFilters); const [rows, setRows] = useState([]); + // 관리기관명 조회가 늦게 완료되어도 기존 목록을 재조회하지 않고 표시만 갱신한다. + const [managementAgencies, setManagementAgencies] = useState([]); + const displayRows = useMemo( + () => rows.map((row) => ({ + ...row, + mngInstNm: getAgedPipeManagementName(row, managementAgencies), + })), + [rows, managementAgencies], + ); const [total, setTotal] = useState(0); const [currentPage, setCurrentPage] = useState(1); const [isLoading, setIsLoading] = useState(false); @@ -73,6 +84,19 @@ export default function AgedPipePopupPage() { if (sgg.length === 0) fetchSgg(); }, [ctpv.length, fetchCtpv, fetchSgg, sgg.length]); + useEffect(() => { + let active = true; + // 기존 GIS 관리 화면과 같은 기관 목록을 사용하고, 실패 시 관로 조회는 유지한다. + getData("v1/fcltPpl/mngInsts") + .then((response) => { + if (active) setManagementAgencies(Array.isArray(response) ? response : []); + }) + .catch(() => { + if (active) alert("관리기관명을 불러오지 못해 관리기관 코드로 표시합니다."); + }); + return () => { active = false; }; + }, [alert]); + const fetchRows = useCallback( async (page: number, nextFilters: AgedPipeFilters, size: number) => { const normalized = normalizeAgedPipeFilters(nextFilters); @@ -247,31 +271,6 @@ export default function AgedPipePopupPage() { ) : null} - - + +