yxk-20260714
我的已阅 :按 read_time 倒序排序,最新已阅的排最前。
This commit is contained in:
@@ -8,7 +8,10 @@
|
|||||||
待办
|
待办
|
||||||
<span class="my-work__badge my-work__badge--danger">{{ todoTotal }}</span>
|
<span class="my-work__badge my-work__badge--danger">{{ todoTotal }}</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<ReloadOutlined class="my-work__refresh" :class="{ 'my-work__refresh--spinning': refreshing }" @click="handleRefresh" />
|
<ReloadOutlined class="my-work__refresh" :class="{ 'my-work__refresh--spinning': refreshing }" @click="handleRefresh" />
|
||||||
<a class="my-work__more" @click="goMore">
|
<a class="my-work__more" @click="goMore">
|
||||||
@@ -84,6 +87,7 @@
|
|||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const activeTab = ref<'todo' | 'cc'>('todo');
|
const activeTab = ref<'todo' | 'cc'>('todo');
|
||||||
const todoTotal = ref(0);
|
const todoTotal = ref(0);
|
||||||
|
const ccTotal = ref(0);
|
||||||
const refreshing = ref(false);
|
const refreshing = ref(false);
|
||||||
|
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
@@ -126,6 +130,7 @@
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchTodoTotal();
|
fetchTodoTotal();
|
||||||
|
fetchCcTotal();
|
||||||
});
|
});
|
||||||
|
|
||||||
async function fetchTodoTotal() {
|
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() {
|
async function handleRefresh() {
|
||||||
refreshing.value = true;
|
refreshing.value = true;
|
||||||
try {
|
try {
|
||||||
@@ -146,6 +160,7 @@
|
|||||||
reloadCc();
|
reloadCc();
|
||||||
}
|
}
|
||||||
await fetchTodoTotal();
|
await fetchTodoTotal();
|
||||||
|
await fetchCcTotal();
|
||||||
emit('refresh');
|
emit('refresh');
|
||||||
} finally {
|
} finally {
|
||||||
refreshing.value = false;
|
refreshing.value = false;
|
||||||
@@ -266,6 +281,7 @@
|
|||||||
}
|
}
|
||||||
await markRead(record.ccId);
|
await markRead(record.ccId);
|
||||||
await reloadCc();
|
await reloadCc();
|
||||||
|
await fetchCcTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodoTableAction(record) {
|
function getTodoTableAction(record) {
|
||||||
|
|||||||
Reference in New Issue
Block a user