From 1662daf43665f10dcea92457597aaab73fd576ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 16 Jul 2026 21:32:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20=E4=BF=AE=E5=A4=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 交换基本信息和今日数据概况面板位置,基本信息放左侧,今日数据概况放右侧 - 修改刷新统计数据方法调用,强制传入参数跳过缓存 - 删除测试通知按钮,简化界面 - 确保刷新数据按钮可用且显示加载状态 - 添加刷新成功提示,增强用户体验 --- .workbuddy/memory/2026-07-16.md | 7 +++++++ src/views/shop/dashboard/index.vue | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.workbuddy/memory/2026-07-16.md b/.workbuddy/memory/2026-07-16.md index cc1254a..8f88a01 100644 --- a/.workbuddy/memory/2026-07-16.md +++ b/.workbuddy/memory/2026-07-16.md @@ -46,3 +46,10 @@ - 原来各自独占整行的两个 panel,合并到一个 `` 中,各占 `:md="12"`。 - 今日数据概况栅格从 4 列改为 2 列(`grid-template-columns: repeat(2, 1fr)`),适配半宽空间。 - 基本信息 `a-descriptions` 列数改为 `:column="1"`,半宽下单列更不拥挤。 + - 基本信息(左)和今日数据概况(右)位置对调,基本信息在左、今日数据概况在右。 + +### 刷新统计数据修复 + +- 问题:点「刷新数据」按钮提示成功,但实际数据没更新。 +- 根因:`refreshStatistics` 调用 `statisticsStore.fetchStatistics()` 未传 `forceRefresh=true`,5分钟缓存有效期内直接返回旧数据。 +- 修复:改为 `fetchStatistics(true)` 强制跳过缓存。 diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue index c6289ee..0d933a2 100644 --- a/src/views/shop/dashboard/index.vue +++ b/src/views/shop/dashboard/index.vue @@ -22,14 +22,12 @@ - 测试 - - + 刷新数据 - + @@ -729,10 +727,10 @@ const { enabled: notifyEnabled, hasNewOrder, toggle: onNotifyToggle, testNotify: onNewOrder: () => loadData() }); -// 刷新统计数据 +// 刷新统计数据(强制刷新,跳过缓存) const refreshStatistics = async () => { try { - await statisticsStore.fetchStatistics(); + await statisticsStore.fetchStatistics(true); message.success('统计数据刷新成功'); } catch (error) { console.error('刷新统计数据失败:', error);