From af8db9457f8c3922c6688aadace0c15adadc97a3 Mon Sep 17 00:00:00 2001 From: kiminchan Date: Thu, 4 Jun 2026 15:16:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=85=B8=ED=9B=84=EA=B4=80=EB=A1=9C=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/agedPipe/AgedPipePopupPage.tsx | 92 +++++++++++++++---- .../map/components/agedPipe/agedPipeUtils.ts | 4 +- apps/sn/app/(map-layout)/map/page.tsx | 22 ++++- .../app/html/(map-layout)/aged-pipe/page.tsx | 18 +++- .../001-qa-SFR-011-노후관로관리-통합검증결과.md | 57 ++++++++++++ .../001-fe-SFR-011-노후관로관리-통합구현기록.md | 76 +++++++++++++++ .../windowPopup/lib/openWindowPopup.ts | 32 ++++--- .../windowPopup/model/popupDefinitions.ts | 8 +- .../src/features/windowPopup/model/types.ts | 3 + 9 files changed, 273 insertions(+), 39 deletions(-) create mode 100644 apps/sn/docs/작업검증/SFR-011-노후관로관리/001-qa-SFR-011-노후관로관리-통합검증결과.md create mode 100644 apps/sn/docs/작업내용/SFR-011-노후관로관리/001-fe-SFR-011-노후관로관리-통합구현기록.md 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 1b6542816..77eee2aad 100644 --- a/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx +++ b/apps/sn/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx @@ -196,8 +196,16 @@ export default function AgedPipePopupPage() { window.close(); }; + const getCellClassName = (_row: AgedPipeRow, headId: string) => { + if (headId === "mqltCd") { + return "break-all whitespace-normal"; + } + + return "whitespace-normal"; + }; + return ( -
+

노후관로 현황

@@ -220,9 +228,9 @@ export default function AgedPipePopupPage() { ) : null} -
-
-
); } diff --git a/apps/sn/app/(map-layout)/map/components/agedPipe/agedPipeUtils.ts b/apps/sn/app/(map-layout)/map/components/agedPipe/agedPipeUtils.ts index e273d9c1c..8419e929c 100644 --- a/apps/sn/app/(map-layout)/map/components/agedPipe/agedPipeUtils.ts +++ b/apps/sn/app/(map-layout)/map/components/agedPipe/agedPipeUtils.ts @@ -59,9 +59,9 @@ export const AGED_PIPE_LIST_HEADLIST = [ { id: "instlYmd", title: "설치일자", widthPercent: 12 }, { id: "pdmtVl", title: "관경(mm)", widthPercent: 10 }, { id: "prlgVl", title: "연장(m)", widthPercent: 10 }, - { id: "usgCd", title: "용도", widthPercent: 14 }, + { id: "usgCd", title: "용도", widthPercent: 12 }, { id: "mqltCd", title: "재질", widthPercent: 18 }, - { id: "elapsedYears", title: "경과년도", widthPercent: 12, align: "right" }, + { id: "elapsedYears", title: "경과년도", widthPercent: 8, align: "right" }, ]; export const AGED_PIPE_EXCEL_FIELDS = [ diff --git a/apps/sn/app/(map-layout)/map/page.tsx b/apps/sn/app/(map-layout)/map/page.tsx index 67a3f3497..508d8167a 100644 --- a/apps/sn/app/(map-layout)/map/page.tsx +++ b/apps/sn/app/(map-layout)/map/page.tsx @@ -1506,6 +1506,22 @@ const appendAgedPipeControlNode = (data: any[]) => { ]; }; +const normalizeTreeRowSpacing = (data: any[]) => { + if (!Array.isArray(data)) return data; + + return data.map((item) => { + if (item?.lyrNm !== "지반침하정보") { + return item; + } + + return { + ...item, + iconNm: null, + gobjTy: "", + }; + }); +}; + const Map = () => { const pathname = usePathname(); const flowDirectionMode = useMemo(() => getFlowDirectionModeByPathname(pathname), [pathname]); @@ -1960,7 +1976,11 @@ const Map = () => { const fetchData = async () => { try { const data = await getRawJson("/sewerage-service/api/v1/map/lyrStngs/SN_NETWORK"); - setTreeData(appendAgedPipeControlNode(normalizeFlowDirectionLayerInfos(data))); + setTreeData( + appendAgedPipeControlNode( + normalizeTreeRowSpacing(normalizeFlowDirectionLayerInfos(data)), + ), + ); setLayerLoadError(null); } catch (error) { const message = diff --git a/apps/sn/app/html/(map-layout)/aged-pipe/page.tsx b/apps/sn/app/html/(map-layout)/aged-pipe/page.tsx index 549273158..d0be9a0ce 100644 --- a/apps/sn/app/html/(map-layout)/aged-pipe/page.tsx +++ b/apps/sn/app/html/(map-layout)/aged-pipe/page.tsx @@ -31,6 +31,22 @@ const agedPipeHighlightStyle = new Style({ const PIPE_LAYER_TYPE = "tb_ms_swage_ppl"; const EmptySearchView = () => null; +const normalizeTreeRowSpacing = (data: any[]) => { + if (!Array.isArray(data)) return data; + + return data.map((item) => { + if (item?.lyrNm !== "지반침하정보") { + return item; + } + + return { + ...item, + iconNm: null, + gobjTy: "", + }; + }); +}; + const DESIGN_PREVIEW_FEATURE = { fid: "preview-aged-pipe", lyrTypeNm: PIPE_LAYER_TYPE, @@ -103,7 +119,7 @@ const Map = () => { const fetchData = async () => { try { const data = await getRawJson("/sewerage-service/api/v1/map/lyrStngs/SN_NETWORK"); - setTreeData(data); + setTreeData(normalizeTreeRowSpacing(data)); } catch (error) { console.error("노후관로 레이어 설정 조회 중 오류:", error); throw new Error("Invalid JSON response from server"); diff --git a/apps/sn/docs/작업검증/SFR-011-노후관로관리/001-qa-SFR-011-노후관로관리-통합검증결과.md b/apps/sn/docs/작업검증/SFR-011-노후관로관리/001-qa-SFR-011-노후관로관리-통합검증결과.md new file mode 100644 index 000000000..915cb2826 --- /dev/null +++ b/apps/sn/docs/작업검증/SFR-011-노후관로관리/001-qa-SFR-011-노후관로관리-통합검증결과.md @@ -0,0 +1,57 @@ +# SFR-011 노후관로관리 통합 검증 결과 + +## 1. 문서 목적 + +- `SFR-011 노후관로관리` 유지보수 라운드의 검증 결과를 기록한다. +- 이번 검증은 팝업 위치/폭 유지보수와 좁은 폭 레이아웃 보정 중심이다. + +## 2. 현재 검증 상태 + +### 2.1 수행 여부 + +- 정적 코드 검토와 타입 검사 시도를 수행했다. +- 자동 브라우저 검증은 수행하지 못했다. + +### 2.2 수행 결과 + +- 정적 구현 확인 + - `agedPipePopup` 최종 크기가 `850 x 600`으로 조정됐다. + - `agedPipePopup`이 `browser-left + alignTop + offsetTop: 200` 기준 배치를 사용하도록 설정됐다. + - 조회/다운로드 버튼이 `시군구`와 같은 수평선 오른쪽으로 정렬되도록 반영됐다. + - 필터 영역 하단 여백이 축소되도록 반영됐다. + - `UiTable` 외곽 마진 제거와 중복 총건수 숨김이 반영됐다. + - 표 영역이 현재 팝업 높이 기준에서 하단 공백이 과도하지 않도록 조정됐다. +- 로컬 라우트 응답 확인 + - `http://127.0.0.1:3002/popup/agedPipePopup?elapsedYears=30&ctpvCd=0&sggCd=0` 응답 `200` + - `http://127.0.0.1:3002/map` 응답 `200` +- 정적 타입 검사 + - 실행 명령: `pnpm --filter sn exec tsc --noEmit --pretty false` + - 결과: 실패 + - 확인 내용 + - 저장소 기존 타입 오류가 다수 존재한다. + - 출력된 기존 오류 경로 + - `app/(map-layout)/map/components/common/index.ts` + - `app/(map-layout)/map/components/pipeAnalysis/PipeAnalysisPopupPage.tsx` + - `app/html/(map-layout)/map/components/common/index.ts` + - `app/html/(with-base-layout)/layout.tsx` + - `packages/common/business_components/src/ui/chart/*` + - 명령 말미에 `Command "tsc" not found`가 함께 출력돼 현재 실행 환경도 안정적이지 않다. + +### 2.3 미수행 항목 + +- `localhost:3002/map` 실제 브라우저에서 `노후관로 > 목록보기` 팝업 위치 육안 확인 +- 팝업 최소화 후 재오픈 체감 확인 +- 실제 최종 크기(`850 x 600`) 상태에서 행 선택, 페이지 이동, 다운로드 버튼 상호작용 확인 + +## 3. 현재 리스크 + +- 자동 브라우저 캡처용 Playwright 의존성이 현재 세션에 없어 화면 증적을 남기지 못했다. +- 팝업 위치가 사용자 의도와 완전히 일치하는지는 수동 검증 전까지 확정할 수 없다. +- 저장소 기존 타입 오류 때문에 이번 변경의 정적 게이트 통과 여부를 분리 보장하기 어렵다. + +## 4. 후속 검증 권장 항목 + +- `http://127.0.0.1:3002/map`에서 실제 팝업 열기 +- 사용자 스크린샷 기준 위치 체감 확인 +- 최종 크기(`850 x 600`) 상태에서 표 하단 공백 체감 확인 +- 필요 시 문서만 현재 운영값 기준으로 재동기화 diff --git a/apps/sn/docs/작업내용/SFR-011-노후관로관리/001-fe-SFR-011-노후관로관리-통합구현기록.md b/apps/sn/docs/작업내용/SFR-011-노후관로관리/001-fe-SFR-011-노후관로관리-통합구현기록.md new file mode 100644 index 000000000..ee502cdbc --- /dev/null +++ b/apps/sn/docs/작업내용/SFR-011-노후관로관리/001-fe-SFR-011-노후관로관리-통합구현기록.md @@ -0,0 +1,76 @@ +# SFR-011 노후관로관리 통합 구현 기록 + +## 1. 문서 목적 + +- `SFR-011 노후관로관리`의 FE 구현 이력과 유지보수 보정 사항을 기능당 1개 문서로 누적 관리한다. +- 이번 라운드는 신규 기능 추가가 아니라, 기존 `노후관로` 목록 팝업의 위치와 폭을 유지보수하는 목적이다. + +## 2. 입력 근거 + +- `COMMON_DOCS_ROOT/작업계획/SFR-011-노후관로관리/001-DE-P2-노후관로관리-설계초안.md` +- 사용자 유지보수 요청 + - 하수관망도 `노후관로` 목록보기 팝업 가로 사이즈 축소 + - 지도와 같이 볼 수 있도록 팝업 위치 좌측 상단 쪽으로 이동 + - 폭 축소 후 컴포넌트가 자연스럽게 재배치되도록 보정 + +## 3. 현재 라운드 구현 요약 + +### 3.1 2026-06-04 팝업 위치/폭 유지보수 + +- `agedPipePopup` 최종 크기를 `850 x 600`으로 조정했다. +- 팝업 공통 열기 유틸에 위치 미세조정 옵션을 추가해 `노후관로` 팝업이 `placement: "browser-left"`, `alignTop: true`, `offsetTop: 200` 기준으로 열리도록 정리했다. +- 상단 조회 조건 영역은 `경과년도 / 시도 / 시군구 / 조회 / 다운로드`가 한 줄로 보이도록 맞췄다. +- 현재 팝업 높이에서 표 아래 공백이 과도하지 않도록 높이 기준을 재조정했다. + +### 3.2 2026-06-04 후속 미세조정 + +- 사용 피드백 기준으로 팝업 위치는 현재 좌측 기준 + 세로 오프셋 `200px` 배치를 유지했다. +- 조회/다운로드 버튼을 `시군구`와 같은 수평선에서 우측 정렬되도록 다시 조정했다. +- 필터 영역 하단 여백을 줄여 버튼 아래 빈 공간이 남지 않게 보정했다. +- `UiTable`에 전달하는 외곽 마진을 제거하고, 중복 총 건수 문구를 숨겨 팝업 내부 가로/세로 스크롤 발생 가능성을 낮췄다. +- 표 영역은 현재 팝업 폭과 높이 안에서 보이도록 유지하는 방향으로 정리했다. + +## 4. 실제 수정 파일 + +- `FE_APP_ROOT/app/(map-layout)/map/components/agedPipe/AgedPipePopupPage.tsx` +- `FE_APP_ROOT/src/features/windowPopup/model/popupDefinitions.ts` +- `FE_APP_ROOT/src/features/windowPopup/model/types.ts` +- `FE_APP_ROOT/src/features/windowPopup/lib/openWindowPopup.ts` + +## 5. 구현 상세 + +### 5.1 팝업 정의 + +- `agedPipePopup` + - `width: 850` + - `height: 600` + - `placement: "browser-left"` + - `alignTop: true` + - `offsetLeft: 0` + - `offsetTop: 200` + +### 5.2 공통 팝업 유틸 + +- 기존 `center`, `browser-left` 배치 외에, 개별 팝업이 좌표를 미세 조정할 수 있도록 아래 속성을 허용했다. + - `alignTop` + - `offsetLeft` + - `offsetTop` +- 이번 라운드에서는 `agedPipePopup`만 이 옵션을 사용한다. + +### 5.3 팝업 본문 레이아웃 + +- 최상위 컨테이너에 `min-w-0`, `min-h-0` 기준을 추가했다. +- 조회조건 영역을 `시군구`와 버튼이 같은 줄에서 정렬되도록 재배치했다. +- 표는 현재 팝업 높이 안에서 하단 공백이 과도하지 않게 보이도록 구성했다. + +## 6. 영향 범위 + +- `노후관로` 목록 팝업 초기 오픈 위치 +- `노후관로` 목록 팝업 초기 오픈 폭 +- 현재 팝업 높이에서의 조건영역/표 레이아웃 +- 다른 팝업은 기본 동작을 유지하며, 이번 위치 미세조정 옵션은 사용하지 않는다. + +## 7. 남은 리스크 + +- 사용자 스크린샷 기준의 정확한 위치 체감은 실제 브라우저 수동 확인이 필요하다. +- 최소화 후 다시 열 때 사용하는 메인 화면의 미니 카드 위치는 이번 라운드 범위에 포함하지 않았다. diff --git a/apps/sn/src/features/windowPopup/lib/openWindowPopup.ts b/apps/sn/src/features/windowPopup/lib/openWindowPopup.ts index a59c2f28d..892d065d4 100644 --- a/apps/sn/src/features/windowPopup/lib/openWindowPopup.ts +++ b/apps/sn/src/features/windowPopup/lib/openWindowPopup.ts @@ -3,7 +3,7 @@ import { windowPopupDefinitions, type WindowPopupKey, } from "../model/popupDefinitions"; -import type { OpenWindowPopupParams } from "../model/types"; +import type { OpenWindowPopupParams, WindowPopupDefinition } from "../model/types"; const buildQueryString = (params: OpenWindowPopupParams = {}) => { const searchParams = new URLSearchParams(); @@ -22,11 +22,17 @@ const clamp = (value: number, min: number, max: number) => { return Math.min(Math.max(value, min), max); }; -const buildPopupFeatures = ( - width: number, - height: number, - placement: "center" | "browser-left" = "center", -) => { +const buildPopupFeatures = ({ + width, + height, + placement = "center", + alignTop = false, + offsetLeft = 0, + offsetTop = 0, +}: Pick< + WindowPopupDefinition, + "width" | "height" | "placement" | "alignTop" | "offsetLeft" | "offsetTop" +>) => { const screenLeft = window.screenX ?? window.screenLeft ?? 0; const screenTop = window.screenY ?? window.screenTop ?? 0; const outerWidth = window.outerWidth || window.screen.width; @@ -47,14 +53,16 @@ const buildPopupFeatures = ( const maxTop = availableTop + availableHeight - safeHeight - 24; const left = placement === "browser-left" - ? clamp(screenLeft, minLeft, maxLeft) + ? clamp(screenLeft + offsetLeft, minLeft, maxLeft) : clamp( - screenLeft + Math.round((outerWidth - safeWidth) / 2), + screenLeft + Math.round((outerWidth - safeWidth) / 2) + offsetLeft, availableLeft + 16, maxLeft, ); const top = clamp( - screenTop + Math.round((outerHeight - safeHeight) / 2), + alignTop + ? screenTop + 24 + offsetTop + : screenTop + Math.round((outerHeight - safeHeight) / 2) + offsetTop, minTop, maxTop, ); @@ -82,11 +90,7 @@ export const openWindowPopup = ( const definition = windowPopupDefinitions[popupKey]; const popupUrl = `/popup/${popupKey}${buildQueryString(params)}`; - const popupFeatures = buildPopupFeatures( - definition.width, - definition.height, - "placement" in definition ? definition.placement : undefined, - ); + const popupFeatures = buildPopupFeatures(definition); const popupWindow = window.open( popupUrl, `sn-popup-${popupKey}`, diff --git a/apps/sn/src/features/windowPopup/model/popupDefinitions.ts b/apps/sn/src/features/windowPopup/model/popupDefinitions.ts index a354aa7cb..846d075d9 100644 --- a/apps/sn/src/features/windowPopup/model/popupDefinitions.ts +++ b/apps/sn/src/features/windowPopup/model/popupDefinitions.ts @@ -70,8 +70,12 @@ export const windowPopupDefinitions = { agedPipePopup: { key: "agedPipePopup", title: "노후 하수관로 관리 ", - width: 1180, - height: 760, + width: 850, + height: 600, + placement: "browser-left", + alignTop: true, + offsetLeft: 0, + offsetTop: 200, }, pipeAnalysisPopup: { key: "pipeAnalysisPopup", diff --git a/apps/sn/src/features/windowPopup/model/types.ts b/apps/sn/src/features/windowPopup/model/types.ts index 904a9bc2f..6b55bee30 100644 --- a/apps/sn/src/features/windowPopup/model/types.ts +++ b/apps/sn/src/features/windowPopup/model/types.ts @@ -15,6 +15,9 @@ export type WindowPopupDefinition = { width: number; height: number; placement?: "center" | "browser-left"; + alignTop?: boolean; + offsetLeft?: number; + offsetTop?: number; requiredParams?: string[]; };