fix(M02): 구조물 조합 표 「일위대가」 줄 = 그 열 일위대가번(SU) — 옛 조합 키(UA) 칸 안 읽음 · 번호 글 줄(도면 · 면적산출과 같음)

- 표 부품: 일위대가 줄도 번호 글 줄(손으로 못 침 · laborLabel) · 조회 후 선택이 열 칸을 안 고침
- 누르면 다른 줄과 같은 길(일위대가 복사해 가져오기) · 열의 옛 「일위대가」 값은 파일에 그대로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
2026-10-04 22:08:06 +09:00
co-authored by Claude Opus 5.5
parent 26a24889e6
commit 6541b65834
5 changed files with 37 additions and 21 deletions
+11 -9
View File
@@ -17,6 +17,7 @@ import {
isBlankPick,
isCalcColumn,
KEY_AREA,
KEY_PRICE,
KEY_UNIT,
MASTER_ROWS,
type MasterRowKey,
@@ -38,7 +39,8 @@ export interface RenderState {
mode: SheetMode;
result: SheetResult;
sel: { r: string; c: string } | null;
/** 도면 · 면적산출 줄 칸 글(열 id) — 없거나 빈 글이면 「없음」. */
/** 일위대가 · 도면 · 면적산출 줄 칸 글(열 id) — 없거나 빈 글이면 「없음」. */
laborLabel?: (colId: string) => string;
drawingLabel?: (colId: string) => string;
areaLabel?: (colId: string) => string;
/** 조회 후 선택 줄(`PICK_ROWS`)을 고름으로 받나 — 칸 겉모양만. */
@@ -51,9 +53,13 @@ export interface RenderState {
headEditable?: boolean;
}
/** 도면 · 면적산출 줄 칸 글. */
/** 일위대가 · 도면 · 면적산출 줄 칸 글(번호). */
export const refText = (state: RenderState, key: string, colId: string): string =>
(key === KEY_AREA ? state.areaLabel : state.drawingLabel)?.(colId)?.trim() || st("Drawing_None");
(key === KEY_AREA
? state.areaLabel
: key === KEY_PRICE
? state.laborLabel
: state.drawingLabel)?.(colId)?.trim() || st("Drawing_None");
/** 열 폭 — 저장 폭(없으면 기본) · 머리 글이 안 잘리는 최소 폭보다 좁지 않게. */
const columnWidth = (doc: SheetDoc, col: SheetColumn, mins: Map<string, number>): number =>
@@ -68,7 +74,7 @@ function fitMeta(state: RenderState, cols: SheetColumn[], mins: Map<string, numb
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
const font = `400 ${rem * 0.76}px ${getComputedStyle(document.body).fontFamily}`;
for (const col of cols) {
const texts = [col.일위대가 ?? "", ...REF_ROWS.map((key) => refText(state, key, col.id))];
const texts = REF_ROWS.map((key) => refText(state, key, col.id));
const need = Math.ceil(Math.max(...texts.map((t) => textWidth(t, font)))) + 14;
mins.set(col.id, Math.max(mins.get(col.id) ?? 0, need));
}
@@ -191,11 +197,7 @@ export function renderSheet(state: RenderState): HTMLElement {
const tr = el("tr", { className: "ui-sheet__meta", children: [gutter("th", st(label))] });
cols.forEach((col, j) => {
const blank = isBlankPick(key, col);
const text = blank
? ""
: REF_ROWS.includes(key)
? refText(state, key, col.id)
: (col.일위대가 ?? "");
const text = blank ? "" : refText(state, key, col.id); // 마스터 줄 = 모두 번호 글
const td = bodyCell(key, col, j, text);
td.classList.remove("is-num");
if (state.pick && PICK_ROWS.includes(key) && !blank) td.classList.add("is-pick");