feat: SW 통합 모달 구현 및 대시보드 자산 추가 기능 고도화

- SW 모달(구독, 영구, 클라우드) 통합 및 레이아웃 최적화
- 모든 자산 상세 모달에 '조회/수정 모드' 전환 로직(Edit Lock) 적용
- 하드웨어/소프트웨어 대시보드에서 '자산 추가' 버튼 연동 및 기본값 설정
- 클라우드 자산 리스트의 데이터 소스를 DB 직결(cloud_assets) 방식으로 변경
- 클라우드 자산 저장 API 연동 및 불필요한 구형 모달(CloudModal) 제거
- 리스트 뷰에서 상세 보기 시 '조회 모드'로 열리도록 호출 로직 수정
This commit is contained in:
2026-04-21 11:37:13 +09:00
parent 153e422180
commit d983ad469f
4 changed files with 258 additions and 96 deletions

View File

@@ -1,9 +1,10 @@
import { state } from '../../core/state';
import { openCloudModal } from '../../components/Modal/CloudModal';
import { openSwModal } from '../../components/Modal/SWModal';
import { createIcons, Cloud, CreditCard, DollarSign } from 'lucide';
export function renderCloudList(container: HTMLElement) {
const fullList = state.masterData.sw.filter(a => a.type === '클라우드');
// DB에서 직접 로드된 전용 배열을 사용하여 데이터 소스를 일원화함
const getFullList = () => state.masterData.cloud || [];
const filterBar = document.createElement('div');
filterBar.className = 'search-bar';
@@ -58,7 +59,7 @@ export function renderCloudList(container: HTMLElement) {
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
const payment = paymentSelect ? paymentSelect.value : '';
const filtered = fullList.filter(asset => {
const filtered = getFullList().filter(asset => {
const kwMatch = !keyword ||
(asset. || '').toLowerCase().includes(keyword) ||
(asset. || '').toLowerCase().includes(keyword) ||
@@ -96,7 +97,7 @@ export function renderCloudList(container: HTMLElement) {
<td>${asset.||''}</td>
`;
tr.addEventListener('click', () => openCloudModal(asset));
tr.addEventListener('click', () => openSwModal(asset, 'view'));
tbody.appendChild(tr);
});
createIcons({ icons: { Cloud, CreditCard, DollarSign } });