fix(b09-print): 도면 영역 이어 붙임 — 초안 router 가 스스로 단 /api/projects 머리를 사본 길에서 떼고 끼움(앞머리 두 번 겹침 없앰) · 못 넣은 그림 수 알림 (302-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
This commit is contained in:
@@ -49,6 +49,8 @@ interface Area {
|
||||
items: DrawingItem[];
|
||||
pdf: (ids: string[]) => Promise<Blob>;
|
||||
xlsx?: (ids: string[]) => Promise<Blob>;
|
||||
/** 그 PDF 곁 알림(도면 = 못 넣은 그림 수) */
|
||||
note?: (pdf: Blob) => string;
|
||||
}
|
||||
|
||||
async function post(projectId: string, path: string, body: unknown): Promise<Blob> {
|
||||
@@ -88,7 +90,12 @@ async function loadArea(projectId: string, id: AreaId): Promise<Area | null> {
|
||||
const list = mod.fetchDrawingList as FetchDrawingList | undefined;
|
||||
const pdf = mod.fetchDrawingsPdf as FetchDrawingsPdf | undefined;
|
||||
if (!list || !pdf) return null;
|
||||
return { items: await list(projectId), pdf: (ids) => pdf(projectId, ids) };
|
||||
const skipped = mod.skippedImagesOf as ((b: Blob) => Record<string, number>) | undefined;
|
||||
const note = (b: Blob) => {
|
||||
const n = Object.values(skipped?.(b) ?? {}).reduce((a, v) => a + v, 0);
|
||||
return n ? ` · 못 넣은 그림 ${n}개` : "";
|
||||
};
|
||||
return { items: await list(projectId), pdf: (ids) => pdf(projectId, ids), note };
|
||||
}
|
||||
const collect = mod[id === "quantity" ? "collectQuantitySheets" : "collectCostSheets"] as
|
||||
CollectSheets | undefined;
|
||||
@@ -160,7 +167,7 @@ export function renderB09Print(root: HTMLElement): MountedPage {
|
||||
if (my !== seq) return;
|
||||
shown!.url = URL.createObjectURL(b);
|
||||
frame.src = shown!.url;
|
||||
say(`${label()} · ${ids.length}쪽 묶음`);
|
||||
say(`${label()} · ${ids.length}장 묶음${area?.note?.(b) ?? ""}`);
|
||||
},
|
||||
(error: unknown) => my === seq && say(`PDF 를 못 만들었습니다 — ${errText(error)}`, true),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user