feat(M01): PLAN 3-4 복사해서 만들기 화면 — 별칭 꼴 식 편집·표 바꾸기·로직 부르기 갈래·시험 계산·저장
- 새 M01_MasterData_UI_LogicLab_Copy.ts — [본떠 만들기] → GET /logic/formula(별칭 폼) 편집 → 표 바꾸기 모달(소요량·계수 검색) · 로직 부르기 그대로/같이 복사 갈래 · 식 줄 고치기·덧줄 더하기 → POST /logic/formula/preview 로 되돌린 실제 식을 buildCalc 로 재사용해 시험 계산 → POST /logic/formula/save 로 자체 로직(GX) 저장 · afterSave 로 LogicLab 이 새 키를 바로 엶 - 서버: POST /logic/formula/preview 새로 더함(저장 없이 별칭만 원문으로 되돌림) · 계약 7장 반영 - LogicLab.ts 는 「본떠 만들기」 단추 한 줄만 붙임(정본 로직 화면·New 화면은 안 건드림) - ORCA 로 13-4-1 을 본떠 저장 — 안 고치면 79,279.668 로 원본과 같음 · 석공 줄 곱 2배로 고치면 131,716.728 로 바뀜 확인 · 시험 흔적(GX000001·로직_자체.json·키대장 GX 번호) 지움·되돌림 - 시험 `test_m01_copy.py` 에 미리보기 시험 둘 더함 · M01 시험 130 통과 · typecheck 통과
This commit is contained in:
@@ -247,14 +247,23 @@ def logic_formula(key: str) -> dict:
|
||||
}
|
||||
|
||||
|
||||
def _gather(logic: dict, marks: list[dict]) -> dict:
|
||||
try:
|
||||
return mcp.gather(logic, marks)
|
||||
except cm.mf.FormulaError as e:
|
||||
raise store.StoreError(400, str(e)) from e
|
||||
|
||||
|
||||
def logic_formula_preview(logic: dict, marks: list[dict]) -> dict:
|
||||
"""별칭을 원문으로 되돌린 로직 줄만 — 저장 안 함(시험 계산 전 미리보기)."""
|
||||
return {"logic": _gather(logic, marks)}
|
||||
|
||||
|
||||
def logic_from_formula(
|
||||
logic: dict, marks: list[dict], owner: str = OWNERS[0], 이름: str = "", 본뜬키: str = ""
|
||||
) -> dict:
|
||||
"""고친 식 묶음을 자체 로직으로 저장 — 별칭을 원문으로 되돌린 뒤 `logic_new` 를 그대로 씀."""
|
||||
try:
|
||||
row = mcp.gather(logic, marks)
|
||||
except cm.mf.FormulaError as e:
|
||||
raise store.StoreError(400, str(e)) from e
|
||||
row = _gather(logic, marks)
|
||||
if 이름:
|
||||
row["이름"] = 이름
|
||||
if 본뜬키:
|
||||
|
||||
Reference in New Issue
Block a user