refactor(855-E L3ⓐ): M01 [로직 복사/생성] = 원본 수식 문서 복제 — 옛 별칭 꼴 시트 화면 걷음
- [로직 복사/생성] 누름 = 기본정보 창(있는 askBasicInfo · 원본 값 채움) → /logic/copy 로 원본 문서를 새 자체 GX 문서로 복제 → 그 기초를 줄 쌓기로 엶
- 걷음: 화면 LogicLab_Copy.ts · Logic_Calc.ts(부르는 곳 = 서로뿐) · API fetchLogicFormula · saveLogicFormula · previewLogicFormula · 꼴 셋 · 글 키 · CSS m01copy (서버 길 /logic/formula · save · preview 는 앞 auto 커밋 cce57c298 에서 걷음 · openapi 뜻한 셋만 빠짐)
- 시험: test_modal_top_and_add_word 복사 시트 창 줄 뺌(걷은 파일 · CSS 의 글자 대조 줄)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* M01_MasterData_UI_LogicLab_Basic.ts
|
||||
* 「신규 로직」 기본정보 칸 — 이름 · 원문번호 · 결과 단위 · 출처(구분 = 자체). 확인하면 값을 돌려줌 · 취소면 null
|
||||
* 저장은 하지 않음 — 부른 쪽이 빈 시트 줄로 캐시(drafts)에 넣고 [저장] 때 서버가 GX 새 키를 줌.
|
||||
* [로직 복사/생성]도 이 창(원본 값을 채워 엶 · 855 L3 ⓐ) — 부른 쪽이 `/logic/copy` 로 문서를 복제.
|
||||
* ========================================================================== */
|
||||
|
||||
import { currentLanguageIndex } from "@ui/ui_template_locale";
|
||||
@@ -10,6 +11,7 @@ import { openModal } from "@ui/ui_template_modal";
|
||||
|
||||
const TEXT = {
|
||||
Title: ["신규 로직", "New logic"],
|
||||
CopyTitle: ["로직 복사/생성", "Copy / create logic"],
|
||||
Name: ["이름", "Name"],
|
||||
NamePh: ["예: 돌쌓기 메쌓기(인력)", "e.g. dry stone wall (labour)"],
|
||||
Number: ["원문번호", "Source number"],
|
||||
@@ -31,8 +33,8 @@ export interface BasicInfo {
|
||||
출처: string;
|
||||
}
|
||||
|
||||
/** 기본정보 묻기 — units = 결과 단위 후보(마스터 로직의 결과단위) */
|
||||
export function askBasicInfo(units: string[]): Promise<BasicInfo | null> {
|
||||
/** 기본정보 묻기 — units = 결과 단위 후보(마스터 로직의 결과단위) · start = 처음 값(복사 = 원본 값) */
|
||||
export function askBasicInfo(units: string[], start?: BasicInfo): Promise<BasicInfo | null> {
|
||||
return new Promise((resolve) => {
|
||||
let done = false;
|
||||
const finish = (v: BasicInfo | null): void => {
|
||||
@@ -40,22 +42,33 @@ export function askBasicInfo(units: string[]): Promise<BasicInfo | null> {
|
||||
done = true;
|
||||
resolve(v);
|
||||
};
|
||||
const name = createInputField({ label: tb("Name"), placeholder: tb("NamePh"), compact: true });
|
||||
const name = createInputField({
|
||||
label: tb("Name"),
|
||||
placeholder: tb("NamePh"),
|
||||
value: start?.이름 ?? "",
|
||||
compact: true,
|
||||
});
|
||||
const number = createInputField({
|
||||
label: tb("Number"),
|
||||
placeholder: tb("NumberPh"),
|
||||
value: start?.원문번호 ?? "",
|
||||
compact: true,
|
||||
});
|
||||
if (start?.결과단위 && !units.includes(start.결과단위)) units = [start.결과단위, ...units];
|
||||
const unit = createSelectField({
|
||||
label: tb("Unit"),
|
||||
options: units.map((u) => ({ value: u, text: u })),
|
||||
value: units[0] ?? "원",
|
||||
value: start?.결과단위 || (units[0] ?? "원"),
|
||||
compact: true,
|
||||
});
|
||||
const source = createInputField({
|
||||
label: tb("Source"),
|
||||
value: start?.출처 || "자체",
|
||||
compact: true,
|
||||
});
|
||||
const source = createInputField({ label: tb("Source"), value: "자체", compact: true });
|
||||
const why = el("p", { className: "ui-text ui-text--muted", attrs: { role: "alert" } });
|
||||
const modal = openModal({
|
||||
title: tb("Title"),
|
||||
title: tb(start ? "CopyTitle" : "Title"),
|
||||
closeLabel: tb("Close"),
|
||||
beforeClose: () => {
|
||||
finish(null);
|
||||
|
||||
Reference in New Issue
Block a user