- 설계내역서 sums = 빈 줄이 있어도 아는 비목 합 + blank(파이썬 · TS 짝 · 관급은 그대로) - 총괄 · 원가계산서 표 위 공용 띠(경고) — 탭 표 banner 칸 - [인쇄 미리보기] · [>] = 빈 줄 있으면 알림 뒤 머묾(DRAFT.blocked) · 서버 확정(complete) = 정본으로 다시 셈 · 빈 줄 있으면 409 - 설계내역서 안내 글 줄 고침 · 낡은 시험(sums None · 패널 줄 · [>] 흉내) 갱신 · 시험 test_701_3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.5 KiB
TypeScript
33 lines
1.5 KiB
TypeScript
/* =============================================================================
|
|
* B09_Draft_Print_UI.ts
|
|
* 인쇄 미리보기 등록 입구(PLAN 302-1 · 초안) — B09 셸이 `import.meta.glob("./draft/*_UI.ts")` 로 불러올 때
|
|
* 좌측 하단 고정 줄(`DRAFT.actions`)에 [인쇄 미리보기] 단추 → 저장(`DRAFT.save`) 뒤 #/b09-print(`…_Print_Route`)
|
|
* · 단계 그대로 · 저장 실패면 머묾 · 빈 줄 있으면 막음(`DRAFT.blocked` · 701-3) ·
|
|
* [>] 다음 길(`DRAFT.next` · 저장 · 단계 6 완료 뒤 · 요구 298-2)
|
|
* draft 폴더째 지우면 단추 · 길 · 서버 길이 함께 사라짐
|
|
* ========================================================================== */
|
|
|
|
import type { RoutePath } from "@config/config_frontend";
|
|
import { createButton, showToast } from "@ui/ui_template_elements";
|
|
import { navigateTo } from "../../A00_Common/router";
|
|
import { DRAFT } from "../B09_Estimation_UI_Tabs";
|
|
import { ROUTE } from "./B09_Draft_Print_Route";
|
|
|
|
DRAFT.next = () => navigateTo(ROUTE.path as RoutePath);
|
|
|
|
DRAFT.actions.push(() => {
|
|
const button = createButton({
|
|
label: "인쇄 미리보기",
|
|
variant: "ghost",
|
|
onClick: () => {
|
|
const why = DRAFT.blocked?.(); // 701-3 인쇄 = 빈 줄 0 일 때만
|
|
if (why) return void showToast(why, "warning");
|
|
void (DRAFT.save?.() ?? Promise.resolve(true)).then(
|
|
(ok) => ok && navigateTo(ROUTE.path as RoutePath),
|
|
);
|
|
},
|
|
});
|
|
button.dataset.b09Print = "";
|
|
return button;
|
|
});
|