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);