From 545602f24de84845824a6c6fa0692fcfd09a5a3a Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 1 Oct 2026 12:19:48 +0900 Subject: [PATCH] =?UTF-8?q?fix(M01-=EB=A1=9C=EC=A7=81=ED=8C=90):=20Steps?= =?UTF-8?q?=20=EB=8B=A4=EB=A5=B8=20=EC=9D=BC=EC=9C=84=EB=8C=80=EA=B0=80=20?= =?UTF-8?q?=EA=B2=B0=EA=B3=BC=EB=A5=BC=20=EB=A1=9C=EC=A7=81=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=EC=9C=BC=EB=A1=9C=20=EB=B3=B4=EC=9E=84=20-=20?= =?UTF-8?q?=EB=AA=BB=20=EC=B0=BE=EC=9C=BC=EB=A9=B4=20=EB=8B=A4=EB=A5=B8=20?= =?UTF-8?q?=EC=9D=BC=EC=9C=84=EB=8C=80=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01D2nUMUMTsqm93PbQtipo6c --- M01_MasterData/LogicBuilder/M01_LB_Steps.ts | 24 ++++++++++++++++++- .../LogicBuilder/M01_LB_Steps_Cell.ts | 7 ++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/M01_MasterData/LogicBuilder/M01_LB_Steps.ts b/M01_MasterData/LogicBuilder/M01_LB_Steps.ts index 9e92ed7e1..0dca8c47b 100644 --- a/M01_MasterData/LogicBuilder/M01_LB_Steps.ts +++ b/M01_MasterData/LogicBuilder/M01_LB_Steps.ts @@ -6,7 +6,12 @@ * ========================================================================== */ import { createButton, el, showToast } from "@ui/ui_template_elements"; -import type { CalcAnswer, CalcLine, LogicInput } from "../M01_MasterData_UI_Logic_Api"; +import { + fetchLogics, + type CalcAnswer, + type CalcLine, + type LogicInput, +} from "../M01_MasterData_UI_Logic_Api"; import { formatMoney } from "../M01_MasterData_UI_Logic_Money"; import { addCard, @@ -23,6 +28,7 @@ import { setCond, type LbLogic, type LbLookup, type LbRef } from "./M01_LB_Block import { calcBody, calcView } from "./M01_LB_Steps_Calc"; import { chip, + logicNames, lookupValue, note, numBox, @@ -42,6 +48,7 @@ import "./M01_LB_Steps.css"; type Kind = "person" | "material" | "machine" | "logic" | "percent" | "locked"; let picking = false; +let namesLoading = false; /* ------------------------------ ① 입력값 ------------------------------ */ @@ -367,4 +374,19 @@ export function renderSteps( ), section(tx("S5"), [el("li", { className: "m01-lbsteps-row", children: [resultView(ctx)] })]), ); + // 다른 일위대가 이름 — 목록을 한 번 받은 뒤 다시 그림 + if ( + !logicNames.size && + !namesLoading && + JSON.stringify([lb.calcs, lb.lookups]).includes('"k":"logic"') + ) { + namesLoading = true; + fetchLogics() + .then((all) => { + for (const l of all) logicNames.set(l.키, l.이름); + renderSteps(host, lb, ans, on); + }) + .catch(() => undefined) + .finally(() => (namesLoading = false)); + } } diff --git a/M01_MasterData/LogicBuilder/M01_LB_Steps_Cell.ts b/M01_MasterData/LogicBuilder/M01_LB_Steps_Cell.ts index e3b1ae55d..35a73f203 100644 --- a/M01_MasterData/LogicBuilder/M01_LB_Steps_Cell.ts +++ b/M01_MasterData/LogicBuilder/M01_LB_Steps_Cell.ts @@ -33,7 +33,7 @@ export const TEXT = { SrcCalc: ["계산 · ", "calc · "], SrcFixed: ["고정값", "fixed value"], SrcAny: ["무관(조건에서 뺌)", "any (remove condition)"], - Other: ["다른 일위대가 결과", "Other unit price result"], + Other: ["다른 일위대가", "Other unit price"], Hard: ["이 화면에서 못 고치는 값", "Value not editable here"], Mul: ["×", "×"], Div: ["÷", "÷"], @@ -197,6 +197,9 @@ export const isRef = (r: Ref, k: "lookup", id: string): boolean => r.k === k && export const lookupNo = (ctx: Ctx, id: string): number => ctx.lb.lookups.findIndex((l) => l.id === id) + 1; +/** 로직 이름 — 목록을 한 번 받아 채움(키 → 이름) · 못 받으면 「다른 일위대가」 */ +export const logicNames = new Map(); + export function refText(ctx: Ctx, r: Ref): string { switch (r.k) { case "input": @@ -210,7 +213,7 @@ export function refText(ctx: Ctx, r: Ref): string { return `${tx("LkNum")}${lookupNo(ctx, r.id)}${lk ? ` · ${lk.col}` : ""}`; } case "logic": - return `${tx("Other")} ${r.key}${r.field ? ` · ${r.field}` : ""}`; + return `${logicNames.get(r.key) ?? tx("Other")}${r.field ? ` · ${r.field}` : ""}`; case "cost": return tx(`Base_${r.name}`); default: