From 754e00de192f6458bddc1a729dbdfc76c7187a88 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 3 Sep 2026 14:06:11 +0900 Subject: [PATCH] =?UTF-8?q?fix(B07):=20=EC=9E=A5=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=8B=9C=20=EC=A0=95=EB=B3=B4=20=ED=8C=A8=EB=84=90=EC=9D=84=20?= =?UTF-8?q?=EC=9E=A5=20=EB=8B=A8=EC=9C=84=EB=A1=9C=20=ED=91=9C=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 장(여러 측점을 담은 횡단 도면)에는 측점 단위 지반·계획 값이 없는데도 제목이 「측점 3장 (220~264m)」으로 달려 어느 측점 값인지 오해됐다. 장이면 제목을 「장」으로 바꾸고 「이 장은 측점 여러 개를 담습니다. 지반·계획 정보는 측점 도면에서 봅니다」로 안내한다. 판정은 도면 id(`cross_s…` = 장) 로 한다 — `chainage_m` 은 장에도 첫 측점 값이 실려 와 그것으로는 갈리지 않는다(실측). 검증 — 공용 브라우저 B07: 3장(220~264m) 선택 시 `장 3장 (220~264m) · 잠정 · 이 장은 측점 여러 개를 담습니다…`, 종단도 선택 시 패널 없음(종전과 같음). typecheck·prettier 통과. Co-Authored-By: Claude Opus 5 (1M context) --- B07_DesignDetail/B07_DesignDetail_UI_Page.ts | 38 ++++++++++++++++---- ui_template/ui_template_locale_b2.ts | 7 ++++ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/B07_DesignDetail/B07_DesignDetail_UI_Page.ts b/B07_DesignDetail/B07_DesignDetail_UI_Page.ts index 575a7fd1..8fd49e2a 100644 --- a/B07_DesignDetail/B07_DesignDetail_UI_Page.ts +++ b/B07_DesignDetail/B07_DesignDetail_UI_Page.ts @@ -208,6 +208,11 @@ function cutSideLabel(mode: CrossDesignInfo["section_mode"]): string { return L("B06_Design_Mode_BothFill"); } +/** 장(여러 측점을 담은 횡단 도면)인가 — id 가 `cross_s…` 면 장이다. */ +function isCrossSheet(drawing: DesignDrawingItem): boolean { + return drawing.kind === "cross" && drawing.id.startsWith("cross_s"); +} + /** 측구 규격 표시 문자열 (design 신구조: 형식별 ditch spec, F-2 호환). */ function ditchLabel(design: CrossDesignInfo): string { const ditch = design.ditch; @@ -230,14 +235,25 @@ function infoRow(label: string, value: string): HTMLElement { return row; } -/** 선택 횡단도의 지반정보/계획정보를 2분할로 렌더한다 (잠정치, B07 확정 시 재계산). */ -function buildDesignInfoPanel(title: string, design: CrossDesignInfo | null): HTMLElement { +/** + * 선택 횡단도의 지반정보/계획정보를 2분할로 렌더한다 (잠정치, B07 확정 시 재계산). + * + * **장(여러 측점을 담은 도면)에는 측점 단위 값이 없다** — 서버가 `design` 을 넘기지 + * 않는데도 제목만 「측점 …」으로 달려 어느 측점 값인지 오해됐다(2026-09-03 정리). + * 장이면 제목을 「장」으로 바꾸고 어디서 봐야 하는지 한 줄로 알린다. + */ +function buildDesignInfoPanel( + title: string, + design: CrossDesignInfo | null, + scope: "station" | "sheet" = "station", +): HTMLElement { const panel = document.createElement("div"); panel.className = "b07-info"; const heading = document.createElement("div"); heading.className = "b07-info__heading"; const stationName = document.createElement("strong"); - stationName.textContent = `${L("B07_Info_Station")} ${title}`; + const scopeLabel = scope === "sheet" ? L("B07_Info_Sheet") : L("B07_Info_Station"); + stationName.textContent = `${scopeLabel} ${title}`; const confirmed = design?.status === "confirmed"; const badge = document.createElement("span"); badge.className = `b07-info__badge${confirmed ? " b07-info__badge--confirmed" : ""}`; @@ -248,7 +264,7 @@ function buildDesignInfoPanel(title: string, design: CrossDesignInfo | null): HT if (!design) { const empty = document.createElement("p"); empty.className = "b07-info__empty"; - empty.textContent = L("B07_Info_NoDesign"); + empty.textContent = scope === "sheet" ? L("B07_Info_SheetHint") : L("B07_Info_NoDesign"); panel.append(empty); return panel; } @@ -341,8 +357,12 @@ export async function renderB07DesignDetail(root: HTMLElement): Promise { infoPanelHost.replaceChildren(); return; } - const title = drawing.label; - infoPanelHost.replaceChildren(buildDesignInfoPanel(title, response.design ?? null)); + // 장은 id 가 `cross_s…`(여러 측점 묶음), 측점 도면은 `cross_…m` 이다. `chainage_m` 은 + // 장에도 첫 측점 값이 실려 오므로 그것으로는 갈리지 않는다. + const scope = isCrossSheet(drawing) ? "sheet" : "station"; + infoPanelHost.replaceChildren( + buildDesignInfoPanel(drawing.label, response.design ?? null, scope), + ); }; /** @@ -544,7 +564,11 @@ export async function renderB07DesignDetail(root: HTMLElement): Promise { // 확정 시 재계산된 확정 단면적으로 지반/계획 정보 패널을 갱신한다. if (currentDrawing.kind === "cross") { infoPanelHost.replaceChildren( - buildDesignInfoPanel(currentDrawing.label, result.design ?? null), + buildDesignInfoPanel( + currentDrawing.label, + result.design ?? null, + isCrossSheet(currentDrawing) ? "sheet" : "station", + ), ); } showToast("현재 도면을 확정하고 저장했습니다.", "success"); diff --git a/ui_template/ui_template_locale_b2.ts b/ui_template/ui_template_locale_b2.ts index c87995bd..893a1a3f 100644 --- a/ui_template/ui_template_locale_b2.ts +++ b/ui_template/ui_template_locale_b2.ts @@ -576,6 +576,13 @@ export const ui_locales_b2 = { B07_Info_Confirmed: ["확정", "Confirmed"], B07_Info_NoDesign: ["지반·계획 지정 데이터가 없습니다.", "No ground/plan designation data."], B07_Info_Station: ["측점", "Station"], + /* 장(여러 측점을 담은 횡단 도면)은 측점 단위 지반·계획 정보를 갖지 않는다 — + 제목을 「측점」으로 달면 어느 측점 값인지 오해된다(2026-09-03 정리). */ + B07_Info_Sheet: ["장", "Sheet"], + B07_Info_SheetHint: [ + "이 장은 측점 여러 개를 담습니다. 지반·계획 정보는 측점 도면에서 봅니다.", + "This sheet holds several stations. Ground and plan details live on each station drawing.", + ], /* --- B08_Quantity 수량 산출 --- */ B08_Quantity_Title: ["수량산출", "Quantity"],