feat(793-3b): 불러오기 단산 줄 = 가져온 식 단가산출 모달 — 블록 → 가져온 식 SK 길 · 검산 · 엑셀/우리 단가 · 이음 고르기 · 근거 세 단 · 우리 기초로 바꾸기 · 입력 필요 · 줄 잇기 · 결과 칩
- 서버: 올림 때 산근 시트 둠(실무자료/산근/<HP>.json · HP 지울 때 같이) · POST …/sangeun/from-hopyo(블록 → 793-2a 내보내기 → 793-2 만들기 · 같은 내용 = 그 SK 다시 씀 · 옛 HP 409) · STmate 끝전 = 엑셀 계와 맞는 쪽 - 화면: [수정] 모달 단산 줄 · 오른쪽 블록 판 [가져온 식으로 열기](새) → 시트 모달 + 머리 판 · [이 줄에 잇기] = 줄 고른 것 SK(입력 필요 남으면 확인 막힘) · 단산 줄 결과 칩 - 시험: test_793_3b_import_screen 6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
* · 자재 표 = [확인] · 행 · 코드 · 이름 · 규격 · 수량산출 · 단위 · 세 칸(글만) · 가격 다섯 · 엑셀 / 우리 합계 · 단추
|
||||
* · 단추 = [고르기] · [원문 보기] · [옵션](기초마다) · 추가 / 로직없음(= 고정 줄) — 옛 「사용안함」(뺌)은 새 옮기기 길에 없어 안 살림
|
||||
* · 「새」 배지(785 새 기능) = 머리 칸 [확인] · 구분(판정) · 이름(고름 · 블록 풀이) · 수량산출(단위 환산)
|
||||
* · 단산 줄(793-3b) = 판정 칩 「2차 필요」 대신 결과 칩(가져온 식 있음 · 근거 확정 · 근접 · 사람 고름 · 입력 필요 n ·
|
||||
* SK 안 이었으면 블록 풀이 판정) · 단추 [가져온 식으로 열기](새 · `Hopyo_Imported` 모달)
|
||||
* 줄 표 = `tableOf`(고른 것이 모두 재료 · 유가 · 없으면 엑셀 갈래 · 별도계상 줄 = 자재 표).
|
||||
* ========================================================================== */
|
||||
|
||||
@@ -21,6 +23,7 @@ import type { CalcMaterial } from "./M02_MasterTemplete_Labor_Calc";
|
||||
import { markCells, markHeads } from "./M02_MasterTemplete_Labor_MatMarks";
|
||||
import { moneyCell, PRICE_SLOTS } from "./M02_MasterTemplete_Labor_Rows";
|
||||
import { tc } from "./M02_MasterTemplete_Labor_Text";
|
||||
import { rowChips } from "./logic/M02_Hopyo_Imported_Model";
|
||||
import type { DraftPick } from "./logic/M02_MasterTemplete_Hopyo_Picks";
|
||||
|
||||
type Money4 = Record<"노무비" | "재료비" | "경비" | "계", number | null>;
|
||||
@@ -44,6 +47,8 @@ export interface CheckCtx {
|
||||
options: (row: JudgeRow, p: DraftPick) => void;
|
||||
/** 추가(빈 값 = 제안으로 되돌림) · 로직없음(고정 줄) */
|
||||
out: (row: JudgeRow, value: string) => void;
|
||||
/** 단산 줄 [가져온 식으로 열기](793-3b) */
|
||||
imported?: (row: JudgeRow) => void;
|
||||
}
|
||||
|
||||
const COSTS = ["노무비", "재료비", "경비", "계"] as const;
|
||||
@@ -128,6 +133,11 @@ function actsCell(row: JudgeRow, ctx: CheckCtx, picks: DraftPick[]): HTMLElement
|
||||
};
|
||||
const kids: HTMLElement[] = [];
|
||||
if (!ctx.readOnly && !apartRow(row)) kids.push(ghost(L("M02_CheckPick"), () => ctx.pick(row), "pick")); // prettier-ignore
|
||||
if (row.번 !== undefined && ctx.imported) {
|
||||
const b = ghost(L("M02_CheckImported"), () => ctx.imported!(row), "imported");
|
||||
(b as HTMLButtonElement).disabled = ctx.readOnly;
|
||||
kids.push(el("span", { className: "m02-judge__wrap", children: [b, newBadge()] }));
|
||||
}
|
||||
kids.push(ghost(L("M02_CheckSource"), () => ctx.source(row), "source"));
|
||||
for (const p of picks.filter((x) => x.갈래 === "기초")) {
|
||||
const b = ghost(L("M02_CheckOption"), () => ctx.options(row, p), "option");
|
||||
@@ -172,11 +182,25 @@ const rowOf = (
|
||||
],
|
||||
});
|
||||
|
||||
/** 단산 줄 결과 칩(793-3b) — SK 고른 것 표지 · 없으면 블록 풀이 판정 · 단산 아니면 판정 칩 */
|
||||
function verdictOf(row: JudgeRow, ctx: CheckCtx): HTMLElement[] {
|
||||
if (row.번 === undefined) return [ctx.kit.verdict(row)];
|
||||
const got = rowChips(ctx.kit.picksOf(row));
|
||||
const list = got ?? (row.풀이?.판정 ? [row.풀이.판정] : []);
|
||||
if (!list.length) return [ctx.kit.verdict(row)];
|
||||
return list.map((text) => {
|
||||
const tone = text.startsWith("입력 필요") ? "danger" : text.includes("확정") || text.startsWith("가져온") ? "success" : text.includes("근접") ? "warning" : "info"; // prettier-ignore
|
||||
const b = createBadge(text, tone);
|
||||
b.dataset.judgeResult = text;
|
||||
return b;
|
||||
});
|
||||
}
|
||||
|
||||
const kindCell = (row: JudgeRow, ctx: CheckCtx): HTMLElement =>
|
||||
el("td", {
|
||||
className: "m02-labrow__kind",
|
||||
attrs: { title: row.근거 },
|
||||
children: [bar([...row.갈래.map((k) => createBadge(k, "neutral")), ctx.kit.verdict(row)])],
|
||||
children: [bar([...row.갈래.map((k) => createBadge(k, "neutral")), ...verdictOf(row, ctx)])],
|
||||
});
|
||||
|
||||
function logicRow(row: JudgeRow, ctx: CheckCtx): HTMLElement[] {
|
||||
|
||||
Reference in New Issue
Block a user