feat: 대시보드 미니 모달 상세 자산 목록 테이블에 등급 및 점수 컬럼 표기 기능 추가
This commit is contained in:
@@ -658,7 +658,7 @@ function showMiniListModal(title: string, list: any[]) {
|
||||
`;
|
||||
|
||||
modal.innerHTML = `
|
||||
<div style="background: white; border-radius: 12px; width: 680px; max-width: 90%; max-height: 80%; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); overflow: hidden; border: 1px solid #E2E8F0; animation: modalFadeIn 0.2s ease-out; color: #1E293B;">
|
||||
<div style="background: white; border-radius: 12px; width: 800px; max-width: 95%; max-height: 80%; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); overflow: hidden; border: 1px solid #E2E8F0; animation: modalFadeIn 0.2s ease-out; color: #1E293B;">
|
||||
<div style="padding: 1.25rem 1.75rem; border-bottom: 1px solid #F1F5F9; display: flex; justify-content: space-between; align-items: center; background: #F8FAFC;">
|
||||
<h3 style="margin: 0; font-size: 1.26rem; font-weight: 850; color: #1E5149; display: flex; align-items: center; gap: 0.5rem;">
|
||||
<span style="display:inline-block; width:8px; height:8px; border-radius:50%; background:#1E5149;"></span>
|
||||
@@ -673,23 +673,31 @@ function showMiniListModal(title: string, list: any[]) {
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: left; font-size: 1.01rem; table-layout: fixed;">
|
||||
<thead style="position: sticky; top: 0; background: white; z-index: 10;">
|
||||
<tr style="border-bottom: 2px solid #E2E8F0; color: #64748B; font-weight: 800; background: white;">
|
||||
<th style="padding: 10px 4px; width: 18%; background: white;">사용자</th>
|
||||
<th style="padding: 10px 4px; width: 35%; background: white;">조직 (직무)</th>
|
||||
<th style="padding: 10px 4px; width: 30%; background: white;">주요 사양</th>
|
||||
<th style="padding: 10px 4px; width: 14%; background: white;">사용자</th>
|
||||
<th style="padding: 10px 4px; width: 25%; background: white;">조직 (직무)</th>
|
||||
<th style="padding: 10px 4px; width: 28%; background: white;">주요 사양</th>
|
||||
<th style="padding: 10px 4px; width: 18%; text-align: center; background: white;">등급 (점수)</th>
|
||||
<th style="padding: 10px 4px; text-align: center; background: white;">자산코드</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${list.length === 0
|
||||
? `<tr><td colspan="4" style="text-align:center; padding:3rem; color:#94A3B8; font-weight:500;">해당 등급의 자산이 없습니다.</td></tr>`
|
||||
? `<tr><td colspan="5" style="text-align:center; padding:3rem; color:#94A3B8; font-weight:500;">해당 등급의 자산이 없습니다.</td></tr>`
|
||||
: list.map(pc => {
|
||||
const spec = `${pc.cpu || ''} / ${pc.ram || ''} / ${pc.gpu || '-'}`;
|
||||
const user = pc.user_current || '(재고)';
|
||||
const score = pc._pc_score !== undefined ? pc._pc_score : calculatePcScoreDeductive(pc.cpu, pc.ram, pc.gpu, pc.purchase_date);
|
||||
const win11Incompatible = isWindows11Incompatible(pc.cpu, pc.ram);
|
||||
const grade = getPcGrade(score, win11Incompatible);
|
||||
const badgeHTML = `<span class="badge ${grade.class}" style="font-size: 11px; padding: 2px 6px;">${grade.name}</span>`;
|
||||
const scoreHTML = `<strong style="color: ${grade.color}; font-size: 13px; margin-left: 4px;">${score}점</strong>`;
|
||||
|
||||
return `
|
||||
<tr style="border-bottom: 1px solid #F1F5F9; cursor: pointer; transition: background 0.2s;" class="mini-modal-row" data-id="${pc.id}" onmouseover="this.style.background='#F8FAFC'" onmouseout="this.style.background='none'">
|
||||
<td style="padding: 12px 4px; font-weight: 700; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${user}">${user}</td>
|
||||
<td style="padding: 12px 4px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${pc.current_dept || '-'} (${pc.user_position || '-'})">${pc.current_dept || '-'} (${pc.user_position || '-'})</td>
|
||||
<td style="padding: 12px 4px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${spec}">${spec}</td>
|
||||
<td style="padding: 12px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">${badgeHTML}${scoreHTML}</td>
|
||||
<td style="padding: 12px 4px; font-family: monospace; color: #475569; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${pc.asset_code || '-'}">${pc.asset_code || '-'}</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user