From 889f746a61c4aab20282c0f2e3d48eada70db975 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 29 Aug 2026 15:45:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(B06):=20=ED=8F=BC=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B4=80=20=EC=98=B5=EC=85=98=EC=9D=84=20=EA=B3=A0=EC=B9=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EA=B2=8C=20=ED=95=98=EA=B3=A0=20=EB=8B=A8?= =?UTF-8?q?=20=EC=88=98=C2=B7=EC=98=B5=EC=85=98=20=ED=96=89=EC=9D=84=20?= =?UTF-8?q?=EB=90=98=EC=82=B4=EB=A6=B0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2026-08-29 사용자 보고 두 건: ① 값을 고치고 [수정]하면 '추가·이동·삭제는 B05에서' 안내만 떴다 — B06에서 관 옵션 저장 경로가 없었다. 조정창 구간값과 같은 저장기(culvertOptions.queue)로 보내 캐시에 예약하고 [저장]·[확정]이 정본에 쓴다. 기준점 이동만 배수유역 재분할이 걸려 B05 몫으로 남기고, 안내 문구도 추가·삭제/이동으로 나눴다. ② 연동·경사 옵션과 단 수 행이 구조물 배치에서 사라졌다 — 그 행들은 고른 벽에 딸린 것이라 도면에서 벽을 찍기 전에는 이식될 창 자체가 없었다. 시설을 폼에 올릴 때 대표 벽(유출 기준벽, 없으면 유입)을 함께 골라 행이 서게 한다. 검증: 목록에서 배수관 선택 → 유출구 그룹에 [추가 기슭막이(단)]·[옵션] 표시. 길이 + 후 [수정] → '수정한 값은 [저장]·[확정] 때 반영됩니다' + 세션 b06:culvertopt에 inlet_revet_length_m 11 예약 확인. typecheck 통과. --- B06_Section/B06_Section_UI_Page.ts | 17 ++++++++++ .../B06_Section_UI_Page_Station_Controls.ts | 3 ++ .../B06_Section_UI_Page_Structures_Panel.ts | 33 ++++++++++++++++--- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/B06_Section/B06_Section_UI_Page.ts b/B06_Section/B06_Section_UI_Page.ts index 190cd214..b1b725f6 100644 --- a/B06_Section/B06_Section_UI_Page.ts +++ b/B06_Section/B06_Section_UI_Page.ts @@ -138,6 +138,7 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise { projectId, stationInterval: () => stationInterval ?? 20, focusChainage: focusStationAt, + queuePipeOptions: (chainageM, patch) => stationControls.queueCulvertOptions(chainageM, patch), }); const dockDivider = document.createElement("hr"); dockDivider.className = "b05-structure__divider"; @@ -483,8 +484,24 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise { const owner = stationControls.structureSpan.ownerOf(target); structuresPanel.showAtChainage(owner?.chainage_m ?? target.chainage_m); structureSelection.syncInletStructure(); + selectDefaultWall(owner ?? target); }); + /** + * 시설을 폼에 올릴 때 **대표 벽**(유출 기준벽, 없으면 유입)을 함께 고른다 — + * 단 수·옵션 행은 고른 벽에 딸린 것이라 벽이 없으면 유입구·유출구 그룹이 빈다 + * (2026-08-29 사용자 보고). 이미 고른 벽이 있으면 건드리지 않는다. + */ + function selectDefaultWall(section: NonNullable["cross_sections"][number]) { + const culvert = section.culvert; + if (!culvert) return; + if (stationControls.revetOffset.selectedFor(section)) return; + const key = culvert.outlet ? "outlet" : culvert.inlet ? "inlet" : null; + if (!key) return; + stationControls.revetOffset.select(section.chainage_m, key); + sectionView.refreshCard(section.chainage_m); + } + // 메인 영역: 종·횡단 도면(sectionView) 또는 안내 메시지를 표시한다. const mainArea = document.createElement("div"); mainArea.className = "b06-profile__main"; diff --git a/B06_Section/B06_Section_UI_Page_Station_Controls.ts b/B06_Section/B06_Section_UI_Page_Station_Controls.ts index 2decf785..fb87de56 100644 --- a/B06_Section/B06_Section_UI_Page_Station_Controls.ts +++ b/B06_Section/B06_Section_UI_Page_Station_Controls.ts @@ -96,6 +96,8 @@ export interface StationControls { extraSpansByChainage: () => Map>; /** 예약된 구간값 저장을 즉시 내보낸다 — 확정·임시저장 직전에 부른다. */ flushCulvertOptions: () => Promise; + /** 관 옵션 조각을 예약한다 — 좌측 폼의 [수정]도 이 경로로 정본에 간다(2026-08-29). */ + queueCulvertOptions: (chainageM: number, patch: Record) => void; load: () => void; /** 전체 반영 — 개별 반폭을 전역값으로 덮는다(없으면 비운다). */ applyGlobalWidth: (requested: number | undefined, chainages: number[]) => void; @@ -810,6 +812,7 @@ export function createStationControls(deps: StationControlDeps): StationControls return result; }, flushCulvertOptions: () => culvertOptions.flush(), + queueCulvertOptions: (chainageM, patch) => culvertOptions.queue(chainageM, patch), load: () => { loadStationWidths(); loadRevetShifts(); diff --git a/B06_Section/B06_Section_UI_Page_Structures_Panel.ts b/B06_Section/B06_Section_UI_Page_Structures_Panel.ts index 36a85d9a..679e1f7d 100644 --- a/B06_Section/B06_Section_UI_Page_Structures_Panel.ts +++ b/B06_Section/B06_Section_UI_Page_Structures_Panel.ts @@ -28,7 +28,8 @@ import { adjustDockRoot, resetAdjustDock, setAdjustSideSlots } from "./B06_Secti import type { SectionDetailResponse } from "./B06_Section_Api_Fetch"; import type { StationControls } from "./B06_Section_UI_Page_Station_Controls"; -const PIPE_GUIDE = "계곡 통과 시설의 추가·이동·삭제는 B05(종단) 화면에서 합니다."; +const PIPE_ADD_GUIDE = "계곡 통과 시설의 추가·삭제는 B05(종단) 화면에서 합니다."; +const PIPE_MOVE_GUIDE = "기준 측점 이동은 배수유역을 다시 나눠야 해 B05(종단) 화면에서 합니다."; export interface B06StructuresPanelDeps { projectId: string | null; @@ -36,6 +37,9 @@ export interface B06StructuresPanelDeps { stationInterval: () => number; /** 목록·폼에서 고른 시설의 측점 카드를 선택·스크롤한다. */ focusChainage: (chainageM: number) => void; + /** 폼 [수정]으로 바뀐 관 옵션을 캐시에 예약한다 — [저장]·[확정]이 정본에 쓴다 + * (2026-08-29: 조정창 구간값과 같은 경로). 없으면 안내만 한다. */ + queuePipeOptions?: (chainageM: number, patch: Record) => void; } export interface B06StructuresPanel { @@ -93,9 +97,30 @@ export function createB06StructuresPanel(deps: B06StructuresPanelDeps): B06Struc if (structure) deps.focusChainage(structureAnchorM(structure)); }, getInterval: deps.stationInterval, - onPipeAdd: () => showToast(PIPE_GUIDE, "error"), - onPipeUpdate: () => showToast(PIPE_GUIDE, "error"), - onPipeRemove: () => showToast(PIPE_GUIDE, "error"), + onPipeAdd: () => showToast(PIPE_ADD_GUIDE, "error"), + // 값 수정은 B06에서도 받는다 — 조정창 구간값과 같은 저장 경로(캐시 예약 → + // [저장]·[확정])로 보낸다. 기준점 이동만 배수유역 재분할이 걸려 B05 몫이다. + onPipeUpdate: (fromChainageM, toChainageM, attributes) => { + if (Math.abs(fromChainageM - toChainageM) > 0.005) { + showToast(PIPE_MOVE_GUIDE, "error"); + return; + } + const patch = attributes.options; + if (!patch || !Object.keys(patch).length) return; + if (!deps.queuePipeOptions) { + showToast(PIPE_ADD_GUIDE, "error"); + return; + } + deps.queuePipeOptions(fromChainageM, patch as Record); + // 화면 캐시(목록·폼 재로드용)도 같이 맞춘다 — 저장 전에도 값이 유지된다. + const hit = pipeFacilities.find( + (entry) => Math.abs(entry.chainage_m - fromChainageM) < PIPE_MATCH_M, + ); + if (hit) hit.options = { ...(hit.options ?? {}), ...patch }; + section.setPipeFacilities(pipeFacilities); + showToast("수정한 값은 [저장]·[확정] 때 반영됩니다.", "success"); + }, + onPipeRemove: () => showToast(PIPE_ADD_GUIDE, "error"), onPipeSelect: (chainageM) => { if (chainageM !== null) deps.focusChainage(chainageM); },