feat: 전산비품 및 모바일기기 관리 기능 확장 (보관위치, 상태관리, 분출이력)

This commit is contained in:
2026-04-21 17:52:46 +09:00
parent 5ff991693a
commit ba7ce796d1
6 changed files with 342 additions and 381 deletions

View File

@@ -121,18 +121,25 @@ export function saveHardwareAsset(updatedAsset: HardwareAsset) {
const type = updatedAsset.type || '';
const detailPurpose = (updatedAsset as any). || updatedAsset.detail_purpose || '';
// 1. 타겟 카테고리 결정 (유연한 검색)
// 1. 타겟 카테고리 결정 (사용자 정의 그룹 기준)
let targetKey: keyof MasterAssetData = 'equip';
if (type.includes('서버') || detailPurpose.includes('서버')) {
const upperType = type.toUpperCase();
const isServer = type.includes('서버') || detailPurpose.includes('서버');
const isStorage = ['NAS', 'DAS', '스토리지'].some(t => type.includes(t));
const isMobileGroup = ['모바일', '태블릿', '노트북', '휴대폰', '핸드폰'].some(t => type.includes(t));
const isEquipGroup = ['CPU', 'RAM', 'HDD', 'GPU'].some(t => upperType.includes(t));
const isPc = type === 'PC' || type === '개인PC' || detailPurpose === '개인PC';
if (isServer) {
targetKey = 'server';
} else if (['NAS', 'DAS', '스토리지'].some(t => type.includes(t))) {
} else if (isStorage) {
targetKey = 'storage';
} else if (['모바일', '태블릿', '휴대폰', '핸드폰', '노트북'].some(t => type.includes(t))) {
} else if (isMobileGroup) {
targetKey = 'mobile';
} else if (type === 'PC' || type === '개인PC' || detailPurpose === '개인PC') {
} else if (isPc) {
targetKey = 'pc';
} else if (['CPU', 'GPU', 'RAM', 'HDD'].some(t => type.toUpperCase().includes(t))) {
} else if (isEquipGroup) {
targetKey = 'equip';
}