- 새 formula_doc_renew.ts(확인창 부품 + 표) · [확인] = 저장(다시 안 뜸) · [나중에] = 다음에 또 - line_stack_screen 두 곳(단추 줄 조건 · 열기 뒤 알림) · 프로젝트 층 = 단추 그대로 - 내 기계 글 셋 = 「새 값」 → [단가 갱신] 안내를 자동 따라옴으로 · 알림 글 금액 줄 꼴 다듬음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.8 KiB
TypeScript
46 lines
1.8 KiB
TypeScript
/* =============================================================================
|
|
* formula_doc_renew.ts
|
|
* M01 자동 따라옴 알림(PLAN 836-2 · 요구 854) — M02 단가산출(프로젝트 층 밖)을 열 때
|
|
* M01 에서 바뀐 항목에 얹힌 내 고침을 지우고 다시 복사한 것을 한 번 보임(서버 `M02_Sk_AutoRenew.notes`)
|
|
* 표 = 항목 · M01 전 → 후 · 지워진 내 고침 · [확인] = 저장(다시 안 뜸) · [나중에] = 다음에 열면 또 뜸
|
|
* 고침 없는 항목은 조용히 따라옴(알림 없음)
|
|
* ========================================================================== */
|
|
|
|
import { askConfirm, el } from "@ui/ui_template_elements";
|
|
import { createTable } from "@ui/ui_template_table";
|
|
import { ft } from "./formula_doc_text";
|
|
|
|
/** 서버 알림 한 줄 — 갈래 = 문서(바탕 수식) · 부름(굳힌 부른 문서) · 기계(기계 덮음) */
|
|
export interface RenewNote {
|
|
키: string;
|
|
이름?: string;
|
|
갈래?: string;
|
|
M01?: string[];
|
|
내고침?: string[];
|
|
}
|
|
|
|
/** 칸 안 여러 줄 — 줄마다 한 덩이 */
|
|
const lines = (xs: string[] | undefined): HTMLElement =>
|
|
el("div", { children: (xs ?? []).map((t) => el("div", { text: t })) });
|
|
|
|
/** 알림 창 — 확인이면 true(부르는 쪽이 저장) */
|
|
export function askRenew(notes: RenewNote[]): Promise<boolean> {
|
|
const table = createTable(
|
|
[
|
|
{ label: ft("Renew_Item"), width: "28%" },
|
|
{ label: ft("Renew_M01") },
|
|
{ label: ft("Renew_Mine") },
|
|
],
|
|
notes.map((n) => [lines([n.이름 || n.키, n.키]), lines(n.M01), lines(n.내고침)]),
|
|
{ density: "data" },
|
|
);
|
|
table.dataset.renewNotes = String(notes.length);
|
|
return askConfirm({
|
|
title: ft("Renew_Title"),
|
|
message: ft("Renew_Ask"),
|
|
okLabel: ft("Renew_Ok"),
|
|
cancelLabel: ft("Renew_Later"),
|
|
detail: table,
|
|
});
|
|
}
|