fix(M01): 로직 개선 시험 — 자체 로직(GX)에는 「기본 로직은 고치지 못함」 문구 대신 고치는 편집기를 냄

- `isOwnLogic`(키 GX…)이면 기본정보 · 호표 자리에 정본 화면과 같은 편집기 · 정본 로직은 그대로 읽기 전용
- ORCA 견본 GX 초안 — 문구 없음 · 입력칸 51개 · 정본 13-4-1 소계 203,281.2 그대로

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WRFJmmhPi4exAzHgPZHMT
This commit is contained in:
2026-09-21 20:53:04 +09:00
co-authored by Claude Sonnet 5
parent edbfd846a2
commit 8a9721fa8f
@@ -15,7 +15,8 @@ import type {
NamedFormula,
TextAnswer,
} from "./M01_MasterData_UI_Logic_Api";
import { formatNumber, qtyKind } from "./M01_MasterData_UI_Logic_Edit";
import { buildEditor, formatNumber, qtyKind } from "./M01_MasterData_UI_Logic_Edit";
import { openPicker } from "./M01_MasterData_UI_Logic_Pick";
import { tx } from "./M01_MasterData_UI_Logic_Text";
import { buildFormula } from "./M01_MasterData_UI_LogicLab_Formula";
import { openMaterialModal } from "./M01_MasterData_UI_LogicLab_Modal";
@@ -280,13 +281,33 @@ function hoBox(ctx: DetailContext): HTMLElement {
return section(tl("Ho_Title"), blocks, hint);
}
/** 자체 로직(키 GX…) — 정본은 아님 */
export const isOwnLogic = (row: LogicRow): boolean => row..startsWith("GX");
/** 자체 로직은 고치는 화면(정본 로직 화면과 같은 편집기) 하나로 기본정보 · 호표를 대신함 */
function ownBox(ctx: DetailContext): HTMLElement {
const host = el("div");
buildEditor(host, {
row: ctx.row,
file: ctx.file,
isNew: false,
files: [],
reasons: ctx.reasons,
prices: ctx.prices,
lines: ctx.lines,
onChange: ctx.onChange,
onFile: () => undefined,
onPick: openPicker,
});
return section(tl("Info_Title"), [host]);
}
/** 상세 화면 넷을 `host` 에 쌓음 */
export function buildLabDetail(host: HTMLElement, ctx: DetailContext): void {
const formula = el("div", { className: "m01lab__formula" });
buildFormula(formula, { text: ctx.text });
host.replaceChildren(
infoBox(ctx),
hoBox(ctx),
...(isOwnLogic(ctx.row) ? [ownBox(ctx)] : [infoBox(ctx), hoBox(ctx)]),
section(tl("Formula_Title"), [formula]),
section(tl("Calc_Title"), [ctx.calcHost]),
);