feat(M01): 로직 개선 시험 — 자체 로직(GX) 상세도 정본과 같은 컨테이너 넷 · 고치면 호표 소계와 텍스트 수식이 다시 계산됨

- 기본정보 칸(번호·이름·단위·출처)을 자체 로직이면 고칠 수 있게 · 호표 묶음·소계 아래에 편집기(입력·호표·중간 값·덧줄·끝수)를 폄
- 고친 뒤 0.7 초 쉬면 시험 계산을 다시 눌러 소계 · 텍스트 수식을 새로 그림 · 편집기 칸은 다시 그려도 그대로 씀
- ORCA 본뜬 GX — 컨테이너 넷 정본과 같음 · 증가율 고침 203,281.2→223,609.32 소계·텍스트 수식 계 같이 바뀜 · 시험 자료·키 대장 되돌림

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:58:38 +09:00
co-authored by Claude Sonnet 5
parent 6b5ae4a263
commit 96e58106bb
4 changed files with 80 additions and 28 deletions
+12 -1
View File
@@ -33,7 +33,7 @@ import { buildCalc } from "./M01_MasterData_UI_Logic_Calc";
import { buildList, logicId, type ListItem, type ListMark } from "./M01_MasterData_UI_Logic_List";
import type { SideHandle } from "./M01_MasterData_UI_Side";
import { tx } from "./M01_MasterData_UI_Logic_Text";
import { buildLabDetail } from "./M01_MasterData_UI_LogicLab_Detail";
import { buildLabDetail, isOwnLogic } from "./M01_MasterData_UI_LogicLab_Detail";
import { buildNewLogic } from "./M01_MasterData_UI_LogicLab_New";
import { tn } from "./M01_MasterData_UI_LogicLab_New_Text";
import "./M01_MasterData_UI_Logic_Style.css";
@@ -56,10 +56,12 @@ interface Opened extends Draft {
reasons: string[];
lines: CalcLine[] | null;
text: TextAnswer | null;
ownHost: HTMLElement;
values: Record<string, string>;
}
const cacheKey = "m01_logic_drafts_lab";
const ownHost = (): HTMLElement => el("div", { className: "m01lab__own" });
const clone = <T>(v: T): T => JSON.parse(JSON.stringify(v)) as T;
function loadDrafts(): Record<string, Draft> {
@@ -84,6 +86,7 @@ export async function mountM01LogicLab(
let opened: Opened | null = null;
let creating = false; // 「식으로 새로 만들기」 화면이 열려 있음
let calcInputs = "";
let recalc: number | undefined;
const editor = el("div", { className: "m01-logic__editor" });
const errors = el("div", { className: "m01-logic__reasons", attrs: { hidden: "" } });
const calc = el("div", { className: "m01lab__calc" });
@@ -134,6 +137,11 @@ export async function mountM01LogicLab(
persist();
const inputs = JSON.stringify(opened.row.입력 ?? []);
if (inputs !== calcInputs) drawCalc();
if (isOwnLogic(opened.row)) {
// 자체 로직 — 고친 뒤 잠시 쉬면 다시 계산해 호표 소계와 텍스트 수식을 새로 그림
window.clearTimeout(recalc);
recalc = window.setTimeout(() => calc.querySelector("button")?.click(), 700);
}
};
const pick = (o: Opened, row: LogicRow | null): Draft => ({
@@ -191,6 +199,7 @@ export async function mountM01LogicLab(
lines: current.lines,
text: current.text,
values: current.values,
ownHost: current.ownHost,
onChange: touch,
calcHost: calc,
});
@@ -215,6 +224,7 @@ export async function mountM01LogicLab(
reasons: [],
lines: null,
text: null,
ownHost: ownHost(),
values: {},
});
return;
@@ -233,6 +243,7 @@ export async function mountM01LogicLab(
reasons: one.reasons,
lines: null,
text: null,
ownHost: ownHost(),
values: {},
});
} catch (error) {