Merge remote-tracking branches 'origin/sub_laptop_5', 'origin/sub_laptop_6' and 'origin/sub_laptop_8' into sub_laptop_1

This commit is contained in:
2026-11-19 00:52:01 +09:00
13 changed files with 30 additions and 24 deletions
+1 -5
View File
@@ -37,7 +37,6 @@ interface CopyRowData {
export interface CopyAnswer {
사본: CopyRowData | null;
지금: CopyRowData | null;
새값: boolean;
}
export interface MachineCtx {
@@ -233,10 +232,7 @@ export function openMachineWindow(o: MachineWindowOptions): void {
// 지금 줄 = 이 단가산출 사본 값(있으면)
const copy = c.kind === "now" && ctx.copyRow ? await ctx.copyRow(c.no).catch(() => null) : null;
const row = copy?.사본 ?? null;
if (row) {
lines.push(createText(mt("Win_Copy"), "muted"));
if (copy?.새값) lines.push(createText(mt("Win_Newer"), "warning"));
}
if (row) lines.push(createText(mt("Win_Copy"), "muted"));
if (k === "mine") {
const m = c.mine ?? mines.find((r) => r.원문번호 === c.no);
if (m) lines.push(createText(`${mt("Server_Hourly")} ${hourlyText(m.시간당)}`));
@@ -115,6 +115,9 @@ export function renderD01PlanRegister(root: HTMLElement): void {
required: true,
});
const name = createInputField({ label: t("DE_Reg_Name"), required: true });
// 서버 칸 길이(CreatePlanRequest)와 같게 — 넘으면 「HTTP 422」 만 뜸
region.input.maxLength = 100;
name.input.maxLength = 255;
// 이름 = B02 조합기 그대로(손대기 전 = 자동 · 고친 뒤 = 조각만 갈아 끼움)
const composer = createNameComposer();
@@ -262,6 +262,9 @@ export function createPlanPoints(params: PlanPointsParams): PlanPoints {
const sub = row?.querySelector(".ui-list-row__sub");
if (label) label.textContent = name(i);
if (sub) sub.textContent = lonLatOf(i) ?? "";
const drop = row?.querySelector(".ui-list-row__trailing button");
drop?.setAttribute("title", `${name(i)} 지우기`);
drop?.setAttribute("aria-label", `${name(i)} 지우기`);
});
syncEditor?.();
return;
+7 -2
View File
@@ -27,7 +27,7 @@ import {
import { createBanner } from "@ui/ui_template_banner";
import { createCheckbox } from "@ui/ui_template_checkbox";
import { createPanelCard } from "@ui/ui_template_collapsible";
import { tableRow, tableShell, type Column } from "@ui/ui_template_table";
import { emptyRow, tableRow, tableShell, type Column } from "@ui/ui_template_table";
import { t } from "@ui/ui_template_locale";
import { stationLabel } from "../common_util/common_util_station";
import { clearState, readState, writeState } from "../A00_Common/b_page_state";
@@ -291,6 +291,7 @@ export async function renderD04PlanConfirm(root: HTMLElement): Promise<void> {
if (row.piece_id) tr.dataset.piece = row.piece_id;
tbody.append(tr);
}
if (!summary.pieces.length) tbody.append(emptyRow(columns, t("D04_NotSaved")));
const notes = draft() ? [createBanner({ tone: "warning", text: t("D04_Dirty") })] : [];
notes[0]?.classList.add("d04-confirm__dirty");
const broken = summary.pieces
@@ -386,6 +387,10 @@ export async function renderD04PlanConfirm(root: HTMLElement): Promise<void> {
pickCard.hidden = finalizeButton.hidden = saveButton.hidden = !editable;
await load();
} catch (error) {
showToast(error instanceof Error ? error.message : String(error), "error");
const text = error instanceof Error ? error.message : String(error);
showToast(text, "error");
// 못 읽음(권한 · 없는 프로젝트) — 빈 화면 대신 까닭 · 단추는 걷음
main.replaceChildren(createBanner({ tone: "danger", text }));
pickCard.hidden = exportButton.hidden = finalizeButton.hidden = saveButton.hidden = true;
}
}
+1 -1
View File
@@ -20,7 +20,7 @@
}
.d04-confirm__input {
min-width: 10rem;
min-width: 15rem; /* 업체 칸 안내 글 「업체(등록 회사 찾기 또는 이름)」 이 다 보이게 */
}
.d04-confirm__picks {
@@ -35,6 +35,7 @@ import {
} from "./M02_MasterTemplete_Api_Fetch";
import { tc } from "./M02_MasterTemplete_Labor_Text";
import { formatMoney } from "../common_util/common_util_money";
import { dateText } from "../common_util/common_util_time";
/** 목록 줄 — 서버가 문서 `이름`(제목) · 단위 · 1 단위 기준 계를 실어 보냄 */
type Row = TemplateInfo & {
@@ -84,7 +85,7 @@ const COLUMNS: Record<LibraryKind, () => [string, (row: Row) => string][]> = {
[tc("Lib_Unit"), (r) => r.단위 ?? ""],
[tc("Lib_Base"), (r) => money(r.기준금액)],
[L("M02_LibUnlinked"), (r) => (r.안이은줄 ? String(r.안이은줄) : "")], // 729-3
[tc("Lib_Date"), (r) => r.수정일],
[tc("Lib_Date"), (r) => dateText(r.수정일, "")],
],
sangeun: () => [
[tc("Lib_Key"), (r) => r.이름],
@@ -94,7 +95,7 @@ const COLUMNS: Record<LibraryKind, () => [string, (row: Row) => string][]> = {
[L("M02_SangeunEdited"), (r) => String(r.고친줄수 ?? 0)],
[L("M02_SangeunUsers"), (r) => String(r.쓰는곳수 ?? 0)],
[tc("Lib_Base"), (r) => money(r.기준금액)],
[tc("Lib_Date"), (r) => r.수정일],
[tc("Lib_Date"), (r) => dateText(r.수정일, "")],
],
};
+1 -2
View File
@@ -40,7 +40,6 @@ export function buildMyItemsView(opt: MyItemsViewOptions): HTMLElement {
{ key: "같은이름", label: mt("Same_Name"), kind: "number", decimals: 0, width: 70 },
],
rows: [],
empty: mt("Items_None"),
mergeSame: ["이름"],
onRowClick: (i) => pick(shown[i]),
});
@@ -62,7 +61,7 @@ export function buildMyItemsView(opt: MyItemsViewOptions): HTMLElement {
const count = new Map<string, number>();
for (const r of rows) count.set(r.이름, (count.get(r.이름) ?? 0) + 1);
shown = rows.filter((r) => words.every((w) => `${r.이름} ${r.규격}`.toLowerCase().includes(w)));
hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : "";
hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : mt("Items_None");
table.setRows(
shown.map((r) => ({
이름: r.이름,
+2 -3
View File
@@ -197,7 +197,7 @@ def saving(body: dict, inner: Callable[[dict], Any]) -> Any:
def copy_row(doc: dict, copy: dict | None, no: str) -> dict[str, Any]:
"""기계 창 열 때 — {사본: 이 SK 사본에 박힌 줄 | None, 지금: 지금 줄 | None, 새값}(원문번호 · 키로 찾음)."""
"""기계 창 열 때 — {사본: 이 SK 사본에 박힌 줄 | None, 지금: 지금 줄 | None}(원문번호 · 키로 찾음)."""
from M02_MasterTemplete import M02_Sangeun_Copy as skc
no = no.strip().strip("'")
@@ -209,5 +209,4 @@ def copy_row(doc: dict, copy: dict | None, no: str) -> dict[str, Any]:
whole = skc.whole_()
live = (whole.numbers.get("EQ") or {}).get(no) or (whole.index.get("EQ") or {}).get(no)
now = prices.to_json(live) if live is not None else None
new = have is not None and now is not None and skc._fp(have) != skc._fp(now)
return {"사본": have, "지금": now, "새값": new}
return {"사본": have, "지금": now}
+1 -2
View File
@@ -24,7 +24,7 @@ const TEXT = {
Delete: "지우기",
Deleted: "내 기계 지움",
Delete_Ask: "이 내 기계를 지울까? 쓰는 단가산출 {value}",
Delete_Keep: "지워도 이미 만든 단가산출은 마지막 값 유지(「지워짐」 표시)",
Delete_Keep: "지워도 이미 만든 단가산출은 지우기 직전 값 유지",
Back: "목록",
Close: "닫기",
Failed: "못 함",
@@ -60,7 +60,6 @@ const TEXT = {
Win_M01: "M01 기계",
Win_Copy: "이 단가산출에 복사된 값",
Win_Live: "원본 지금 값",
Win_Newer: "원본에 새 값 있음 — 프로젝트 사본은 [단가 갱신] 으로 반영",
Win_Swap: "이 기계로 바꾸기",
Win_Hint: "왼쪽에서 기계를 고르면 값이 보임",
Win_View: "조회",
+1 -2
View File
@@ -45,7 +45,6 @@ export function buildMyMachineView(opt: MyMachineViewOptions): HTMLElement {
{ key: "고친날", label: mt("Edited"), width: 96 },
],
rows: [],
empty: mt("None"),
onRowClick: (i) => shown[i] && void openForm(shown[i].키),
});
const draw = (): void => {
@@ -54,7 +53,7 @@ export function buildMyMachineView(opt: MyMachineViewOptions): HTMLElement {
const text = `${r.이름} ${r.규격} ${r.키}`.toLowerCase();
return words.every((w) => text.includes(w));
});
hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : "";
hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : mt("None");
table.setRows(
shown.map((r) => ({
이름: r.이름,
+4 -2
View File
@@ -40,7 +40,7 @@ const TEXT = {
need: "품명 · 단위는 꼭 적음",
saved: "저장함 — 쓰는 단가산출이 새 값으로 셈",
dropped: "지움",
dropAsk: "「{name}」 을 지움",
dropAsk: "「{name}」 지움",
readOnly: "남의 층 — 읽기만",
} as const;
@@ -65,7 +65,6 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement {
{ key: "키", label: TEXT.key, width: 90 },
],
rows: [],
empty: TEXT.none,
onRowClick: (i) => canWrite && open(rows[i]),
});
const name = createInputField({ label: TEXT.name, required: true });
@@ -84,6 +83,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement {
}),
);
const head = createText("");
const none = createText(TEXT.none, "muted"); // 빈 목록 글(표 `empty` = 빈 칸 글이라 따로)
const saveBtn = createButton({ label: TEXT.save, variant: "filled", onClick: () => void save() });
const dropBtn = createButton({
label: TEXT.drop,
@@ -138,6 +138,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement {
rows = got.줄;
ver = got.판;
table.setRows(rows.map((r) => ({ ...r, 쓰는곳: r.쓰는곳?.length ?? 0 })));
none.hidden = rows.length > 0;
}
async function save(): Promise<void> {
const 이름 = name.input.value.trim();
@@ -188,6 +189,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement {
el("div", { className: "ui-toolbar", children: [addBtn] }),
createText(canWrite ? TEXT.note : TEXT.readOnly, "muted"),
table.root,
none,
form,
],
});
@@ -16,7 +16,9 @@ const load = (name, stubs) => {
};
const model = load("M02_MasterTemplete_TreePanel_Model.ts", {});
const time = load("../common_util/common_util_time.ts", {}); // 날짜 글 = 진짜(PC 시간대는 시험이 고정)
const money = load("../common_util/common_util_money.ts", {}); // 금액 꼴 = 진짜
const m = load("M02_MasterTemplete_ItemList.ts", {
"../common_util/common_util_money": money,
"./M02_MasterTemplete_TreePanel_Model": model,
"../common_util/common_util_time": time,
});
@@ -182,9 +182,7 @@ def test_edit_mine_other_sk_new_value(world):
now = _at(me, path.read, first)
assert now["셈"]["계"] == was
seen = _at(me, path.machine, first, f"'{no}'")
assert (
seen["사본"]["값"]["가격"] == 1000 and seen["지금"]["값"]["가격"] == 5000 and seen["새값"]
)
assert seen["사본"]["값"]["가격"] == 1000 and seen["지금"]["값"]["가격"] == 5000
def test_company_and_other_refused(world):