Merge remote-tracking branch 'origin/main_laptop_1' into sub_laptop_1
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
* 위쪽 다이어그램 = `…_UI_Milestone_Diagram`(상자 누름 = 모달 · [+] = 항목 추가 모달 · 팬 · 줌)
|
||||
* 경로 탭 = `…_UI_Milestone_Route`(길찾기 지도 그림만) · 데이터 · [저장] = `…_UI_Milestone_State`
|
||||
* 단가연결(251-4) = 항목 칸 앞 램프(초록 = 연결 · 노랑 = 없음 · 호버 = 무엇) · 줄 우클릭 [단가연결] ·
|
||||
* [단가연결 풀기] — 창 = 「운반 단가」 모달(253-3 · B09 운반공 줄과 같음 · 그 행 거리) · 경로 `ref` ·
|
||||
* B09 운반공 줄이 받음
|
||||
* [단가연결 풀기] — 창 = 연결 없음 → 단가연결 목록 → 옵션 값 창(276 · 옛 길) · 연결 있음 →
|
||||
* 「운반 단가」 모달(253-3 · B09 운반공 줄과 같음 · 그 행 거리) · 경로 `ref` · B09 운반공 줄이 받음
|
||||
* ========================================================================== */
|
||||
|
||||
import "./B08_Quantity_UI_Milestone.css";
|
||||
@@ -20,6 +20,7 @@ import { createButton, el, showToast } from "@ui/ui_template_elements";
|
||||
import { attachHoverInfo } from "@ui/ui_template_hover_info";
|
||||
import type { Row } from "../B09_Estimation/B09_Estimation_Calc_Base";
|
||||
import { openHaulModal } from "../B09_Estimation/B09_Estimation_UI_Haul_Modal";
|
||||
import { openPriceLink } from "../B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link";
|
||||
import { computeMilestone, type MilestoneRoute } from "./B08_Quantity_Milestone_Calc";
|
||||
import { createDiagram } from "./B08_Quantity_UI_Milestone_Diagram";
|
||||
import {
|
||||
@@ -157,12 +158,14 @@ function tableView(projectId: string): MilestoneView {
|
||||
[
|
||||
"단가연결",
|
||||
() =>
|
||||
openHaulModal({
|
||||
ref: (route.ref as Row | null) ?? null,
|
||||
dist: at && { L1: at.L1, L2: at.L2 },
|
||||
name: route.rows[at?.index ?? 0]?.item || route.name || "운반",
|
||||
apply: link,
|
||||
}),
|
||||
route.ref
|
||||
? openHaulModal({
|
||||
ref: route.ref as Row,
|
||||
dist: at && { L1: at.L1, L2: at.L2 },
|
||||
name: route.rows[at?.index ?? 0]?.item || route.name || "운반",
|
||||
apply: link,
|
||||
})
|
||||
: void openPriceLink({ apply: link }),
|
||||
],
|
||||
...(route.ref ? [["단가연결 풀기", () => link(null)] as [string, () => void]] : []),
|
||||
]);
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
* 거리 칸(운반거리 · Cm · 사이클시간 · t2) = 거리에서 채움(「거리에서」) · 손으로 고치면 덮음(`own`) ·
|
||||
* 빈칸으로 지우면 다시 거리에서. 옛 사이클 손 값(`cycle`) = 칸 없음 · [적용]하면 지움(기본값).
|
||||
* 조합 [적용] = 거리 · 손 값 사본(서버 · 같은 값 = 같은 사본) · 연결 {tab dg, key, lib, given, own}.
|
||||
* 연결 없는 줄도 같은 모달(빈칸 → [고르기]) · [적용] = 부르는 쪽 `apply`(캐시 → [저장] 때 서버 정본).
|
||||
* 여는 곳 = B08 거리이정표 표 우클릭 · B09 설계내역서 운반공 줄 단가연결.
|
||||
* [적용] = 부르는 쪽 `apply`(캐시 → [저장] 때 서버 정본) · 크기 = 큰 창보다 작게(276).
|
||||
* 여는 곳 = B08 거리이정표 표 우클릭 · B09 설계내역서 운반공 줄 단가연결 — 연결 있는 줄만(276 ·
|
||||
* 연결 없음 = 단가연결 목록 → 옵션 값 창 옛 길).
|
||||
* ========================================================================== */
|
||||
|
||||
import { API_BASE_URL, CURRENT_PROJECT_ID_KEY } from "@config/config_frontend";
|
||||
@@ -134,6 +135,11 @@ export function openHaulModal(o: HaulModalOpts): void {
|
||||
wide: true,
|
||||
dialogClass: "b09-haul-modal",
|
||||
mount: (body, close, head) => {
|
||||
// 크기(276) — 공용 큰 창(96vw × 94vh)보다 작게 · 가운데 · 몸 안 두 칸이 따로 스크롤
|
||||
body.parentElement?.setAttribute(
|
||||
"style",
|
||||
"--modal-max:min(680px,86vh);width:min(1100px,94vw);height:var(--modal-max)",
|
||||
);
|
||||
const title = el("strong");
|
||||
const linkBox = el("div", {
|
||||
attrs: { style: "display:flex;gap:8px;align-items:center;margin-bottom:8px" },
|
||||
@@ -388,7 +394,7 @@ export function openHaulModal(o: HaulModalOpts): void {
|
||||
el("div", {
|
||||
attrs: {
|
||||
style:
|
||||
"display:grid;grid-template-columns:minmax(320px,1fr) minmax(360px,1.4fr);gap:16px;min-height:60vh",
|
||||
"display:grid;grid-template-columns:minmax(300px,1fr) minmax(340px,1.4fr);gap:16px;flex:1;min-height:0",
|
||||
},
|
||||
children: [left, right],
|
||||
}),
|
||||
|
||||
@@ -144,7 +144,8 @@ export async function importLib(
|
||||
}
|
||||
|
||||
/** 항목 줄 단가연결 메뉴(251-6) — [단가연결 모달, 그 밖(로직 입력값 · 단가연결 풀기)] · ref = 지금 연결 ·
|
||||
* haul = 운반공 줄(253-3 · 그 행 거리 · 이름) → 「운반 단가」 모달([변경] = 같은 목록 · 263-1) */
|
||||
* haul = 운반공 줄(253-3 · 그 행 거리 · 이름) → 연결 있음 = 「운반 단가」 모달([변경] = 같은 목록 · 263-1) ·
|
||||
* 연결 없음 = 옛 길(목록 → 옵션 값 창 · 276) */
|
||||
export function linkItems(
|
||||
ctx: TabContext,
|
||||
ref: Row | null,
|
||||
@@ -163,7 +164,7 @@ export function linkItems(
|
||||
if (ref?.tab === "logic" && !haul)
|
||||
more.push(["로직 입력값 고치기", () => askInputs(apply, ref.code, ref.name || "", ref)]);
|
||||
if (ref) more.push(["단가연결 풀기", () => apply(null)]);
|
||||
return [[["단가연결", haul ? haulModal : priceLink]], more];
|
||||
return [[["단가연결", haul && ref ? haulModal : priceLink]], more];
|
||||
}
|
||||
|
||||
/** 단가연결 모달(251 · 159 · 160) — 한 목록에 단가산출 로직 · 일위대가 사전조합 · 구조물 조합(마스터 · 회사 ·
|
||||
|
||||
@@ -54,7 +54,7 @@ def test_모달_여는_곳():
|
||||
milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts")
|
||||
assert "openHaulModal({" in milestone and "L1: paved" in milestone
|
||||
link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts")
|
||||
assert '[["단가연결", haul ? haulModal : priceLink]]' in link
|
||||
assert '[["단가연결", haul && ref ? haulModal : priceLink]]' in link # 276 연결 있는 줄만
|
||||
edit = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Edit.ts")
|
||||
assert (
|
||||
'key.startsWith("haul:")' in edit
|
||||
|
||||
@@ -41,7 +41,7 @@ def test_변경_한_목록():
|
||||
link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts")
|
||||
assert "o.onPick ??" in link and "openHaulModal({ ...link, ref" in link
|
||||
milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts")
|
||||
assert "other:" not in milestone and "openPriceLink" not in milestone
|
||||
assert "other:" not in milestone # 276 = 연결 없음은 옛 길(openPriceLink) — test_276_1
|
||||
|
||||
|
||||
def test_거리_칸_자동_손_값_이김():
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
"""276 단가연결 — 연결 없음 = 옛 길(단가연결 목록 → 옵션 값 창) · 연결 있음 = 「운반 단가」 모달(작게) ·
|
||||
B08 거리이정표 · B09 운반공 줄 같음 · 옛 길 연결(own 없음 · 빈칸)도 서버가 그 행 거리로 채움."""
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from B08_Quantity.B08_Quantity_Haul_Cycle import fill_given # noqa: E402
|
||||
from B09_Estimation.B09_Estimation_Sangeun import _input_names # noqa: E402
|
||||
|
||||
|
||||
def _src(name: str) -> str:
|
||||
return re.sub(r"\s+", " ", (ROOT / name).read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def test_연결_있으면_운반_모달_없으면_옛_길():
|
||||
milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts")
|
||||
assert "() => route.ref ? openHaulModal({ ref: route.ref as Row," in milestone
|
||||
assert ": void openPriceLink({ apply: link })," in milestone
|
||||
link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts")
|
||||
assert '[["단가연결", haul && ref ? haulModal : priceLink]]' in link
|
||||
# 옛 길 = 목록에서 로직 고르면 옵션 값 창(askInputs)
|
||||
assert 'if (p.kind === "logic") askInputs(o.apply, p.code, p.name);' in link
|
||||
|
||||
|
||||
def test_운반_모달_작게():
|
||||
modal = _src("B09_Estimation/B09_Estimation_UI_Haul_Modal.ts")
|
||||
assert '"--modal-max:min(680px,86vh);width:min(1100px,94vw);height:var(--modal-max)"' in modal
|
||||
assert "min-height:60vh" not in modal and "flex:1;min-height:0" in modal
|
||||
|
||||
|
||||
def test_옛_길_연결도_거리로_채움():
|
||||
ref = {"tab": "logic", "code": "GF000284", "given": {}} # askInputs 꼴 — own 없음 · 빈칸
|
||||
got = fill_given(ref, _input_names("GF000284"), {"L1": 23.8, "L2": 10.5})
|
||||
assert got["운반거리"] == 34.3
|
||||
Reference in New Issue
Block a user