feat(848-3): 제어 구역 층 색 · 「고침」 글 걷음 · 기계 한 줄 되돌림 · M01 기초 제어 구역 엶 · 기초 [초기화] · 알림 지킴 줄 [위 값으로]
- 셈 · 산출근거 · 제어 구역 = layeredCover(문서, 위덮음) · 기본 = upperOf · putCover(…, ①) · 칸 테두리 = sourcesOf(나 파랑 · 위 주황) - 작업량 묶음 = mergeWork(①, ②) · ① 과 다른 칸만(pruneWorkLayer) · 위 층 시간당이면 일당 = 내 고침 - 기계 줄 머리 = 이름 단추 테두리 + [원래 값](그 기계 고침 통째) · 기계 보기 저장 안 한 바뀜 = 파랑 - M01 단가산출 기초 = 시스템 관리자에게 제어 구역 엶 · 머리 [초기화] = 기계 고침 목록 확인 → 걷고 저장 - 갱신 알림 = 지킴 줄 따로 표(위 값 전 → 후 · 내 값 · [위 값으로] = 그 칸 고침 지움 → [저장]) · 다시복사 · 지워짐 = 지금 꼴 - 걷기 셈 = common_util_formula_doc_cover_drop.ts(dropCover · dropPath) · 시험 test_848_3_cover_drop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* ========================================================================== */
|
||||
|
||||
import { createBadge } from "@ui/ui_template_badge";
|
||||
import { createButton, createIconButton } from "@ui/ui_template_button";
|
||||
import { createButton, createIconButton, setUiDiff } from "@ui/ui_template_button";
|
||||
import { createRowMenu } from "@ui/ui_template_context_menu";
|
||||
import { eqText } from "@ui/ui_template_equation";
|
||||
import { el, showToast } from "@ui/ui_template_elements";
|
||||
@@ -20,7 +20,12 @@ import { varId, type FormulaDoc, type MoneyLine } from "../common_util/common_ut
|
||||
import { isNum, type DocAnswer } from "../common_util/common_util_formula_doc_calc";
|
||||
import { lineMap, offLine, type Values } from "../common_util/common_util_formula_doc_view";
|
||||
import type { DocTable } from "../common_util/common_util_formula_doc_table";
|
||||
import { coverOf, type CoverEntry } from "../common_util/common_util_formula_doc_cover";
|
||||
import {
|
||||
coverOf,
|
||||
layeredCover,
|
||||
type Cover,
|
||||
type CoverEntry,
|
||||
} from "../common_util/common_util_formula_doc_cover";
|
||||
import { HOURLY, Q_NEW, swap, workKey } from "../common_util/common_util_formula_doc_work";
|
||||
import { workAt } from "../common_util/common_util_line_stack_work";
|
||||
import { machineText } from "./formula_doc_options";
|
||||
@@ -56,6 +61,7 @@ import { hiddenByWork, reach } from "./formula_doc_render";
|
||||
import { attachDrag } from "./line_stack_drag";
|
||||
import type { WorkSpec } from "../common_util/common_util_formula_doc_work";
|
||||
import { openMachineWindow, type MachineCtx } from "./line_stack_machine";
|
||||
import { dropCover } from "../common_util/common_util_formula_doc_cover_drop";
|
||||
import { buildMachineCtl, lineCall } from "./line_stack_machine_ctl";
|
||||
import { putWork, swapMachine } from "./line_stack_machine_work";
|
||||
import { openStackPick, type StackTake } from "./line_stack_pick";
|
||||
@@ -89,6 +95,10 @@ export interface EditHooks {
|
||||
look?: TableLook;
|
||||
/** 846-2 그 기계 작업량 줄 */
|
||||
work?: (machine: string) => WorkSpec[];
|
||||
/** 848-3 ① 위 층 고침(SK 읽기 답 `위덮음` · M01 = 없음) */
|
||||
upper?: Cover | null;
|
||||
/** 848-3 M01 기초 제어 구역 엶(시스템 관리자) — M02 = 층(`machine.scope`)이 엶 */
|
||||
ctlEdit?: boolean;
|
||||
}
|
||||
|
||||
const field = (
|
||||
@@ -188,12 +198,14 @@ function moneyBody(h: EditHooks, i: number): HTMLElement[] {
|
||||
if (kind === "재료") void askFileWide(h.machine, d, own, p); // 827-3 같은 파일 같은 재료
|
||||
};
|
||||
// 847-1 시간당 식 줄 = 굳은 기계를 덮음으로 바꿈(문서 줄 연결은 그대로 — 일당으로 되돌리면 옵션 기계)
|
||||
const wkey = w ? workKey(coverOf(d), w) : "";
|
||||
const want = hourly ? (coverOf(d)[wkey] as CoverEntry | undefined)?.작업량 : undefined;
|
||||
const lay = layeredCover(d, h.upper); // 848-3 ① 위에 ②
|
||||
const wkey = w ? workKey(lay, w) : "";
|
||||
const want = hourly ? (lay[wkey] as CoverEntry | undefined)?.작업량 : undefined;
|
||||
const upWork = (h.upper?.[wkey] as CoverEntry | undefined)?.작업량 ?? null;
|
||||
const fixed = hourly && w?.고정 ? w.고정 : "";
|
||||
const swapFixed = (p: Picked): void => {
|
||||
const got = swapMachine(want ?? { 방식: HOURLY }, w!, p, p.키 === link.키, h.work?.(fixed) ?? []); // prettier-ignore
|
||||
h.change((doc) => putWork(doc, wkey, got.next));
|
||||
h.change((doc) => putWork(doc, wkey, got.next, upWork));
|
||||
if (got.note) showToast(got.note, "info");
|
||||
};
|
||||
const label = fixed
|
||||
@@ -237,9 +249,17 @@ function moneyBody(h: EditHooks, i: number): HTMLElement[] {
|
||||
});
|
||||
t.dataset.mctlToggle = String(i);
|
||||
head.push(t);
|
||||
const m = lineCall(d, h.answer, link, i);
|
||||
if (coverOf(d)[m.work] || coverOf(d)[String(m.given.기계 ?? "")])
|
||||
head.push(createBadge(lt("Ctl_Changed"), "info", { size: 18 }));
|
||||
// 848-3 고친 기계 = 이름 단추 테두리(나 = 파랑 · 위 층 = 주황) · ㉢ 기계 한 줄 통째 [원래 값]
|
||||
const m = lineCall(d, h.answer, link, i, h.upper);
|
||||
const keys = [...new Set([m.work, String(m.given.기계 ?? "")])].filter(Boolean);
|
||||
const mine = keys.some((k) => coverOf(d)[k]);
|
||||
setUiDiff(pick, mine ? "mine" : keys.some((k) => h.upper?.[k]) ? "upper" : null);
|
||||
if (mine && (h.machine?.scope || h.ctlEdit)) {
|
||||
const back = createButton({ label: lt("Ctl_Back"), variant: "ghost", size: 24, iconStart: "undo", onClick: () => h.change((doc) => dropCover(doc, keys)) }); // prettier-ignore
|
||||
back.title = lt("Ctl_Line_Back");
|
||||
back.dataset.mctlLineBack = String(i);
|
||||
head.push(back);
|
||||
}
|
||||
}
|
||||
const mark = machineMark(found, link);
|
||||
if (mark) head.push(mark);
|
||||
@@ -551,7 +571,7 @@ export function buildEdit(h: EditHooks): HTMLElement {
|
||||
if (line.꼴 === "금액" && h.calc && h.open.has(`mctl:${line.i}`)) {
|
||||
const own = ownedOf(h.doc).get(line.i);
|
||||
const zone = buildMachineCtl(
|
||||
{ ...h, calc: h.calc, change: (fn) => h.change((d) => fn(d)), readOnly: !h.machine?.scope }, // prettier-ignore
|
||||
{ ...h, calc: h.calc, change: (fn) => h.change((d) => fn(d)), readOnly: !(h.machine?.scope || h.ctlEdit) }, // prettier-ignore
|
||||
h.doc.변수?.find((x) => varId(x) === own)?.연결,
|
||||
line.i,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user