♻️ 排序&空数据处理

This commit is contained in:
BTMuli
2025-12-19 20:57:33 +08:00
parent 066c46bd19
commit 4ffcdda093
3 changed files with 24 additions and 6 deletions

View File

@@ -201,7 +201,9 @@ async function loadMaterialList(uid: number): Promise<void> {
tList.push({ type: info.type, number: material.count });
}
}
materialList.value = mList;
materialList.value = mList.sort(
(a, b) => a.info.type.localeCompare(b.info.type) || b.info.id - a.info.id,
);
materialShow.value = mList;
materialTypes.value = tList;
curIdx.value = 0;