feat: 대시보드 구분선 디자인 전환, 폰트 확대 및 버그 수정

This commit is contained in:
2026-06-12 08:49:04 +09:00
parent 0c1977f707
commit 8a3727ea61
22 changed files with 2238 additions and 1813 deletions

View File

@@ -83,6 +83,7 @@ function calculatePcScoreDeductive(cpu: string, ram: string, gpu: string, purcha
gpuDeduction = 25;
} else if (
gpuUpper.includes('RTX 4090') || gpuUpper.includes('RTX 4080') || gpuUpper.includes('RTX 4070') ||
gpuUpper.includes('RTX 3090') || gpuUpper.includes('RTX 3080') ||
gpuUpper.includes('RTX A5000') || gpuUpper.includes('RTX A6000') || gpuUpper.includes('RTX A4000')
) {
gpuDeduction = 0;
@@ -151,6 +152,7 @@ export interface ListViewConfig {
showLoc?: boolean;
showField?: boolean;
showType?: boolean;
showStatus?: boolean;
};
columns: ColumnDef[];
onRowClick?: (asset: any) => void;
@@ -165,7 +167,15 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
const fullList = config.dataSource();
let sortState: SortState = config.persistentSortState || { key: '', direction: 'asc' };
let currentFilters: any = { keyword: '', corp: '', dept: '', loc: '', field: '', type: '' };
if (!(state as any).listFilters) {
(state as any).listFilters = {};
}
const filterKey = config.title;
if (!(state as any).listFilters[filterKey]) {
(state as any).listFilters[filterKey] = { keyword: '', corp: '', dept: '', loc: '', field: '', type: '', status: '' };
}
let currentFilters: any = (state as any).listFilters[filterKey];
// 서버 및 PC 탭이 아닐 경우 '자산 현황' 뷰 진입 방지 및 강제 'asset' 모드
const isServerOrPc = config.title === '서버' || config.title === 'PC';
@@ -188,6 +198,9 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
</div>
<div style="display: flex; gap: 8px;">
${showPcFlowBtn ? `
<button id="btn-goto-parts-master" style="padding: 6px 14px !important; font-size: 12px !important; font-weight: 700 !important; background: white !important; color: var(--primary-color) !important; border: 1px solid var(--primary-color) !important; border-radius: 4px !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; width: fit-content !important; min-width: 0 !important; white-space: nowrap !important;">
<i data-lucide="settings" style="width: 14px; height: 14px;"></i> 부품 마스터
</button>
<button id="btn-pc-flow" style="padding: 6px 14px; font-size: 12px; font-weight: 700; background: white; color: var(--primary-color); border: 1px solid var(--primary-color); border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px;">
PC 이동/반납
</button>
@@ -850,8 +863,8 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
const status = a[ASSET_SCHEMA.HW_STATUS.key] || '';
const user = a[ASSET_SCHEMA.CURRENT_USER.key] || '';
// 사용 중이고 사용자가 할당되어 있으며, 직무가 재고PC가 아닌 실사용 기기 대상
return job !== '재고PC' && status === '사용중' && user.trim() !== '';
// 운영 중이고 사용자가 할당되어 있으며, 직무가 재고PC가 아닌 실사용 기기 대상
return job !== '재고PC' && status === '운영' && user.trim() !== '';
});
// 직무별 평균 점수 산출
@@ -882,10 +895,10 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
const avg = jobScores[job].avg;
if (avg > 0) {
if (score < avg * 0.8) {
if (score < avg * 0.6) {
pc['_spec_status'] = '사양 부족';
criticalPcList.push(pc);
} else if (score > avg * 1.3) {
} else if (score > avg * 1.5) {
pc['_spec_status'] = '오버스펙';
criticalPcList.push(pc);
}
@@ -1055,14 +1068,15 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
// 필터 바 초기화
renderFilterBar(filterBar, {
...config.filterOptions,
initialFilters: currentFilters,
onFilterChange: (filters) => {
currentFilters = { ...currentFilters, ...filters };
Object.assign(currentFilters, filters);
updateTable();
}
});
// 셀렉트 박스 채우기
const populateSelect = (selector: string, dataKey: string) => {
const populateSelect = (selector: string, dataKey: string, initialValue?: string) => {
const select = container.querySelector(selector) as HTMLSelectElement;
if (select) {
const getVal = (a: any) => dataKey === ASSET_SCHEMA.CURRENT_DEPT.key ? (a[dataKey] || a['현사용부서'] || a['현사용조직']) : a[dataKey];
@@ -1071,15 +1085,19 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
const opt = document.createElement('option');
opt.value = String(val);
opt.textContent = String(val);
if (initialValue && String(val) === initialValue) {
opt.selected = true;
}
select.appendChild(opt);
});
}
};
if (config.filterOptions.showLoc) populateSelect('#filter-loc', ASSET_SCHEMA.LOCATION.key);
if (config.filterOptions.showDept) populateSelect('#filter-dept', ASSET_SCHEMA.CURRENT_DEPT.key);
if (config.filterOptions.showCorp) populateSelect('#filter-corp', ASSET_SCHEMA.PURCHASE_CORP.key);
if (config.filterOptions.showType) populateSelect('#filter-type', ASSET_SCHEMA.ASSET_TYPE.key);
if (config.filterOptions.showLoc) populateSelect('#filter-loc', ASSET_SCHEMA.LOCATION.key, currentFilters.loc);
if (config.filterOptions.showDept) populateSelect('#filter-dept', ASSET_SCHEMA.CURRENT_DEPT.key, currentFilters.dept);
if (config.filterOptions.showCorp) populateSelect('#filter-corp', ASSET_SCHEMA.PURCHASE_CORP.key, currentFilters.corp);
if (config.filterOptions.showType) populateSelect('#filter-type', ASSET_SCHEMA.ASSET_TYPE.key, currentFilters.type);
if (config.filterOptions.showStatus) populateSelect('#filter-status', ASSET_SCHEMA.HW_STATUS.key, currentFilters.status);
// 초기 실행
switchView();