fix(dashboard): 修复刷新统计数据未更新问题
- 交换基本信息和今日数据概况面板位置,基本信息放左侧,今日数据概况放右侧 - 修改刷新统计数据方法调用,强制传入参数跳过缓存 - 删除测试通知按钮,简化界面 - 确保刷新数据按钮可用且显示加载状态 - 添加刷新成功提示,增强用户体验
This commit is contained in:
@@ -46,3 +46,10 @@
|
|||||||
- 原来各自独占整行的两个 panel,合并到一个 `<a-row>` 中,各占 `:md="12"`。
|
- 原来各自独占整行的两个 panel,合并到一个 `<a-row>` 中,各占 `:md="12"`。
|
||||||
- 今日数据概况栅格从 4 列改为 2 列(`grid-template-columns: repeat(2, 1fr)`),适配半宽空间。
|
- 今日数据概况栅格从 4 列改为 2 列(`grid-template-columns: repeat(2, 1fr)`),适配半宽空间。
|
||||||
- 基本信息 `a-descriptions` 列数改为 `:column="1"`,半宽下单列更不拥挤。
|
- 基本信息 `a-descriptions` 列数改为 `:column="1"`,半宽下单列更不拥挤。
|
||||||
|
- 基本信息(左)和今日数据概况(右)位置对调,基本信息在左、今日数据概况在右。
|
||||||
|
|
||||||
|
### 刷新统计数据修复
|
||||||
|
|
||||||
|
- 问题:点「刷新数据」按钮提示成功,但实际数据没更新。
|
||||||
|
- 根因:`refreshStatistics` 调用 `statisticsStore.fetchStatistics()` 未传 `forceRefresh=true`,5分钟缓存有效期内直接返回旧数据。
|
||||||
|
- 修复:改为 `fetchStatistics(true)` 强制跳过缓存。
|
||||||
|
|||||||
@@ -22,14 +22,12 @@
|
|||||||
<a-tooltip title="开启后每60秒自动检测新订单,检测到后播放叮声并语音播报">
|
<a-tooltip title="开启后每60秒自动检测新订单,检测到后播放叮声并语音播报">
|
||||||
<InfoCircleOutlined class="order-notify-info" />
|
<InfoCircleOutlined class="order-notify-info" />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-button size="small" :disabled="!notifyEnabled" @click="onTestNotify">测试</a-button>
|
<!-- <a-button size="small" :disabled="!notifyEnabled" @click="onTestNotify">测试</a-button>-->
|
||||||
</div>
|
|
||||||
<a-space>
|
|
||||||
<a-button size="small" @click="refreshStatistics" :loading="loading">
|
<a-button size="small" @click="refreshStatistics" :loading="loading">
|
||||||
<template #icon><ReloadOutlined /></template>
|
<template #icon><ReloadOutlined /></template>
|
||||||
刷新数据
|
刷新数据
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -729,10 +727,10 @@ const { enabled: notifyEnabled, hasNewOrder, toggle: onNotifyToggle, testNotify:
|
|||||||
onNewOrder: () => loadData()
|
onNewOrder: () => loadData()
|
||||||
});
|
});
|
||||||
|
|
||||||
// 刷新统计数据
|
// 刷新统计数据(强制刷新,跳过缓存)
|
||||||
const refreshStatistics = async () => {
|
const refreshStatistics = async () => {
|
||||||
try {
|
try {
|
||||||
await statisticsStore.fetchStatistics();
|
await statisticsStore.fetchStatistics(true);
|
||||||
message.success('统计数据刷新成功');
|
message.success('统计数据刷新成功');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('刷新统计数据失败:', error);
|
console.error('刷新统计数据失败:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user