fix(786-2): 화면 검증 흠 고침 — [구조물 조합으로] 참조 주인 · 실패 되돌림 · 표 머리 칸 · 이름 칸 덧글 줄
- ToItem: SC 참조 주인 = 실제 주인 id(개인 「회사/사용자」 · Find_Pick.upper 와 같은 ownOwner 길) — null 이면 서버 400 「참조 층 · 주인 꼴이 틀림」 · 일위대가 못 담으면 방금 더한 항목 지움(빈 항목 안 남김) - CheckRows: [확인] · 행 머리 칸 = 표마다 새 노드(두 표가 같은 노드를 써 로직 표 머리가 두 칸 밀림) - Hopyo.css: 이름 칸 덧글(셈 못 함 · 입력 필요) 한 줄씩 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -306,6 +306,10 @@
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.m02-hopyo__lines .m02-labrow__name > small {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.m02-hopyo__lines td.m02-hopyo__compare {
|
||||
min-width: 7em;
|
||||
white-space: pre-line;
|
||||
|
||||
@@ -263,13 +263,13 @@ const grid = (heads: HTMLElement[], rows: HTMLElement[], kind: string): HTMLElem
|
||||
export function checkTables(rows: JudgeRow[], ctx: CheckCtx): HTMLElement[] {
|
||||
const logic = rows.filter((r) => tableOf(r, ctx.kit.picksOf(r)) === "logic");
|
||||
const mat = rows.filter((r) => !logic.includes(r));
|
||||
const first = [head(L("M02_JudgeColOk"), true), head(L("M02_JudgeColRow"))];
|
||||
const first = (): HTMLElement[] => [head(L("M02_JudgeColOk"), true), head(L("M02_JudgeColRow"))]; // 표마다 새 노드
|
||||
const out: HTMLElement[] = [];
|
||||
if (logic.length)
|
||||
out.push(
|
||||
grid(
|
||||
[
|
||||
...first,
|
||||
...first(),
|
||||
head(`${tc("Sub")} · ${L("M02_JudgeColVerdict")}`, true),
|
||||
head(`${tc("Col_Name")} · ${L("M02_JudgeColPick")}`, true),
|
||||
head(tc("Col_Alias")),
|
||||
@@ -288,7 +288,7 @@ export function checkTables(rows: JudgeRow[], ctx: CheckCtx): HTMLElement[] {
|
||||
el("h4", { className: "m02-hopyo__subhead", text: L("M02_CheckMat") }),
|
||||
grid(
|
||||
[
|
||||
...first,
|
||||
...first(),
|
||||
head(tc("Labor_Code")),
|
||||
head(`${tc("Col_Name")} · ${L("M02_JudgeColPick")}`, true),
|
||||
head(tc("Labor_Spec")),
|
||||
|
||||
@@ -11,8 +11,10 @@ import { createInputField } from "@ui/ui_template_input";
|
||||
import { t as L } from "@ui/ui_template_locale";
|
||||
import { openModal } from "@ui/ui_template_modal";
|
||||
import { createText } from "@ui/ui_template_text";
|
||||
import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch";
|
||||
import { editTree, fetchTree, readTemplate, saveTemplate } from "./M02_MasterTemplete_Api_Fetch";
|
||||
import type { HopyoScope } from "./M02_MasterTemplete_Hopyo_Api";
|
||||
import { ownOwner } from "./M02_MasterTemplete_Layer";
|
||||
|
||||
/** 만든 항목이 놓이는 폴더 */
|
||||
export const ITEM_PATH = ["실무자료"];
|
||||
@@ -33,16 +35,33 @@ export async function makeItem(o: ToItemOptions, label: string): Promise<string>
|
||||
const made = await editTree(layer, { op: "add-item", 경로: ITEM_PATH, 이름: label, 단위: o.unit }, tree.판, owner); // prettier-ignore
|
||||
const col = [made.알림?.열].flat()[0];
|
||||
if (!col) throw new Error(L("M02_CheckToItemFail"));
|
||||
try {
|
||||
await fillLabor(o, col);
|
||||
} catch (e) {
|
||||
// 일위대가 못 담음 = 빈 항목 남기지 않음(방금 더한 항목만 지움)
|
||||
await editTree(layer, { op: "delete", 키: col }, made.판, owner).catch(() => null);
|
||||
throw e;
|
||||
}
|
||||
return col;
|
||||
}
|
||||
|
||||
/** 새 항목 일위대가 문서 = SC 참조 한 줄 */
|
||||
async function fillLabor(o: ToItemOptions, col: string): Promise<void> {
|
||||
const { layer, owner } = o.target;
|
||||
const now = await readTemplate(layer, "labor", col, null, owner);
|
||||
const doc = (now.문서 ?? {}) as Record<string, unknown>;
|
||||
// 참조 주인 = 실제 주인 id(개인 「회사/사용자」 · 자기 층이면 세션에서 · `Find_Pick.upper` 와 같은 길)
|
||||
const who =
|
||||
layer === "system" || layer === "project"
|
||||
? null
|
||||
: (owner ?? ownOwner(layer, await fetchSessionUser()));
|
||||
const line = {
|
||||
참조: { 층: layer, 주인: owner, 키: o.sc },
|
||||
참조: { 층: layer, 주인: who, 키: o.sc },
|
||||
별칭: null,
|
||||
메모: null,
|
||||
수량: { 손: 1 },
|
||||
};
|
||||
await saveTemplate(layer, "labor", col, null, now.판 ?? "", { ...doc, 담은로직: [line], 단위: o.unit || doc.단위 || null }, owner); // prettier-ignore
|
||||
return col;
|
||||
}
|
||||
|
||||
export function toItem(o: ToItemOptions): void {
|
||||
|
||||
Reference in New Issue
Block a user