diff --git a/src/views/dashboard/ProcessPortal/components/MyWork.vue b/src/views/dashboard/ProcessPortal/components/MyWork.vue index 8722663..0577137 100644 --- a/src/views/dashboard/ProcessPortal/components/MyWork.vue +++ b/src/views/dashboard/ProcessPortal/components/MyWork.vue @@ -8,7 +8,10 @@ 待办 {{ todoTotal }} -
待阅
+
+ 待阅 + {{ ccTotal }} +
@@ -84,6 +87,7 @@ const { createMessage } = useMessage(); const activeTab = ref<'todo' | 'cc'>('todo'); const todoTotal = ref(0); + const ccTotal = ref(0); const refreshing = ref(false); const emit = defineEmits(['refresh']); @@ -126,6 +130,7 @@ onMounted(() => { fetchTodoTotal(); + fetchCcTotal(); }); async function fetchTodoTotal() { @@ -137,6 +142,15 @@ } } + async function fetchCcTotal() { + try { + const res = await ccList({ isRead: 0, pageNo: 1, pageSize: 1 }); + ccTotal.value = res?.total ?? 0; + } catch (e) { + ccTotal.value = 0; + } + } + async function handleRefresh() { refreshing.value = true; try { @@ -146,6 +160,7 @@ reloadCc(); } await fetchTodoTotal(); + await fetchCcTotal(); emit('refresh'); } finally { refreshing.value = false; @@ -266,6 +281,7 @@ } await markRead(record.ccId); await reloadCc(); + await fetchCcTotal(); } function getTodoTableAction(record) {