refactor: standardize modal system, unify hardware DB schemas, and implement automatic asset reclassification

This commit is contained in:
thlee3 committed 2026-04-20 17:56:19 +09:00
1 parent 5372cda59f
commit 5248b494e9
24 files changed
+5453 -1318

No files matched your search

+21
View File
@@ -54,3 +54,24 @@ export function getAssetChanges(oldAsset: any, newAsset: any, fields: {key: stri
});
return changes.join('\n');
}
/**
* 자산 목록 정렬 (방안 C: 구매법인별 -> 자산번호 순)
*/
export function sortAssets<T>(list: T[]): T[] {
return [...list].sort((a: any, b: any) => {
// 1순위: 구매법인 (한글 가나다순)
const corpA = String(a.법인 || '').trim();
const corpB = String(b.법인 || '').trim();
if (corpA < corpB) return -1;
if (corpA > corpB) return 1;
// 2순위: 자산번호 (영문/숫자순)
const codeA = String(a.자산코드 || a.자산번호 || '').trim();
const codeB = String(b.자산코드 || b.자산번호 || '').trim();
if (codeA < codeB) return -1;
if (codeA > codeB) return 1;
return 0;
});
}