From 5fd9878c38f04e5bdefeb428a9c3aa57a2728ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Fri, 7 Aug 2026 18:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(staff):=20on-demand=20modal=20=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E4=BB=85=E5=9C=A8=E6=97=A5=E6=9C=9F=E7=AA=97=E6=9C=AA?= =?UTF-8?q?=E5=8F=98=E6=97=B6=E5=9B=9E=E5=86=99=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/views/StaffList.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index b2a2fb2..6b459ad 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -371,13 +371,15 @@ function openWechatCommModal(row: Account, metric: ChatMetric): void { // 复用已缓存的 stats;点击早于列表加载完成则按需补拉。 let stats = staffStats.value[row.account_id] if (!stats) { + const start = statsStart.value + const end = statsEnd.value try { - stats = await getStaffChatStats({ - owner_account_id: row.account_id, - start: statsStart.value, - end: statsEnd.value, - }) - staffStats.value[row.account_id] = stats + stats = await getStaffChatStats({ owner_account_id: row.account_id, start, end }) + // 仅当日期窗未变时回写缓存:避免旧窗 on-demand 结果覆盖日期切换后的新数据 + // (loadWechatStats 的 token 守卫负责批量重查)。 + if (statsStart.value === start && statsEnd.value === end) { + staffStats.value[row.account_id] = stats + } } catch { return { items: [], total: 0, page, page_size } }