fix(projects): 未读消息数字对不上的问题修复
This commit is contained in:
@@ -296,12 +296,17 @@ async function onNotifyLinkClick(row: Api.NotifyMessage.NotifyMessage) {
|
|||||||
|
|
||||||
async function markAllRead() {
|
async function markAllRead() {
|
||||||
const { error } = await fetchUpdateAllNotifyMessageRead();
|
const { error } = await fetchUpdateAllNotifyMessageRead();
|
||||||
if (error) return;
|
if (error) {
|
||||||
|
window.$message?.error('全部标记已读失败,请重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
unreadCount.value = 0;
|
unreadCount.value = 0;
|
||||||
resetList('unread');
|
resetList('unread');
|
||||||
resetList('read');
|
resetList('read');
|
||||||
loadPage(activeTab.value);
|
loadPage(activeTab.value);
|
||||||
|
// 以后端真实未读数兜底校准,避免乐观置 0 与后端状态偏差(不必等 15s 轮询)
|
||||||
|
refreshUnreadCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
let pollTimer: ReturnType<typeof setInterval> | null = null;
|
let pollTimer: ReturnType<typeof setInterval> | null = null;
|
||||||
@@ -360,7 +365,7 @@ onBeforeUnmount(() => {
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span class="notification-bell__tab-label">
|
<span class="notification-bell__tab-label">
|
||||||
未读
|
未读
|
||||||
<span class="notification-bell__tab-count">{{ listStates.unread.total }}</span>
|
<span class="notification-bell__tab-count">{{ badgeLabel }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<ElScrollbar ref="unreadScrollbar" class="notification-bell__scroll">
|
<ElScrollbar ref="unreadScrollbar" class="notification-bell__scroll">
|
||||||
|
|||||||
Reference in New Issue
Block a user