feat(733-3): 같은 내용 물음 — 호표 [구조물 조합으로]

- buildHopyoItem 에 다시 보냄 덧칸(씀 · 새로) · 물을 때는 가림막 걷음 · 그것을 씀 = 「새로 안 만듦」 알림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 13:58:31 +09:00
co-authored by Claude Opus 5.5
parent a42f44ec26
commit 4de5a3416b
2 changed files with 21 additions and 9 deletions
@@ -613,7 +613,8 @@ export const hopyoSiblings = (
): Promise<{ 묶음: { 번: number; 규격: string; 열: string }[]; 이름: string | null }> =>
call(at(scope, `/hopyo/${enc(key)}/${no}/siblings`));
/** [구조물 조합으로](704-4) — 확인 창 몸 그대로 → 이 층 구조물 조합 항목(사전조합 안 만듦) */
/** [구조물 조합으로](704-4) — 확인 창 몸 그대로 → 이 층 구조물 조합 항목(사전조합 안 만듦) ·
* `extra` = 같은 내용 409 뒤 다시 보냄(733-2 · 씀 = 그 항목 · 답 `씀` · 새로 = 그래도 새로) */
export const buildHopyoItem = (
target: HopyoScope,
from: { 층: Layer; 주인: string | null; 키: string; 번: number },
@@ -621,8 +622,9 @@ export const buildHopyoItem = (
통째: { 대상: BuildTarget[] } | null,
묶음: number[],
이름: string,
): Promise<{ key: string; 열: string; 이름: string; 줄수: number; 열수: number }> =>
extra: { 씀?: string; 새로?: boolean } = {},
): Promise<{ key: string; 열: string; 이름: string; 줄수?: number; 열수?: number; 씀?: boolean }> =>
call(at(target, "/hopyo-item"), {
method: "POST",
body: JSON.stringify({ ...from, ...(통째 ? { 통째 } : { 줄 }), 묶음, 이름 }),
body: JSON.stringify({ ...from, ...(통째 ? { 통째 } : { 줄 }), 묶음, 이름, ...extra }),
});
@@ -26,6 +26,7 @@ import {
type HopyoOne,
type HopyoScope,
} from "./M02_MasterTemplete_Hopyo_Api";
import { type SameExtra, withSameAsk } from "./M02_MasterTemplete_Library_SameAsk";
/** 항목을 만들었음(document 알림) — 구조물 조합 나무 · 옆 목록 다시 */
export const ITEM_BUILT = "m02-hopyo-item-built";
@@ -78,14 +79,25 @@ export async function toItem(o: ToItemOptions): Promise<void> {
const with_ = pack?.input.checked
? sib.묶음.map((r) => r.번).filter((n) => n !== o.no)
: [];
showLoadingOverlay();
// 같은 내용 항목이 있으면 물음(733-3) — 물을 때는 가림막을 걷음
const build = async (extra: SameExtra) => {
showLoadingOverlay();
try {
return await buildHopyoItem(o.target, from, o.lines, o.whole, with_, label, extra);
} finally {
hideLoadingOverlay();
}
};
try {
const got = await buildHopyoItem(o.target, from, o.lines, o.whole, with_, label);
const got = await withSameAsk(build);
if (!got) return;
close();
document.dispatchEvent(new Event(ITEM_BUILT));
showToast(
`구조물 조합 「${label}」 만듦 — 「실무자료」 폴더 · 줄 ${got.줄수}` +
(got.열수 > 1 ? ` · 규격 열 ${got.열수}` : ""),
got.씀
? `같은 내용 구조물 조합 「${got.이름}」 씀 — 새로 안 만듦`
: `구조물 조합 「${label}」 만듦 — 「실무자료」 폴더 · 줄 ${got.줄수}` +
((got.열수 ?? 0) > 1 ? ` · 규격 열 ${got.열수}` : ""),
"success",
6000,
);
@@ -94,8 +106,6 @@ export async function toItem(o: ToItemOptions): Promise<void> {
`못 만듦 — ${error instanceof Error ? error.message : String(error)}`,
"error",
);
} finally {
hideLoadingOverlay();
}
},
});