import { state } from '../../core/state'; import { openHwModal } from '../../components/Modal/HWModal'; export function renderMobileList(filterKeyword: string = '') { const container = document.getElementById('view-container'); if (!container) return; const items = state.masterData.mobile.filter(i => i.자산코드?.includes(filterKeyword) || i.사용자?.includes(filterKeyword) || i.명칭?.includes(filterKeyword) ); container.innerHTML = `

모바일 자산 현황

총 ${items.length}대
${items.length === 0 ? '' : items.map(i => ` `).join('')}
구분 자산번호 기기명 사용자 OS 도입일 상태 관리
데이터가 없습니다.
${i.법인 || 'HM'} ${i.자산코드 || '미부여'} ${i.명칭 || '-'} ${i.사용자 || i.관리자 || '-'} ${i.OS || '-'} ${i.도입일 || '-'} ${i.상태 || '사용중'}
`; container.querySelectorAll('.asset-row, .btn-detail').forEach(el => { el.addEventListener('click', (e) => { e.stopPropagation(); const id = (el as HTMLElement).getAttribute('data-id'); const asset = state.masterData.mobile.find(a => a.id === id); if (asset) openHwModal(asset, 'view'); }); }); document.getElementById('btn-add-mobile')?.addEventListener('click', () => { const newItem: any = { id: Math.random().toString(36).substring(2, 9), type: '모바일기기', 법인: 'HM', 상태: '사용중' }; openHwModal(newItem, 'add'); }); }