feat: 모든 카테고리(HW, SW, SW 사용자) DB 일괄 덮어쓰기 저장 기능 구현
This commit is contained in:
@@ -230,7 +230,7 @@ function fillHwFormData(asset: HardwareAsset) {
|
||||
}
|
||||
}
|
||||
|
||||
export function initHwModal() {
|
||||
export function initHwModal(onSave: () => void, closeModals: () => void) {
|
||||
// HTML 주입
|
||||
if (!document.getElementById('hw-asset-modal')) {
|
||||
document.body.insertAdjacentHTML('beforeend', HW_MODAL_HTML);
|
||||
@@ -245,7 +245,7 @@ export function initHwModal() {
|
||||
const deleteBtn = document.getElementById('btn-delete-hw-asset')!;
|
||||
|
||||
const closeModal = () => {
|
||||
modal.classList.add('hidden');
|
||||
closeModals();
|
||||
isEditMode = false;
|
||||
};
|
||||
|
||||
@@ -319,7 +319,7 @@ export function initHwModal() {
|
||||
const idx = state.masterData.hw.findIndex(a => a.id === assetId);
|
||||
if (idx > -1) {
|
||||
state.masterData.hw[idx] = updated;
|
||||
renderTable(document.getElementById('main-content')!);
|
||||
onSave();
|
||||
switchToViewMode();
|
||||
}
|
||||
});
|
||||
@@ -328,7 +328,7 @@ export function initHwModal() {
|
||||
if (!currentAsset) return;
|
||||
if (confirm('정말로 이 자산을 삭제하시겠습니까?')) {
|
||||
state.masterData.hw = state.masterData.hw.filter(a => a.id !== currentAsset!.id);
|
||||
renderTable(document.getElementById('main-content')!);
|
||||
onSave();
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user