merge: main 브랜치의 최신 변경 사항 병합 및 충돌 해결
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { state } from '../../core/state';
|
||||
import { HardwareAsset } from '../../core/excelHandler';
|
||||
import { renderTable } from '../../views/AssetTableView';
|
||||
import { createIcons, Paperclip } from 'lucide';
|
||||
|
||||
let currentAsset: HardwareAsset | null = null;
|
||||
@@ -245,7 +244,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);
|
||||
@@ -260,7 +259,7 @@ export function initHwModal() {
|
||||
const deleteBtn = document.getElementById('btn-delete-hw-asset')!;
|
||||
|
||||
const closeModal = () => {
|
||||
modal.classList.add('hidden');
|
||||
closeModals();
|
||||
isEditMode = false;
|
||||
};
|
||||
|
||||
@@ -337,7 +336,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();
|
||||
}
|
||||
});
|
||||
@@ -346,7 +345,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