feat(B07): 종단도 장마다 우측 상단 평면 위치도 · 종단 ⚙ 「평면도」 척도 칸 (521-2 · 요구 340-2)

- 새 Engine_Cad_LongPlan — 작도 영역 우상단 5 mm 안쪽 150×100 mm 칸 · 자동 = 전체 노선 맞춤(분모 500 올림) · 척도 정함 = 이 장 중심 확대 · 밖 노선 흐린 파선 · 칸 밖 잘림 · 이 장 굵게 · 시 · 종점 측점 · 방위표 · 「평면도 S=1/n」 · 「n/N 장」 · 좌표 없으면 안 그림
- 장 나눔 — 그래프가 칸을 덮으면 측점 줄여 장 더 나눔 · 장 목록에 number · total
- 축척 — longitudinal.plan 기본 자동 · 범위 1/500~1/50,000 · ⚙ 칸 = 서버 기본값 열쇠 그대로(셋째 칸 + 자동)
- 칸 앞 확정 종단 저장본 — 목록 받을 때 종단만 한 번 모두 풂(DRAWING_FORMAT 그대로)
- 시험 — 칸 자리 · 안 겹침 · 장마다 강조 · 척도 확대 · 좌표 없음 · 한 번 풂 · plan 범위 · ⚙ 평면 칸

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 08:01:02 +09:00
co-authored by Claude Opus 5.5
parent b522a52622
commit df0e64ffe2
12 changed files with 472 additions and 37 deletions
@@ -1,6 +1,7 @@
/* =============================================================================
* B07_DesignDetail_UI_Settings_Scale.ts
* ⚙ 모달 X · Y 축척 칸(485-2 · 요구 280-5) — 종단 · 횡단 · 토적 · 전개도만.
* 종단 = 셋째 칸 「평면도」(521-2 · 우측 상단 평면 위치도) — 칸은 서버 기본값 열쇠 그대로.
*
* 칸 = 분모 정수 · 범위 밖 = 칸 붉게 + [축척 저장] 꺼짐 · 기본이 자동인 칸(토적 X · 전개도) = 「자동」
* [축척 저장] = 그 종류 저장본이 있으면 n 장 물음(취소 = 그대로) → PUT → 화면 다시 세움(도면 다시 그림)
@@ -32,10 +33,8 @@ const LABEL: Record<DrawingScaleKind, string> = {
mass_haul: "토적도",
development: "전개도",
};
const AXES = [
["x", "X(가로) 1/"],
["y", "Y(세로) 1/"],
] as const;
type Axis = keyof DrawingScaleAxes;
const AXIS_LABEL: Record<Axis, string> = { x: "X(가로) 1/", y: "Y(세로) 1/", plan: "평면도 1/" };
const isScaleKind = (kind: string): kind is DrawingScaleKind => kind in LABEL;
@@ -86,9 +85,11 @@ function buildScaleFields(
data: DrawingScales,
save: (next: DrawingScaleAxes) => Promise<void>,
): void {
const fields = AXES.map(([axis, label]) => {
const fallback = data.defaults[kind][axis];
const range = data.ranges[kind][axis];
const axes = Object.keys(data.defaults[kind]) as Axis[];
const fields = axes.map((axis) => {
const label = AXIS_LABEL[axis];
const fallback = data.defaults[kind][axis] ?? null;
const range = data.ranges[kind][axis] ?? [1, 1];
const [min, max] = range;
const field = createInputField({ label, type: "number", compact: true, min, max });
field.root.classList.add("b07-scale__field");
@@ -99,7 +100,7 @@ function buildScaleFields(
if (auto) auto.input.checked = value === null;
field.input.disabled = value === null && !!auto;
};
set(data.scales[kind][axis]);
set(data.scales[kind][axis] ?? null);
const read = () => readScaleAxis(field.input.value, !!auto?.input.checked, range);
return { axis, field, auto, fallback, set, read };
});
@@ -107,13 +108,14 @@ function buildScaleFields(
const saveButton = createButton({
label: "축척 저장",
onClick: () => {
const [x, y] = fields.map((f) => f.read()) as [number | null, number | null];
const read = fields.map((f) => [f, f.read() as number | null] as const);
const now = data.scales[kind];
if (x === now.x && y === now.y) {
if (read.every(([f, value]) => value === (now[f.axis] ?? null))) {
showToast("바뀐 축척이 없습니다.", "info");
return;
}
void save({ x: scaleToSend(x, fields[0].fallback), y: scaleToSend(y, fields[1].fallback) });
const next = Object.fromEntries(read.map(([f, v]) => [f.axis, scaleToSend(v, f.fallback)]));
void save(next as DrawingScaleAxes);
},
});
// 칸 밑 오류 글은 숨기고(틀린 칸만 길어짐) 줄 아래 한 줄로 알림
@@ -127,7 +129,8 @@ function buildScaleFields(
const result = f.read();
const message = typeof result === "string" ? result : undefined;
f.field.setError(message);
if (message) errors.set(message, [...(errors.get(message) ?? []), f.axis.toUpperCase()]);
const name = f.axis === "plan" ? "평면도" : f.axis.toUpperCase();
if (message) errors.set(message, [...(errors.get(message) ?? []), name]);
}
alertLine.textContent = [...errors].map(([m, axes]) => `${axes.join(" · ")}: ${m}`).join(" / ");
alertLine.hidden = errors.size === 0;