fix(B07): 장 선택 시 정보 패널을 장 단위로 표기
장(여러 측점을 담은 횡단 도면)에는 측점 단위 지반·계획 값이 없는데도 제목이 「측점 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) <noreply@anthropic.com>
This commit is contained in:
@@ -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<void> {
|
||||
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<void> {
|
||||
// 확정 시 재계산된 확정 단면적으로 지반/계획 정보 패널을 갱신한다.
|
||||
if (currentDrawing.kind === "cross") {
|
||||
infoPanelHost.replaceChildren(
|
||||
buildDesignInfoPanel(currentDrawing.label, result.design ?? null),
|
||||
buildDesignInfoPanel(
|
||||
currentDrawing.label,
|
||||
result.design ?? null,
|
||||
isCrossSheet(currentDrawing) ? "sheet" : "station",
|
||||
),
|
||||
);
|
||||
}
|
||||
showToast("현재 도면을 확정하고 저장했습니다.", "success");
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user