feat(est-test): 수량산출서 엑셀형식 전환
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -187,13 +187,39 @@ const EstQuantitySheets = (() => {
|
||||
mark(sheet, index, start, end, EstQuantity.nextItemCode(sheet), editor.value);
|
||||
else free(sheet, index, start, editor.value);
|
||||
}, false);
|
||||
} else return false;
|
||||
} else if (name === "excel-mode") excelMode(state);
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// 엑셀형 수량산출서(원본 TFRMMULEXCEL) — 편집 화면은 native-excel-view.js.
|
||||
// 엑셀형식(popSetMode): 원본은 DataKind 를 바꿔 편집기를 갈아끼움 — 웹은 빈 엑셀 시트를 만들거나 끄고 켬(내용은 보관).
|
||||
function excelView(sheet) {
|
||||
return typeof EstExcelView === "undefined" ? "" : EstExcelView.render(sheet, EstApp.state);
|
||||
if (typeof EstExcelView === "undefined") return "";
|
||||
const on = sheet.excel?.length && !sheet.excelOff;
|
||||
return `<p><button data-action="excel-mode">${on ? "일반형식으로" : "엑셀형식으로"}</button></p>${on ? EstExcelView.render(sheet, EstApp.state) : ""}`;
|
||||
}
|
||||
function excelMode(state) {
|
||||
const sheet = state.project.quantitySheets?.find((s) => s.Code === state.quantitySheet);
|
||||
if (!sheet) throw Error("수량산출서를 고르세요.");
|
||||
const on = sheet.excel?.length && !sheet.excelOff;
|
||||
if (
|
||||
!confirm(
|
||||
on
|
||||
? "일반형식으로 바꾸시겠습니까? 엑셀 내용은 보관됩니다."
|
||||
: "엑셀형식으로 바꾸시겠습니까?",
|
||||
)
|
||||
)
|
||||
return;
|
||||
EstApp.change(() => {
|
||||
if (on) sheet.excelOff = true;
|
||||
else {
|
||||
sheet.excel ||= [{ name: "Sheet1", cells: {} }];
|
||||
sheet.excelLinks ||= {};
|
||||
delete sheet.excelOff;
|
||||
}
|
||||
sheet.excelEdited = true;
|
||||
}, false);
|
||||
}
|
||||
|
||||
return { copy, move, mark, free, excelView, matches, selector, handle };
|
||||
|
||||
Reference in New Issue
Block a user