diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts index ff323a85..5d81ccc7 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts @@ -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]), );