fix(725-3·725-4): 바탕 없는 SK 거짓 M01 개정 막음 · 단가산출로도 저장 뒤 나무 다시 읽음 · 더한 줄 단가 찾아 옴
- 725-3 Sangeun_Detail — 개정 판정(배지 · 띠)은 바탕이 있을 때만(바탕 없는 SK 지문은 이름 · 단위 따라 바뀜) - 725-4 Labor_RowModal — 단가산출로도 저장 성공 뒤 서고 목록 알림(HOPYO_BUILT) · 단가산출 나무 바로 갱신 - 725-4 LogicLab_Modal — prices 에 없는 요소(M02 더한 석공 · 합판)도 키로 찾아 단가 보임(lookup 하나로 합침) - 시험 test_717_2b 에 725 단언 하나 더함 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -454,6 +454,22 @@ export function openMaterialModal(target: ModalTarget): void {
|
||||
};
|
||||
setSum(known);
|
||||
const rate = el("div", { className: "m01lab__modal-body" });
|
||||
/** `prices` 에 있으면 그대로 · 없으면 키로 찾아 옴 — 못 찾으면 「관리자 값 미확정」 */
|
||||
const lookup = (ref: string, label: string): void => {
|
||||
const show = (brief: ElementBrief | null): void => {
|
||||
rate.replaceChildren(
|
||||
brief ? priceView(ref, brief) : muted(`${label} — ${tl("Pill_NoValue")}`),
|
||||
);
|
||||
setSum(brief);
|
||||
};
|
||||
rate.append(muted("…"));
|
||||
const cached = target.prices[ref];
|
||||
if (cached) show(cached);
|
||||
else
|
||||
void searchElements(groupOf(ref), ref)
|
||||
.then((got) => show(got.items.find((it) => it.ref === ref) ?? null))
|
||||
.catch(() => show(null));
|
||||
};
|
||||
if (known && priceRef) {
|
||||
rate.append(priceView(priceRef, known, target.usedSlot));
|
||||
} else if (logicKey) {
|
||||
@@ -484,25 +500,9 @@ export function openMaterialModal(target: ModalTarget): void {
|
||||
if (!ref) {
|
||||
const names = [...element.matchAll(/\{([^}]+)\}/g)].map((m) => m[1]).join(" · ");
|
||||
rate.append(muted(`${target.unitText || names} — ${tl("Pill_Unresolved")}`));
|
||||
} else {
|
||||
const show = (brief: ElementBrief | null): void => {
|
||||
rate.replaceChildren(
|
||||
brief
|
||||
? priceView(ref, brief)
|
||||
: muted(`${target.unitText ?? ref} — ${tl("Pill_NoValue")}`),
|
||||
);
|
||||
setSum(brief);
|
||||
};
|
||||
rate.append(muted("…"));
|
||||
const cached = target.prices[ref];
|
||||
if (cached) show(cached);
|
||||
else
|
||||
void searchElements(groupOf(ref), ref)
|
||||
.then((got) => show(got.items.find((it) => it.ref === ref) ?? null))
|
||||
.catch(() => show(null));
|
||||
}
|
||||
} else lookup(ref, target.unitText ?? ref);
|
||||
} else if (element) {
|
||||
rate.append(muted(`${element} — ${tl("Pill_NoValue")}`));
|
||||
lookup(element, element); // 더한 줄(M02) 등 `prices` 에 없는 요소 — 키로 찾아 옴(725-4)
|
||||
}
|
||||
body.replaceChildren(
|
||||
...(target.edit ? [target.edit(close)] : []),
|
||||
|
||||
Reference in New Issue
Block a user