feat: 完善接口19-顶部通知铃铛与站内通知中心
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m5s

This commit is contained in:
luo
2026-07-25 10:20:53 +08:00
parent eb13763020
commit 9289a6e940
37 changed files with 1264 additions and 226 deletions

View File

@@ -39,7 +39,7 @@
</span>
<span class="text">
<strong>{{ item.title }}</strong>
<small>{{ item.content }}</small>
<small>{{ item.body }}</small>
<time>{{ item.created_at || '-' }}</time>
</span>
<span v-if="!isRead(item)" class="unread-dot" />
@@ -85,23 +85,23 @@
return item.category === category
}
const isRead = (item: NotificationItem) =>
item.read === true || item.is_read === true || item.read_status === 'read'
const isRead = (item: NotificationItem) => item.is_read
const filteredItems = computed(() =>
notificationStore.summary.items.filter((item) => categoryMatches(item, activeCategory.value))
notificationStore.recentNotifications.filter((item) =>
categoryMatches(item, activeCategory.value)
)
)
const tabs = computed(() => {
const categories = notificationStore.summary.categories || {}
return [
{ value: 'all', label: '全部', count: notificationStore.unreadCount },
{ value: 'approval', label: '审批', count: categories.approval || 0 },
{ value: 'expiry', label: '临期', count: categories.expiry || categories.expiring || 0 },
{ value: 'all', label: '全部', count: notificationStore.summary.total },
{ value: 'approval', label: '审批', count: notificationStore.summary.approval },
{ value: 'expiry', label: '临期', count: notificationStore.summary.expiry },
{
value: 'system',
label: '同步/系统',
count: (categories.sync || 0) + (categories.system || 0)
count: notificationStore.summary.sync + notificationStore.summary.system
}
]
})
@@ -135,11 +135,11 @@
}
const targetResponse = await NotificationService.getTarget(item.id)
if (targetResponse.code !== 0 || !targetResponse.data) {
ElMessage.info(item.content || '该通知暂无可跳转目标')
ElMessage.info(item.body || '该通知暂无可跳转目标')
return
}
if (!navigateNotificationTarget(router, targetResponse.data)) {
ElMessage.info(targetResponse.data.message || item.content || '该通知暂无可跳转目标')
ElMessage.info(item.body || '该通知暂无可跳转目标')
} else {
close()
}