fix(840-2): 기계 보기 — 일 단위 손료 기계 칸 단위 = 줄 단위 글 · 시간당 범위 경고 안 함 · 식 그대로일 때 서버 까닭 글 새로 받음
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -209,7 +209,10 @@ export function createMachineSheet(o: MachineSheetOptions) {
|
||||
info = got;
|
||||
rebuild();
|
||||
drawAll();
|
||||
} else drawLive();
|
||||
} else {
|
||||
info.까닭 = got.까닭; // 식은 그대로 — 까닭만 지금 줄로
|
||||
drawLive();
|
||||
}
|
||||
} catch (e) {
|
||||
if (mineSeq !== seq || (e as Error).name === "AbortError") return;
|
||||
info = { 키: null, 까닭: e instanceof Error ? e.message : "", 문서: null, 직종: jobs };
|
||||
@@ -282,9 +285,15 @@ export function createMachineSheet(o: MachineSheetOptions) {
|
||||
ctlBox.replaceChildren(...(zone ? [zone] : []));
|
||||
};
|
||||
|
||||
/** 칸 단위 — 줄 `단위` 글(일 단위 손료 등) › 기본 */
|
||||
const unitOf = (k: string): string => {
|
||||
const u = text((cur.단위 as MachineValues | undefined)?.[k]);
|
||||
return !u || u === "10^-7/시간" ? (UNIT[k] ?? "") : u;
|
||||
};
|
||||
const numField = (k: string, read = false): HTMLElement => {
|
||||
const v = cur.값?.[k];
|
||||
const f = createInputField({ label: label(k), value: text(v), size: 28, ...(UNIT[k] ? { unit: UNIT[k] } : {}) }); // prettier-ignore
|
||||
const unit = unitOf(k);
|
||||
const f = createInputField({ label: label(k), value: text(v), size: 28, ...(unit ? { unit } : {}) }); // prettier-ignore
|
||||
f.input.inputMode = "decimal";
|
||||
f.input.dataset.key = k;
|
||||
f.input.readOnly = ro || read;
|
||||
@@ -518,6 +527,7 @@ export function createMachineSheet(o: MachineSheetOptions) {
|
||||
};
|
||||
const drawWarn = (): void => {
|
||||
const vals: MachineValues = { ...engineVals(cur, mine), ...(cur.값 ?? {}) };
|
||||
if (unitOf("손료계수") !== UNIT.손료계수) delete vals.손료계수; // 일 단위 손료(임업) = 시간당 범위 아님
|
||||
warn.replaceChildren(
|
||||
...rangeWarnings(vals).map(([k, r]) =>
|
||||
createText(L("MS_Range").replace("{name}", label(k)).replace("{value}", r), "warning"),
|
||||
|
||||
Reference in New Issue
Block a user