feat: update server asset details, ui labels, and excel mapping logic

This commit is contained in:
2026-04-17 10:34:32 +09:00
parent 7158689fd0
commit 54bfb9d482
3 changed files with 61 additions and 22 deletions

View File

@@ -32,7 +32,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
tableWrapper.className = 'table-container';
if (state.activeSubTab === '개인PC') {
table.innerHTML = `<thead><tr><th>No</th><th>법인</th><th>자산코드</th><th>사용자</th><th>위치</th><th>CPU</th><th>GPU</th><th>RAM</th><th>SSD1</th><th>SSD2</th><th>HDD1</th><th>HDD2</th><th>구매일</th><th>금액</th><th>납품업체</th><th>품의서</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th><th>자산코드</th><th>사용자</th><th>위치</th><th>CPU</th><th>GPU</th><th>RAM</th><th>SSD1</th><th>SSD2</th><th>HDD1</th><th>HDD2</th><th>구매일</th><th>금액</th><th>납품업체</th><th>품의서</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
tableWrapper.appendChild(table);
container.appendChild(tableWrapper);
mainContent.appendChild(container);
@@ -46,7 +46,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
tbody.appendChild(tr);
});
} else if (state.activeSubTab === '스토리지') {
table.innerHTML = `<thead><tr><th>No</th><th>법인</th><th>유형</th><th>자산코드</th><th>명칭</th><th>위치</th><th>모델명</th><th>용량</th><th>담당자(정)</th><th>IP주소</th><th>구매일</th><th>금액</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th><th>유형</th><th>자산코드</th><th>명칭</th><th>위치</th><th>모델명</th><th>용량</th><th>담당자(정)</th><th>IP주소</th><th>구매일</th><th>금액</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
tableWrapper.appendChild(table);
container.appendChild(tableWrapper);
mainContent.appendChild(container);
@@ -64,8 +64,9 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
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();
const types = Array.from(new Set(fullList.map(a => a.storage유형))).filter(Boolean).sort();
const locations = Array.from(new Set(fullList.map(a => {
const loc = String(a. || '');
@@ -75,16 +76,23 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
filterBar.innerHTML = `
<div class="search-item flex-1">
<label>통합 검색 (자산번호/용도/모델명)</label>
<label>통합 검색 (자산번호/조직/용도/모델명)</label>
<input type="text" id="filter-keyword" placeholder="검색어를 입력하세요..." autocomplete="off">
</div>
<div class="search-item">
<label>법인</label>
<label>구매법인</label>
<select id="filter-corp">
<option value="">전체 법인</option>
${corps.map(c => `<option value="${c}">${c}</option>`).join('')}
</select>
</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>
<div class="search-item">
<label>유형</label>
<select id="filter-type">
@@ -105,7 +113,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
`;
container.appendChild(filterBar);
table.innerHTML = `<thead><tr><th>No</th><th>법인</th><th>자산번호</th><th>유형</th><th>용도</th><th>상세</th><th>설치위치</th><th>담당자</th><th>모델명</th><th>OS</th><th>CPU</th><th>RAM</th><th>Storage</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th><th>현 사용조직</th><th>자산번호</th><th>유형</th><th>용도</th><th>상세</th><th>설치위치</th><th>담당자</th><th>모델명</th><th>OS</th><th>CPU</th><th>RAM</th><th>Storage</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
tableWrapper.appendChild(table);
container.appendChild(tableWrapper);
mainContent.appendChild(container);
@@ -115,6 +123,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
const updateTable = () => {
const keyword = (document.getElementById('filter-keyword') as HTMLInputElement).value.toLowerCase().trim();
const corp = (document.getElementById('filter-corp') as HTMLSelectElement).value;
const orgUnit = (document.getElementById('filter-org-unit') as HTMLSelectElement).value;
const type = (document.getElementById('filter-type') as HTMLSelectElement).value;
const location = (document.getElementById('filter-location') as HTMLSelectElement).value;
@@ -126,9 +135,11 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
formatAsset(asset.).includes(keyword) ||
formatAsset(asset.).includes(keyword) ||
formatAsset(asset._정).includes(keyword) ||
formatAsset(asset.).includes(keyword) ||
formatAsset(asset._부).includes(keyword);
const matchCorp = !corp || asset. === corp;
const matchOrgUnit = !orgUnit || asset. === orgUnit;
const matchType = !type || asset.storage유형 === type;
let matchLocation = true;
@@ -141,12 +152,12 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
}
}
return matchKeyword && matchCorp && matchType && matchLocation;
return matchKeyword && matchCorp && matchOrgUnit && matchType && matchLocation;
});
tbody.innerHTML = '';
if (filtered.length === 0) {
tbody.innerHTML = `<tr><td colspan="13" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
tbody.innerHTML = `<tr><td colspan="14" style="text-align:center; padding: 3rem; color: var(--text-muted);">검색 결과가 없습니다.</td></tr>`;
return;
}
@@ -169,6 +180,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
tr.innerHTML = `
<td>${idx+1}</td>
<td class="text-nowrap">${formatInline(asset.)}</td>
<td class="text-nowrap">${formatInline(asset.)}</td>
<td class="text-nowrap">${formatInline(asset.)}</td>
<td class="text-nowrap">${formatInline(asset.storage유형)}</td>
<td class="text-nowrap">${formatInline(asset.)}</td>
@@ -205,7 +217,7 @@ function renderHwTable(table: HTMLTableElement, container: HTMLElement, mainCont
updateTable();
} else {
// 전산비품
table.innerHTML = `<thead><tr><th>No</th><th>법인</th>${state.activeSubTab === '전산비품' ? '<th>유형</th>' : ''}<th>자산코드</th><th>명칭</th><th>위치</th><th>관리자</th><th>구매일</th><th>금액</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
table.innerHTML = `<thead><tr><th>No</th><th>구매법인</th>${state.activeSubTab === '전산비품' ? '<th>유형</th>' : ''}<th>자산코드</th><th>명칭</th><th>위치</th><th>관리자</th><th>구매일</th><th>금액</th><th>관리</th></tr></thead><tbody id="dynamic-tbody"></tbody>`;
tableWrapper.appendChild(table);
container.appendChild(tableWrapper);
mainContent.appendChild(container);