diff --git a/M02_MasterTemplete/M02_Hopyo_Line.py b/M02_MasterTemplete/M02_Hopyo_Line.py index f2b98770a..3ebb01590 100644 --- a/M02_MasterTemplete/M02_Hopyo_Line.py +++ b/M02_MasterTemplete/M02_Hopyo_Line.py @@ -309,7 +309,12 @@ def _grouped(got: dict, line: dict, ctx: Ctx) -> dict: return {**c, "뜻겹침": hm.near(mine, one["words"]), "출처같음": same, "책": book} named = [mark(c) for c in hm.name_cands(line, ctx.got)] - return {**got, "후보": [mark(c) for c in got.get("후보") or []], "이름후보": named} + cands = [mark(c) for c in got.get("후보") or []] + # 745-1 미리 고름 점 — 「다른 점」 1위 + 출처 같음 · 누르기는 사용자 + top = cands[0] if cands else {} + if top.get("판정") == "다른 점" and top.get("출처같음"): + top["미리"] = True + return {**got, "후보": cands, "이름후보": named} def _ledger_off(entry: dict | None, alias: dict) -> bool: diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Api.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Api.ts index 24d77cfa9..187f3c533 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Api.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Api.ts @@ -110,6 +110,8 @@ export interface HopyoTarget { /** 묶음 표시(358-1 · 로직 후보만) — 품명 뜻 낱말 겹침 · 엑셀 출처 조항 같음(≥ 0.9) · 책(산림품셈 · 건설품셈) */ 뜻겹침?: boolean; 출처같음?: boolean; + /** 745-1 미리 고름 점 — 「다른 점」 1위 + 출처 같음(서버) · 자동 확정 아님 · 만들기는 사용자가 누름 */ + 미리?: boolean; 책?: string; } diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Choose.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Choose.ts index 0b299e0c1..a9db164a4 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Choose.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Choose.ts @@ -10,6 +10,7 @@ * 저장 안 함 — 고른 것은 부르는 쪽 캐시(확인 창)로만 감. * ========================================================================== */ +import { createBadge } from "@ui/ui_template_badge"; import { createButton, el } from "@ui/ui_template_elements"; import { openModal } from "@ui/ui_template_modal"; import type { @@ -30,6 +31,7 @@ const FOLD_TEXT: Record = { "지역 변형": "하나 고르면 그 지역 · 「전국」으로 되돌림은 위", 숫자: "이름 · 출처 안 닮음 · 숫자 지문만", }; +const PRE_TIP = "미리 고름 — 엑셀 인용 조항 = 1위 기초 조항 · 누르기는 사용자"; const note = (text: string): HTMLElement => el("span", { className: "ui-text ui-text--muted", text, attrs: { "data-text": "14" } }); const num = (v: number): string => String(Math.round(v * 10000) / 10000); @@ -270,8 +272,12 @@ export function openHopyoChoose(opt: ChooseOptions): void { const tag = basisTag(c.근거); return el("div", { className: `m02-hopyo__cand${weakCand(c) ? " is-weak" : ""}`, - attrs: { "data-cand": c.로직 ?? c.자재 ?? (c.전국 ? "전국" : "") }, + attrs: { + "data-cand": c.로직 ?? c.자재 ?? (c.전국 ? "전국" : ""), + ...(c.미리 ? { "data-pre": "" } : {}), + }, children: [ + ...(c.미리 ? [createBadge(PRE_TIP, "accent", { kind: "dot" })] : []), box, createButton({ label: candText(c, twins), @@ -287,6 +293,7 @@ export function openHopyoChoose(opt: ChooseOptions): void { }), ] : []), + ...(c.미리 ? [note("미리 고름")] : []), ...(c.글 ? [note(c.글)] : []), ...(weakCand(c) ? [note("이름 뜻 안 겹침")] : []), ...(tag && c.근거 diff --git a/resources/tester/test_m02_hopyo_match.py b/resources/tester/test_m02_hopyo_match.py index dfc80ec41..e2cc9988c 100644 --- a/resources/tester/test_m02_hopyo_match.py +++ b/resources/tester/test_m02_hopyo_match.py @@ -433,3 +433,15 @@ def test_목록_열_때_뒤_셈_예약(client, monkeypatch): monkeypatch.setattr(fit, "ensure", lambda folder, key: asked.append(key) or {"끝": False}) rows = client.get(URL.format("personal")).json()["줄"] assert [r["키"] for r in rows] == asked == ["HP-000001"] + + +def test_미리_고름_점은_다른_점_1위_출처같음만(client): # 745-1 · 584-3 + _ready(client) + got = _hopyo(client, 3) + for name in ("구조물터파기(인력100%)", "구조물되메우기(인력100%)"): # 다른 점 + 출처 같음 + cands = got[name]["후보"] + assert got[name]["상태"] == "다른 점" and cands[0]["미리"] is True + assert not any("미리" in c for c in cands[1:]) # 1위만 + assert all("미리" not in c for c in got["잔토처리(인력100%)"]["후보"]) # 후보 줄 = 점 없음 + ok = _hopyo(client, 1)["레미콘타설(장비사용)"] # 맞음 줄도 점 없음(이미 체크) + assert ok["상태"] == "맞음" and all("미리" not in c for c in ok["후보"]) diff --git a/resources/tester/test_m02_precombo_scope.py b/resources/tester/test_m02_precombo_scope.py index f3233f657..bd96219af 100644 --- a/resources/tester/test_m02_precombo_scope.py +++ b/resources/tester/test_m02_precombo_scope.py @@ -119,7 +119,9 @@ def test_분류_고정_폴더_지움_자유_폴더_메뉴_끌어_옮기기(): assert 'item(L("M02_Delete"), () => void remove([target]))' in menu assert 'opt.scope().canWrite ? undefined : tc("ReadOnly")' in menu # 읽기만 층 = 흐림 remove = side.split("const remove = async (")[1].split("\n };")[0] - assert "showConfirmDialog(ask" in remove and 'op: "delete", 대상:' in remove # 안에 든 것째 + assert ( + "askLibraryDelete(kind," in remove and 'op: "delete", 대상:' in remove + ) # 735 쓰는 곳 경고 뒤 그 줄째 assert 'newHere: tc("Lib_NewHere")' in pre_side assert '({ 이름: name, 구분: "", 상세구분: "", 단위: null, 담은로직: [] })' in pre_side make = side.split("const make = (path: string[]): void => {")[1].split("\n };")[0]