fix(m02-cf): 원가 합계 「고칠 것」 검사에 받은 입력 값을 넘김

renderSummary 다섯째 인자 opts.values 를 checkLogic 에 전달.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EauA2ATmqNRbeV48s9CcBr
This commit is contained in:
2026-10-01 16:51:27 +09:00
co-authored by Claude Sonnet 5.5
parent 266c0a9eec
commit 833e8e5772
@@ -9,7 +9,7 @@
import { currentLanguageIndex } from "@ui/ui_template_locale";
import { createSelectField, el } from "@ui/ui_template_elements";
import { formatMoney } from "../../M01_MasterData/M01_MasterData_UI_Logic_Money";
import { checkLogic, type CfEvalResult } from "./M02_CF_Eval";
import { checkLogic, type CfEvalResult, type CfValues } from "./M02_CF_Eval";
import type { CfBox, CfLogic, CfVariable } from "./M02_CF_Model";
import { showValue } from "./M02_CF_OutputPanel";
import "./M02_CF_Summary.css";
@@ -109,12 +109,13 @@ function sampleField(
return el("label", { className: "m01-cfsum__field", children: [label, control] });
}
/** 원가 합계 칸 — result = 화면 계산 결과 · on 이 있으면 예시값을 바꿀 수 있음 */
/** 원가 합계 칸 — result = 화면 계산 결과 · on 이 있으면 예시값을 바꿀 수 있음 · opts.values = 받은 입력 값(검사가 씀) */
export function renderSummary(
host: HTMLElement,
lg: CfLogic,
result: CfEvalResult,
on?: { change(lg: CfLogic): void },
opts?: { values?: CfValues },
): void {
const money = !lg.resultUnit || lg.resultUnit.startsWith("원");
const perUnit = lg.resultUnit.split("/").slice(1).join("/");
@@ -187,7 +188,7 @@ export function renderSummary(
/* 고칠 것 — 빈 받는 자리 · 검사 · 계산 오류 */
let checked: string[] = [];
try {
checked = checkLogic(lg);
checked = checkLogic(lg, opts?.values ?? {});
} catch {
checked = [];
}