feat: 7月迭代
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m11s

This commit is contained in:
luo
2026-07-27 18:13:19 +08:00
parent 6a794d88af
commit 4f281da778
27 changed files with 1176 additions and 167 deletions

View File

@@ -57,6 +57,7 @@
const getCategoryText = (category) => ({
approval: '审批',
expiry: '临期',
exchange: '换货',
sync: '同步',
system: '系统'
}[category] || '通知');
@@ -68,6 +69,17 @@
critical: '严重'
}[severity] || '提示');
const getNotificationPriority = (item) => {
const severityRank = { info: 10, warning: 20, error: 30, critical: 40 };
const remainingDays = Number(item?.days_until_expiry ?? item?.days_remaining ?? item?.remaining_days);
const expiryLevel = String(item?.expiry_level || '').toLowerCase();
if (item?.category === 'expiry' && ((Number.isFinite(remainingDays) && remainingDays >= 0 && remainingDays <= 3) ||
['0_3', '0-3', '0~3', 'critical'].includes(expiryLevel))) {
return 100;
}
return severityRank[item?.severity] || 0;
};
const loadUnreadCount = async () => {
try {
const data = await notificationApi.getUnreadCount();
@@ -82,7 +94,7 @@
loading.value = true;
try {
const data = await notificationApi.getList(page.value, pageSize);
const items = data?.items || [];
const items = (data?.items || []).sort((a, b) => getNotificationPriority(b) - getNotificationPriority(a));
if (append) {
notifications.push(...items);
} else {