Merge all feature branches into main and optimize core architecture
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openSwModal } from '../../components/Modal/SWModal';
|
||||
import { formatPrice } from '../../core/utils';
|
||||
import { createIcons, Cloud, CreditCard, DollarSign } from 'lucide';
|
||||
|
||||
export function renderCloudList(container: HTMLElement) {
|
||||
@@ -93,7 +94,7 @@ export function renderCloudList(container: HTMLElement) {
|
||||
<td>${asset.계정명||''}</td>
|
||||
<td style="text-align:center;">${paymentBadge}</td>
|
||||
<td style="text-align:center;">${asset.결제일 ? asset.결제일 + '일' : ''}</td>
|
||||
<td style="text-align:right; font-weight:600;">₩ ${asset.당월청구액 ? Number(asset.당월청구액).toLocaleString() : '0'}</td>
|
||||
<td style="text-align:right; font-weight:600;">${asset.당월청구액 ? '₩ ' + formatPrice(asset.당월청구액) : '₩ 0'}</td>
|
||||
<td>${asset.비고||''}</td>
|
||||
`;
|
||||
|
||||
|
||||
@@ -1,116 +1,75 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openHwModal } from '../../components/Modal/HWModal';
|
||||
import { formatInline, sortAssets } from '../../core/utils';
|
||||
import { createIcons, RefreshCcw } from 'lucide';
|
||||
|
||||
export function renderEquipmentList(container: HTMLElement) {
|
||||
const fullList = sortAssets(state.masterData.equip);
|
||||
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
const corps = Array.from(new Set(fullList.map(a => a.법인))).filter(Boolean).sort();
|
||||
export function renderEquipmentList(filterKeyword: string = '') {
|
||||
const container = document.getElementById('view-container');
|
||||
if (!container) return;
|
||||
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
<label>통합 검색 (자산코드/명칭)</label>
|
||||
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
|
||||
const items = state.masterData.equip.filter(i =>
|
||||
i.자산코드?.includes(filterKeyword) ||
|
||||
i.명칭?.includes(filterKeyword) ||
|
||||
i.자산구분?.includes(filterKeyword)
|
||||
);
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="view-header">
|
||||
<div class="header-left">
|
||||
<h2>전산비품 자산 현황</h2>
|
||||
<span class="count-badge">총 ${items.length}개</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button id="btn-add-equip" class="btn btn-primary"><i data-lucide="plus"></i> 비품 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>구매법인</label>
|
||||
<select id="filter-corp"><option value="">전체 법인</option>${corps.map(c => `<option value="${c}">${c}</option>`).join('')}</select>
|
||||
<div class="table-container">
|
||||
<table class="itam-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>구분</th>
|
||||
<th>자산번호</th>
|
||||
<th>비품명</th>
|
||||
<th>모델명/상세</th>
|
||||
<th>위치</th>
|
||||
<th>사용자/관리자</th>
|
||||
<th>상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${items.length === 0 ? '<tr><td colspan="8" class="empty-row">데이터가 없습니다.</td></tr>' :
|
||||
items.map(i => `
|
||||
<tr class="asset-row" data-id="${i.id}">
|
||||
<td>${i.자산구분 || '기타'}</td>
|
||||
<td><span class="code-link">${i.자산코드 || '미부여'}</span></td>
|
||||
<td>${i.명칭 || '-'}</td>
|
||||
<td>${i.모델명 || i.HW사양 || '-'}</td>
|
||||
<td>${i.위치 || '-'}</td>
|
||||
<td>${i.사용자 || i.관리자 || '-'}</td>
|
||||
<td><span class="status-badge ${i.상태 === '사용중' ? 'active' : ''}">${i.상태 || '정상'}</span></td>
|
||||
<td><button class="btn btn-sm btn-outline btn-detail" data-id="${i.id}">상세</button></td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||
<i data-lucide="refresh-ccw"></i> 필터 초기화
|
||||
</button>
|
||||
<button id="btn-add-equip" class="btn btn-primary" style="margin-left: auto;">
|
||||
<i data-lucide="plus"></i> 자산 추가
|
||||
</button>
|
||||
`;
|
||||
container.appendChild(filterBar);
|
||||
|
||||
const tableWrapper = document.createElement('div');
|
||||
tableWrapper.className = 'table-container';
|
||||
const table = document.createElement('table');
|
||||
table.innerHTML = `
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;">No.</th>
|
||||
<th style="text-align:center;">상태</th>
|
||||
<th style="text-align:center;">구매법인</th>
|
||||
<th style="text-align:center;">유형</th>
|
||||
<th style="text-align:center;">자산번호</th>
|
||||
<th style="text-align:center;">모델명</th>
|
||||
<th style="text-align:center;">보관위치</th>
|
||||
<th style="text-align:center;">관리자</th>
|
||||
<th style="text-align:center;">구매연월</th>
|
||||
<th style="text-align:center;">금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dynamic-tbody"></tbody>
|
||||
`;
|
||||
|
||||
tableWrapper.appendChild(table);
|
||||
container.appendChild(tableWrapper);
|
||||
const tbody = table.querySelector('tbody')!;
|
||||
|
||||
const updateTable = () => {
|
||||
const keywordInput = document.getElementById('filter-keyword') as HTMLInputElement;
|
||||
const corpSelect = document.getElementById('filter-corp') as HTMLSelectElement;
|
||||
|
||||
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || String(asset.자산코드||'').toLowerCase().includes(keyword) || String(asset.모델명||'').toLowerCase().includes(keyword) || String(asset.현사용조직||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || asset.법인 === corp;
|
||||
return matchKeyword && matchCorp;
|
||||
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.equip.find(a => a.id === id);
|
||||
if (asset) openHwModal(asset, 'view');
|
||||
});
|
||||
|
||||
tbody.innerHTML = '';
|
||||
if (filtered.length === 0) {
|
||||
tbody.innerHTML = `<tr><td colspan="10" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
|
||||
const statusColors: Record<string, string> = {
|
||||
'대여중': '#3b82f6',
|
||||
'보관중': '#1E5149',
|
||||
'수리중': '#ef4444',
|
||||
'기타': '#6b7280'
|
||||
};
|
||||
const statusColor = statusColors[asset.현재상태 || '보관중'] || '#6b7280';
|
||||
const statusBadge = `<span style="background:${statusColor}; color:white; padding:2px 6px; border-radius:4px; font-size:0.75rem; font-weight:bold;">${asset.현재상태 || '보관중'}</span>`;
|
||||
|
||||
tr.innerHTML = `
|
||||
<td style="text-align:center;">${idx + 1}</td>
|
||||
<td style="text-align:center;">${statusBadge}</td>
|
||||
<td style="text-align:center;">${asset.법인}</td>
|
||||
<td style="text-align:center;">${asset.type}</td>
|
||||
<td style="font-weight:600; color:var(--primary-color);">${asset.자산코드 || '-'}</td>
|
||||
<td>${formatInline(asset.모델명 || asset.명칭)}</td>
|
||||
<td style="text-align:center;">${asset.보관위치 || '-'}</td>
|
||||
<td style="text-align:center;">${formatInline(asset.담당자_정 || asset.관리자)}</td>
|
||||
<td style="text-align:center;">${asset.구매일 || ''}</td>
|
||||
<td style="text-align:right;">${asset.금액 || '0'}</td>
|
||||
`;
|
||||
tr.addEventListener('click', (e) => {
|
||||
if (!(e.target as HTMLElement).closest('button')) openHwModal(asset, 'view');
|
||||
});
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
};
|
||||
|
||||
document.getElementById('filter-keyword')?.addEventListener('input', updateTable);
|
||||
document.getElementById('filter-corp')?.addEventListener('change', updateTable);
|
||||
document.getElementById('btn-reset-filters')?.addEventListener('click', () => {
|
||||
(document.getElementById('filter-keyword') as HTMLInputElement).value = '';
|
||||
(document.getElementById('filter-corp') as HTMLSelectElement).value = '';
|
||||
updateTable();
|
||||
});
|
||||
|
||||
updateTable();
|
||||
document.getElementById('btn-add-equip')?.addEventListener('click', () => {
|
||||
const newItem: any = {
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
type: '전산비품',
|
||||
법인: 'HM',
|
||||
상태: '사용중'
|
||||
};
|
||||
openHwModal(newItem, 'add');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,116 +1,75 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openHwModal } from '../../components/Modal/HWModal';
|
||||
import { formatInline, sortAssets } from '../../core/utils';
|
||||
import { createIcons, RefreshCcw } from 'lucide';
|
||||
|
||||
export function renderMobileList(container: HTMLElement) {
|
||||
const fullList = sortAssets(state.masterData.mobile);
|
||||
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
const corps = Array.from(new Set(fullList.map(a => a.법인))).filter(Boolean).sort();
|
||||
export function renderMobileList(filterKeyword: string = '') {
|
||||
const container = document.getElementById('view-container');
|
||||
if (!container) return;
|
||||
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
<label>통합 검색 (자산코드/명칭)</label>
|
||||
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
|
||||
const items = state.masterData.mobile.filter(i =>
|
||||
i.자산코드?.includes(filterKeyword) ||
|
||||
i.사용자?.includes(filterKeyword) ||
|
||||
i.명칭?.includes(filterKeyword)
|
||||
);
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="view-header">
|
||||
<div class="header-left">
|
||||
<h2>모바일 자산 현황</h2>
|
||||
<span class="count-badge">총 ${items.length}대</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button id="btn-add-mobile" class="btn btn-primary"><i data-lucide="plus"></i> 기기 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>구매법인</label>
|
||||
<select id="filter-corp"><option value="">전체 법인</option>${corps.map(c => `<option value="${c}">${c}</option>`).join('')}</select>
|
||||
<div class="table-container">
|
||||
<table class="itam-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>구분</th>
|
||||
<th>자산번호</th>
|
||||
<th>기기명</th>
|
||||
<th>사용자</th>
|
||||
<th>OS</th>
|
||||
<th>도입일</th>
|
||||
<th>상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${items.length === 0 ? '<tr><td colspan="8" class="empty-row">데이터가 없습니다.</td></tr>' :
|
||||
items.map(i => `
|
||||
<tr class="asset-row" data-id="${i.id}">
|
||||
<td>${i.법인 || 'HM'}</td>
|
||||
<td><span class="code-link">${i.자산코드 || '미부여'}</span></td>
|
||||
<td>${i.명칭 || '-'}</td>
|
||||
<td>${i.사용자 || i.관리자 || '-'}</td>
|
||||
<td>${i.OS || '-'}</td>
|
||||
<td>${i.도입일 || '-'}</td>
|
||||
<td><span class="status-badge ${i.상태 === '사용중' ? 'active' : ''}">${i.상태 || '사용중'}</span></td>
|
||||
<td><button class="btn btn-sm btn-outline btn-detail" data-id="${i.id}">상세</button></td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||
<i data-lucide="refresh-ccw"></i> 필터 초기화
|
||||
</button>
|
||||
<button id="btn-add-mobile" class="btn btn-primary" style="margin-left: auto;">
|
||||
<i data-lucide="plus"></i> 자산 추가
|
||||
</button>
|
||||
`;
|
||||
container.appendChild(filterBar);
|
||||
|
||||
const tableWrapper = document.createElement('div');
|
||||
tableWrapper.className = 'table-container';
|
||||
const table = document.createElement('table');
|
||||
table.innerHTML = `
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;">No.</th>
|
||||
<th style="text-align:center;">상태</th>
|
||||
<th style="text-align:center;">구매법인</th>
|
||||
<th style="text-align:center;">자산코드</th>
|
||||
<th style="text-align:center;">명칭</th>
|
||||
<th style="text-align:center;">보관위치</th>
|
||||
<th style="text-align:center;">관리자</th>
|
||||
<th style="text-align:center;">구매연월</th>
|
||||
<th style="text-align:center;">금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dynamic-tbody"></tbody>
|
||||
`;
|
||||
|
||||
|
||||
tableWrapper.appendChild(table);
|
||||
container.appendChild(tableWrapper);
|
||||
const tbody = table.querySelector('tbody')!;
|
||||
|
||||
const updateTable = () => {
|
||||
const keywordInput = document.getElementById('filter-keyword') as HTMLInputElement;
|
||||
const corpSelect = document.getElementById('filter-corp') as HTMLSelectElement;
|
||||
|
||||
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || String(asset.자산코드||'').toLowerCase().includes(keyword) || String(asset.모델명||'').toLowerCase().includes(keyword) || String(asset.현사용조직||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || asset.법인 === corp;
|
||||
return matchKeyword && matchCorp;
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
||||
tbody.innerHTML = '';
|
||||
if (filtered.length === 0) {
|
||||
tbody.innerHTML = `<tr><td colspan="10" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
|
||||
const statusColors: Record<string, string> = {
|
||||
'대여중': '#3b82f6',
|
||||
'보관중': '#1E5149',
|
||||
'수리중': '#ef4444',
|
||||
'기타': '#6b7280'
|
||||
};
|
||||
const statusColor = statusColors[asset.현재상태 || '보관중'] || '#6b7280';
|
||||
const statusBadge = `<span style="background:${statusColor}; color:white; padding:2px 6px; border-radius:4px; font-size:0.75rem; font-weight:bold;">${asset.현재상태 || '보관중'}</span>`;
|
||||
|
||||
tr.innerHTML = `
|
||||
<td style="text-align:center;">${idx + 1}</td>
|
||||
<td style="text-align:center;">${statusBadge}</td>
|
||||
<td style="text-align:center;">${asset.법인}</td>
|
||||
<td style="font-weight:600; color:var(--primary-color);">${asset.자산코드 || '-'}</td>
|
||||
<td>${formatInline(asset.명칭 || asset.모델명)}</td>
|
||||
<td style="text-align:center;">${asset.보관위치 || '-'}</td>
|
||||
<td style="text-align:center;">${formatInline(asset.관리자 || asset.담당자_정)}</td>
|
||||
<td style="text-align:center;">${asset.구매일 || ''}</td>
|
||||
<td style="text-align:right;">${asset.금액 || '0'}</td>
|
||||
`;
|
||||
tr.addEventListener('click', (e) => {
|
||||
if (!(e.target as HTMLElement).closest('button')) openHwModal(asset, 'view');
|
||||
});
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
};
|
||||
|
||||
document.getElementById('filter-keyword')?.addEventListener('input', updateTable);
|
||||
document.getElementById('filter-corp')?.addEventListener('change', updateTable);
|
||||
document.getElementById('btn-reset-filters')?.addEventListener('click', () => {
|
||||
(document.getElementById('filter-keyword') as HTMLInputElement).value = '';
|
||||
(document.getElementById('filter-corp') as HTMLSelectElement).value = '';
|
||||
updateTable();
|
||||
});
|
||||
|
||||
updateTable();
|
||||
}
|
||||
|
||||
document.getElementById('btn-add-mobile')?.addEventListener('click', () => {
|
||||
const newItem: any = {
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
type: '모바일기기',
|
||||
법인: 'HM',
|
||||
상태: '사용중'
|
||||
};
|
||||
openHwModal(newItem, 'add');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,92 +1,78 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openHwModal } from '../../components/Modal/HWModal';
|
||||
import { formatInline, sortAssets } from '../../core/utils';
|
||||
import { createIcons, Paperclip, RefreshCcw } from 'lucide';
|
||||
|
||||
export function renderPcList(container: HTMLElement) {
|
||||
const fullList = sortAssets(state.masterData.pc);
|
||||
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
const corps = Array.from(new Set(fullList.map(a => a.법인))).filter(Boolean).sort();
|
||||
export function renderPcList(filterKeyword: string = '') {
|
||||
const container = document.getElementById('view-container');
|
||||
if (!container) return;
|
||||
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
<label>통합 검색 (자산코드/사용자)</label>
|
||||
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
|
||||
const pcs = state.masterData.pc.filter(pc =>
|
||||
pc.자산코드?.includes(filterKeyword) ||
|
||||
pc.사용자?.includes(filterKeyword) ||
|
||||
pc.모델명?.includes(filterKeyword) ||
|
||||
pc.실사용조직?.includes(filterKeyword)
|
||||
);
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="view-header">
|
||||
<div class="header-left">
|
||||
<h2>개인PC 자산 현황</h2>
|
||||
<span class="count-badge">총 ${pcs.length}대</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button id="btn-add-pc" class="btn btn-primary"><i data-lucide="plus"></i> 신규 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>구매법인</label>
|
||||
<select id="filter-corp"><option value="">전체 법인</option>${corps.map(c => `<option value="${c}">${c}</option>`).join('')}</select>
|
||||
<div class="table-container">
|
||||
<table class="itam-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>구매법인</th>
|
||||
<th>자산번호</th>
|
||||
<th>실사용조직</th>
|
||||
<th>사용자</th>
|
||||
<th>모델명</th>
|
||||
<th>사양 (CPU/RAM)</th>
|
||||
<th>도입일</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${pcs.length === 0 ? '<tr><td colspan="8" class="empty-row">데이터가 없습니다.</td></tr>' :
|
||||
pcs.map(pc => `
|
||||
<tr class="asset-row" data-id="${pc.id}">
|
||||
<td>${pc.법인 || '-'}</td>
|
||||
<td><span class="code-link">${pc.자산코드 || pc.관리번호 || '미부여'}</span></td>
|
||||
<td>${pc.실사용조직 || pc.현사용조직 || '-'}</td>
|
||||
<td>${pc.사용자 || '-'}</td>
|
||||
<td>${pc.모델명 || '-'}</td>
|
||||
<td><small>${pc.CPU || '-'} / ${pc.RAM || '-'}</small></td>
|
||||
<td>${pc.도입일 || pc.구매일 || '-'}</td>
|
||||
<td><button class="btn btn-sm btn-outline btn-detail" data-id="${pc.id}">상세</button></td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||
<i data-lucide="refresh-ccw"></i> 필터 초기화
|
||||
</button>
|
||||
`;
|
||||
container.appendChild(filterBar);
|
||||
|
||||
const tableWrapper = document.createElement('div');
|
||||
tableWrapper.className = 'table-container';
|
||||
const table = document.createElement('table');
|
||||
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th><th>현 사용조직</th><th>자산코드</th><th>사용자</th><th>위치</th><th>CPU</th><th>RAM</th><th>Storage</th><th>구매연월</th><th>금액</th><th>품의서</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
|
||||
|
||||
tableWrapper.appendChild(table);
|
||||
container.appendChild(tableWrapper);
|
||||
|
||||
const tbody = table.querySelector('tbody')!;
|
||||
|
||||
const updateTable = () => {
|
||||
const keywordInput = document.getElementById('filter-keyword') as HTMLInputElement;
|
||||
const corpSelect = document.getElementById('filter-corp') as HTMLSelectElement;
|
||||
|
||||
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || String(asset.자산코드||'').toLowerCase().includes(keyword) || String(asset.사용자||'').toLowerCase().includes(keyword) || String(asset.현사용조직||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || asset.법인 === corp;
|
||||
return matchKeyword && matchCorp;
|
||||
// 이벤트 바인딩
|
||||
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.pc.find(a => a.id === id);
|
||||
if (asset) openHwModal(asset, 'view');
|
||||
});
|
||||
|
||||
tbody.innerHTML = '';
|
||||
if (filtered.length === 0) {
|
||||
tbody.innerHTML = `<tr><td colspan="13" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
const storage = [asset.SSD1, asset.SSD2, asset.HDD1].filter(v => v).join(' / ');
|
||||
|
||||
tr.innerHTML = `
|
||||
<td>${idx+1}</td>
|
||||
<td>${asset.법인}</td>
|
||||
<td>${asset.현사용조직||''}</td>
|
||||
<td>${asset.자산코드}</td>
|
||||
<td>${asset.사용자||''}</td>
|
||||
<td>${asset.위치||''}</td>
|
||||
<td>${asset.CPU||''}</td>
|
||||
<td>${asset.RAM||''}</td>
|
||||
<td>${formatInline(storage)}</td>
|
||||
<td>${asset.구매연월 || asset.구매일 || ''}</td>
|
||||
<td>${asset.금액||''}</td>
|
||||
<td style="text-align:center;">${asset.품의서명 ? '<i data-lucide="paperclip" class="text-primary"></i>' : '-'}</td>
|
||||
<td><button class="btn btn-outline btn-sm">수정</button></td>
|
||||
`;
|
||||
tr.addEventListener('click', (e) => { if (!(e.target as HTMLElement).closest('button')) openHwModal(asset, 'view'); });
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
createIcons({ icons: { Paperclip } });
|
||||
};
|
||||
|
||||
document.getElementById('filter-keyword')?.addEventListener('input', updateTable);
|
||||
document.getElementById('filter-corp')?.addEventListener('change', updateTable);
|
||||
document.getElementById('btn-reset-filters')?.addEventListener('click', () => {
|
||||
(document.getElementById('filter-keyword') as HTMLInputElement).value = '';
|
||||
(document.getElementById('filter-corp') as HTMLSelectElement).value = '';
|
||||
updateTable();
|
||||
});
|
||||
|
||||
updateTable();
|
||||
document.getElementById('btn-add-pc')?.addEventListener('click', () => {
|
||||
const newPc: any = {
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
type: '개인PC',
|
||||
법인: 'HM',
|
||||
관리조직: '전산팀',
|
||||
상태: '사용중'
|
||||
};
|
||||
openHwModal(newPc, 'add');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,109 +1,77 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openHwModal } from '../../components/Modal/HWModal';
|
||||
import { formatInline, createBadge, sortAssets } from '../../core/utils';
|
||||
import { createIcons, RefreshCcw } from 'lucide';
|
||||
|
||||
export function renderServerList(container: HTMLElement) {
|
||||
const fullList = sortAssets(state.masterData.server);
|
||||
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
const corps = Array.from(new Set(fullList.map(a => a.법인))).filter(Boolean).sort();
|
||||
const orgUnits = Array.from(new Set(fullList.map(a => a.현사용조직))).filter(Boolean).sort();
|
||||
export function renderServerList(filterKeyword: string = '') {
|
||||
const container = document.getElementById('view-container');
|
||||
if (!container) return;
|
||||
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
<label>통합 검색 (자산번호/조직/모델명)</label>
|
||||
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
|
||||
const servers = state.masterData.server.filter(s =>
|
||||
s.자산코드?.includes(filterKeyword) ||
|
||||
s.모델명?.includes(filterKeyword) ||
|
||||
s.IP주소?.includes(filterKeyword) ||
|
||||
s.실사용조직?.includes(filterKeyword)
|
||||
);
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="view-header">
|
||||
<div class="header-left">
|
||||
<h2>서버 자산 현황</h2>
|
||||
<span class="count-badge">총 ${servers.length}대</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button id="btn-add-server" class="btn btn-primary"><i data-lucide="plus"></i> 서버 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>구매법인</label>
|
||||
<select id="filter-corp"><option value="">전체 법인</option>${corps.map(c => `<option value="${c}">${c}</option>`).join('')}</select>
|
||||
<div class="table-container">
|
||||
<table class="itam-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>구분</th>
|
||||
<th>자산번호</th>
|
||||
<th>용도</th>
|
||||
<th>실사용조직</th>
|
||||
<th>IP 주소</th>
|
||||
<th>모델명</th>
|
||||
<th>상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${servers.length === 0 ? '<tr><td colspan="8" class="empty-row">데이터가 없습니다.</td></tr>' :
|
||||
servers.map(s => `
|
||||
<tr class="asset-row" data-id="${s.id}">
|
||||
<td>${s.법인 || 'HM'}</td>
|
||||
<td><span class="code-link">${s.자산코드 || '미부여'}</span></td>
|
||||
<td>${s.서버용도 || '-'}</td>
|
||||
<td>${s.실사용조직 || '-'}</td>
|
||||
<td><code>${s.IP주소 || '-'}</code></td>
|
||||
<td>${s.모델명 || '-'}</td>
|
||||
<td><span class="status-badge ${s.상태 === '사용중' ? 'active' : ''}">${s.상태 || '운영'}</span></td>
|
||||
<td><button class="btn btn-sm btn-outline btn-detail" data-id="${s.id}">상세</button></td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>현 사용조직</label>
|
||||
<select id="filter-org-unit"><option value="">전체 조직</option>${orgUnits.map(o => `<option value="${o}">${o}</option>`).join('')}</select>
|
||||
</div>
|
||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||
<i data-lucide="refresh-ccw"></i> 필터 초기화
|
||||
</button>
|
||||
`;
|
||||
container.appendChild(filterBar);
|
||||
|
||||
const tableWrapper = document.createElement('div');
|
||||
tableWrapper.className = 'table-container';
|
||||
const table = document.createElement('table');
|
||||
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th><th>현 사용조직</th><th>자산번호</th><th>용도</th><th>상세</th><th>설치위치</th><th>담당자</th><th>IP주소</th><th>모델명</th><th>OS</th><th>CPU/RAM</th><th>Storage</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
|
||||
|
||||
tableWrapper.appendChild(table);
|
||||
container.appendChild(tableWrapper);
|
||||
const tbody = table.querySelector('tbody')!;
|
||||
|
||||
const updateTable = () => {
|
||||
const keywordInput = document.getElementById('filter-keyword') as HTMLInputElement;
|
||||
const corpSelect = document.getElementById('filter-corp') as HTMLSelectElement;
|
||||
const orgSelect = document.getElementById('filter-org-unit') as HTMLSelectElement;
|
||||
|
||||
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
const orgUnit = orgSelect ? orgSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || String(asset.자산코드||'').toLowerCase().includes(keyword) || String(asset.현사용조직||'').toLowerCase().includes(keyword) || String(asset.모델명||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || asset.법인 === corp;
|
||||
const matchOrg = !orgUnit || asset.현사용조직 === orgUnit;
|
||||
return matchKeyword && matchCorp && matchOrg;
|
||||
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.server.find(a => a.id === id);
|
||||
if (asset) openHwModal(asset, 'view');
|
||||
});
|
||||
});
|
||||
|
||||
tbody.innerHTML = '';
|
||||
if (filtered.length === 0) {
|
||||
tbody.innerHTML = `<tr><td colspan="14" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
|
||||
const mainManager = asset.담당자_정 || '';
|
||||
const subManager = asset.담당자_부 || '';
|
||||
const managerHtml = [mainManager ? `${createBadge('정', '#1E5149')} ${mainManager}` : '', subManager ? `${createBadge('부', '#9CA3AF')} ${subManager}` : ''].filter(v => v !== '').join(' / ');
|
||||
|
||||
const ipInfo = [asset.IP주소, asset.IP2].filter(v => v).join(' / ');
|
||||
const cpuRam = [asset.CPU, asset.RAM].filter(v => v).join(' / ');
|
||||
const storage = [asset.SSD1, asset.SSD2].filter(v => v).join(' / ');
|
||||
|
||||
tr.innerHTML = `
|
||||
<td>${idx+1}</td>
|
||||
<td>${asset.법인}</td>
|
||||
<td>${asset.현사용조직||''}</td>
|
||||
<td>${asset.자산코드}</td>
|
||||
<td>${formatInline(asset.용도)}</td>
|
||||
<td>${formatInline(asset.상세)}</td>
|
||||
<td>${formatInline(asset.위치)}</td>
|
||||
<td>${managerHtml}</td>
|
||||
<td>${formatInline(ipInfo)}</td>
|
||||
<td>${asset.모델명||''}</td>
|
||||
<td>${asset.OS||''}</td>
|
||||
<td>${formatInline(cpuRam)}</td>
|
||||
<td>${formatInline(storage)}</td>
|
||||
<td><button class="btn btn-outline btn-sm">수정</button></td>
|
||||
`;
|
||||
tr.addEventListener('click', (e) => { if (!(e.target as HTMLElement).closest('button')) openHwModal(asset, 'view'); });
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
};
|
||||
|
||||
document.getElementById('filter-keyword')?.addEventListener('input', updateTable);
|
||||
document.getElementById('filter-corp')?.addEventListener('change', updateTable);
|
||||
document.getElementById('filter-org-unit')?.addEventListener('change', updateTable);
|
||||
document.getElementById('btn-reset-filters')?.addEventListener('click', () => {
|
||||
(document.getElementById('filter-keyword') as HTMLInputElement).value = '';
|
||||
(document.getElementById('filter-corp') as HTMLSelectElement).value = '';
|
||||
(document.getElementById('filter-org-unit') as HTMLSelectElement).value = '';
|
||||
updateTable();
|
||||
});
|
||||
|
||||
updateTable();
|
||||
}
|
||||
|
||||
document.getElementById('btn-add-server')?.addEventListener('click', () => {
|
||||
const newServer: any = {
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
type: '서버',
|
||||
법인: 'HM',
|
||||
관리조직: '전산팀',
|
||||
상태: '사용중'
|
||||
};
|
||||
openHwModal(newServer, 'add');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,160 +1,78 @@
|
||||
import { state } from '../../core/state';
|
||||
import { openSwModal } from '../../components/Modal/SWModal';
|
||||
import { openSwUserModal } from '../../components/Modal/SWUserModal';
|
||||
import { sortAssets } from '../../core/utils';
|
||||
import { CORP_LIST } from '../../components/Modal/SharedData';
|
||||
import { generateOptionsHTML } from '../../components/Modal/ModalUtils';
|
||||
import { createIcons, Edit2, Users, RefreshCcw } from 'lucide';
|
||||
|
||||
export function renderSwList(container: HTMLElement) {
|
||||
const isSub = state.activeSubTab === '구독SW';
|
||||
const fullList = sortAssets(isSub ? state.masterData.subSw : state.masterData.permSw);
|
||||
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
<label>통합 검색 (제품명/부서)</label>
|
||||
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
|
||||
export function renderSwList(filterKeyword: string = '') {
|
||||
const container = document.getElementById('view-container');
|
||||
if (!container) return;
|
||||
|
||||
const allSw = [...state.masterData.subSw, ...state.masterData.permSw].filter(sw =>
|
||||
sw.제품명?.includes(filterKeyword) ||
|
||||
sw.소프트웨어명?.includes(filterKeyword) ||
|
||||
sw.부서?.includes(filterKeyword)
|
||||
);
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="view-header">
|
||||
<div class="header-left">
|
||||
<h2>소프트웨어 자산 현황</h2>
|
||||
<span class="count-badge">총 ${allSw.length}건</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button id="btn-add-sw" class="btn btn-primary"><i data-lucide="plus"></i> S/W 등록</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>분야</label>
|
||||
<select id="filter-field">
|
||||
<option value="">전체 분야</option>
|
||||
<option value="업무공통">업무공통</option>
|
||||
<option value="개발S/W">개발S/W</option>
|
||||
<option value="디자인">디자인</option>
|
||||
<option value="설계S/W">설계S/W</option>
|
||||
</select>
|
||||
<div class="table-container">
|
||||
<table class="itam-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>구분</th>
|
||||
<th>제품명</th>
|
||||
<th>관리조직</th>
|
||||
<th>수량</th>
|
||||
<th>구매일</th>
|
||||
<th>만료일</th>
|
||||
<th>금액</th>
|
||||
<th>비고</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${allSw.length === 0 ? '<tr><td colspan="9" class="empty-row">데이터가 없습니다.</td></tr>' :
|
||||
allSw.map(sw => `
|
||||
<tr class="asset-row" data-id="${sw.id}" data-type="${sw.type}">
|
||||
<td><span class="type-badge ${sw.type === '구독SW' ? 'sub' : 'perm'}">${sw.type}</span></td>
|
||||
<td><strong>${sw.소프트웨어명 || sw.제품명 || '-'}</strong></td>
|
||||
<td>${sw.부서 || '-'}</td>
|
||||
<td>${sw.수량 || '1'}</td>
|
||||
<td>${sw.구매일 || '-'}</td>
|
||||
<td>${sw.만료일 || '-'}</td>
|
||||
<td>${sw.금액 || '-'}</td>
|
||||
<td><small>${sw.비고 || ''}</small></td>
|
||||
<td><button class="btn btn-sm btn-outline btn-detail" data-id="${sw.id}" data-type="${sw.type}">상세</button></td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>구매법인</label>
|
||||
<select id="filter-corp">${generateOptionsHTML(CORP_LIST, '', true)}</select>
|
||||
</div>
|
||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||
<i data-lucide="refresh-ccw"></i> 필터 초기화
|
||||
</button>
|
||||
`;
|
||||
container.appendChild(filterBar);
|
||||
|
||||
const tableWrapper = document.createElement('div');
|
||||
tableWrapper.className = 'table-container';
|
||||
const table = document.createElement('table');
|
||||
table.innerHTML = `
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;">No.</th>
|
||||
<th style="text-align:center;">상태</th>
|
||||
<th style="text-align:center;">분야</th>
|
||||
<th style="text-align:center;">구매법인</th>
|
||||
<th style="text-align:center;">부서</th>
|
||||
<th style="text-align:center;">제품명</th>
|
||||
<th style="text-align:center;">구매연월</th>
|
||||
${isSub ? '<th style="text-align:center;">구독일</th>' : ''}
|
||||
<th style="text-align:center;">금액</th>
|
||||
<th style="text-align:center;">수량</th>
|
||||
<th style="text-align:center;">사용가능</th>
|
||||
<th style="text-align:center;">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dynamic-tbody"></tbody>
|
||||
`;
|
||||
|
||||
tableWrapper.appendChild(table);
|
||||
container.appendChild(tableWrapper);
|
||||
const tbody = table.querySelector('tbody')!;
|
||||
|
||||
const updateTable = () => {
|
||||
const keywordInput = document.getElementById('filter-keyword') as HTMLInputElement;
|
||||
const fieldSelect = document.getElementById('filter-field') as HTMLSelectElement;
|
||||
const corpSelect = document.getElementById('filter-corp') as HTMLSelectElement;
|
||||
|
||||
const keyword = keywordInput ? keywordInput.value.toLowerCase().trim() : '';
|
||||
const field = fieldSelect ? fieldSelect.value : '';
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || (asset.제품명 || '').toLowerCase().includes(keyword) || (asset.부서 || '').toLowerCase().includes(keyword);
|
||||
const matchField = !field || asset.분야 === field;
|
||||
const matchCorp = !corp || asset.법인 === corp;
|
||||
return matchKeyword && matchField && matchCorp;
|
||||
container.querySelectorAll('.asset-row, .btn-detail').forEach(el => {
|
||||
el.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
const id = (el as HTMLElement).getAttribute('data-id');
|
||||
const type = (el as HTMLElement).getAttribute('data-type');
|
||||
const asset = [...state.masterData.subSw, ...state.masterData.permSw].find(a => a.id === id);
|
||||
if (asset) openSwModal(asset);
|
||||
});
|
||||
|
||||
tbody.innerHTML = '';
|
||||
if (filtered.length === 0) {
|
||||
tbody.innerHTML = `<tr><td colspan="${isSub ? 12 : 11}" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
|
||||
return;
|
||||
}
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const assigned = state.masterData.swUsers.filter(u => u.sw_id === asset.id).length;
|
||||
const qty = typeof asset.수량 === 'number' ? asset.수량 : parseInt(asset.수량||'0', 10);
|
||||
const avail = qty - assigned;
|
||||
|
||||
let statusHtml = '';
|
||||
if (isSub) {
|
||||
let isExpired = false;
|
||||
if (asset.구독일) {
|
||||
const parts = asset.구독일.split('~');
|
||||
const endDateStr = parts[parts.length - 1].trim().replace(/\./g, '-');
|
||||
const endDate = new Date(endDateStr);
|
||||
if (!isNaN(endDate.getTime())) {
|
||||
endDate.setHours(23, 59, 59, 999);
|
||||
if (endDate < new Date()) isExpired = true;
|
||||
}
|
||||
}
|
||||
if (isExpired) statusHtml = `<span style="background: var(--danger, #ef4444); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; white-space: nowrap;">만료</span>`;
|
||||
else statusHtml = `<span style="background: var(--primary-color, #1E5149); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; white-space: nowrap;">사용중</span>`;
|
||||
} else {
|
||||
if (asset.유지보수여부) statusHtml = `<span style="background: #3b82f6; color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; white-space: nowrap;">유효</span>`;
|
||||
else statusHtml = `<span style="background: #6b7280; color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; white-space: nowrap;">없음</span>`;
|
||||
}
|
||||
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
|
||||
tr.innerHTML = `
|
||||
<td style="text-align:center;">${idx+1}</td>
|
||||
<td style="text-align:center;">${statusHtml}</td>
|
||||
<td>${asset.분야||''}</td>
|
||||
<td>${asset.법인}</td>
|
||||
<td>${asset.부서||''}</td>
|
||||
<td>${asset.제품명}</td>
|
||||
<td style="text-align:center;">${asset.구매일||''}</td>
|
||||
${isSub ? `<td style="text-align:center;">${asset.구독일||''}</td>` : ''}
|
||||
<td style="text-align:right;">${asset.금액||'0'}</td>
|
||||
<td style="text-align:center;">${qty}</td>
|
||||
<td style="text-align:center;"><strong style="color: ${avail > 0 ? 'var(--primary-color)' : 'var(--danger)'}">${avail}</strong></td>
|
||||
<td style="display:flex; justify-content:center; align-items:center; gap:0.5rem;">
|
||||
<button type="button" class="btn-icon btn-edit" title="수정" style="color: var(--text-muted);"><i data-lucide="edit-2"></i></button>
|
||||
<button type="button" class="btn-icon btn-users" title="사용자 관리" style="color: var(--primary-color);"><i data-lucide="users"></i></button>
|
||||
</td>
|
||||
`;
|
||||
|
||||
tr.addEventListener('click', (e) => {
|
||||
if (!(e.target as HTMLElement).closest('button')) {
|
||||
openSwModal(asset, 'view');
|
||||
}
|
||||
});
|
||||
tr.querySelector('.btn-edit')?.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
openSwModal(asset, 'edit');
|
||||
});
|
||||
tr.querySelector('.btn-users')?.addEventListener('click', (e) => { e.stopPropagation(); openSwUserModal(asset); });
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
createIcons({ icons: { Edit2, Users, RefreshCcw } });
|
||||
};
|
||||
|
||||
document.getElementById('filter-keyword')?.addEventListener('input', updateTable);
|
||||
document.getElementById('filter-field')?.addEventListener('change', updateTable);
|
||||
document.getElementById('filter-corp')?.addEventListener('change', updateTable);
|
||||
document.getElementById('btn-reset-filters')?.addEventListener('click', () => {
|
||||
(document.getElementById('filter-keyword') as HTMLInputElement).value = '';
|
||||
(document.getElementById('filter-field') as HTMLSelectElement).value = '';
|
||||
(document.getElementById('filter-corp') as HTMLSelectElement).value = '';
|
||||
updateTable();
|
||||
});
|
||||
|
||||
updateTable();
|
||||
document.getElementById('btn-add-sw')?.addEventListener('click', () => {
|
||||
const newSw: any = {
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
type: '구독SW',
|
||||
수량: 1,
|
||||
부서: '전산팀'
|
||||
};
|
||||
openSwModal(newSw);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user