wip(M01): 테스트 컨테이너 후보 값 다섯 표시 · 옛 줄 검색을 품셈재료 이름으로 · 멈춤 사유 쉬운 말 · 빈 입력 안내
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WRFJmmhPi4exAzHgPZHMT
This commit is contained in:
@@ -37,14 +37,24 @@ export function swappedRow(logic: LogicRow, swaps: Swaps): LogicRow | undefined
|
||||
};
|
||||
}
|
||||
|
||||
type Brief = ElementBrief & { 구분?: string; 상세구분?: string };
|
||||
type Brief = ElementBrief & {
|
||||
구분?: string;
|
||||
상세구분?: string;
|
||||
값들?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
const distinct = (items: Brief[], key: "구분" | "상세구분"): string[] => [
|
||||
...new Set(items.map((i) => i[key]).filter((v): v is string => !!v)),
|
||||
];
|
||||
|
||||
const label = (it: Brief): string =>
|
||||
[`${it.이름 ?? ""} ${it.규격 ?? ""}`.trim(), formatNumber(it.값)].filter(Boolean).join(" · ");
|
||||
/** 후보 글 — 값 열이 여럿이면 있는 열을 다 보임(계산은 그 가운데 낮은 값) */
|
||||
const label = (it: Brief): string => {
|
||||
const cols = Object.entries(it.값들 ?? {})
|
||||
.filter(([, v]) => v !== null && v !== undefined)
|
||||
.map(([k, v]) => `${k} ${formatNumber(v)}`);
|
||||
const prices = cols.length ? cols : [formatNumber(it.값) || tt("Mat_NoPrice")];
|
||||
return [`${it.이름 ?? ""} ${it.규격 ?? ""}`.trim(), ...prices].join(" · ");
|
||||
};
|
||||
|
||||
function pickRow(one: LogicOne, line: HoLine, i: number, swaps: Swaps, onChange: () => void) {
|
||||
const cond =
|
||||
@@ -109,7 +119,7 @@ function pickRow(one: LogicOne, line: HoLine, i: number, swaps: Swaps, onChange:
|
||||
region: "울진",
|
||||
})
|
||||
: line.종류 === "재료"
|
||||
? searchPrice((line.이름 ?? "").split(/[\s(·]/)[0]) // 옛 줄 — 이름 첫 낱말로 자재품목(구분 붙음)
|
||||
? searchPrice(one.prices[line.요소 as string]?.이름 ?? (line.이름 ?? "").split(/[\s(·]/)[0]) // 옛 줄(고르기 조건 없음) — 품셈재료 이름 · 없으면 이름 첫 낱말
|
||||
: searchElements(line.종류, line.이름 ?? "");
|
||||
void found
|
||||
.then((r) => {
|
||||
|
||||
Reference in New Issue
Block a user