yxk-20260714

我的已阅 :按 read_time 倒序排序,最新已阅的排最前。
This commit is contained in:
ye1023
2026-07-14 15:25:50 +08:00
parent 7acbaf9d18
commit 93c1f71af9
@@ -8,7 +8,10 @@
待办
<span class="my-work__badge my-work__badge--danger">{{ todoTotal }}</span>
</div>
<div class="my-work__tab" :class="{ 'my-work__tab--active': activeTab === 'cc' }" @click="activeTab = 'cc'">待阅</div>
<div class="my-work__tab" :class="{ 'my-work__tab--active': activeTab === 'cc' }" @click="activeTab = 'cc'">
待阅
<span class="my-work__badge my-work__badge--danger">{{ ccTotal }}</span>
</div>
</div>
<ReloadOutlined class="my-work__refresh" :class="{ 'my-work__refresh--spinning': refreshing }" @click="handleRefresh" />
<a class="my-work__more" @click="goMore">
@@ -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) {