fix(mileage): 累计里程展示不再被「未对接」状态盖掉
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
后端 cache 已用 fetchLatestPgTotalMileageMap 在当日 source=NONE 时 回填该车 ln_vehicle_day_total_pg 最近一条 total_mileage,但前端 表格 / 卡片 / Excel 都用 isDataSynced && totalKm != null 判定, 未对接车被锁回「未对接」文案。 调整为: - 今日里程仍按 isDataSynced 显示「未对接」(今天确实没增量) - 累计里程只看 totalKm 是否为 null,未对接但有历史值的车现在能显示 实测 粤A03423F:source=NONE / dailyKm=0 / totalKm=9205.6 原来「总: 未对接」→ 现在显示 9205.6 km Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,8 +17,11 @@ function statusLabel(v: MonitoringVehicle): string {
|
||||
}
|
||||
|
||||
function mileageCell(v: MonitoringVehicle, kind: 'today' | 'total'): string | number {
|
||||
if (!v.isDataSynced) return '未对接';
|
||||
if (kind === 'today') return Math.max(0, Math.round(v.dailyKm || 0));
|
||||
if (kind === 'today') {
|
||||
if (!v.isDataSynced) return '未对接';
|
||||
return Math.max(0, Math.round(v.dailyKm || 0));
|
||||
}
|
||||
// 累计里程:当日未对接也允许使用历史兜底值
|
||||
return v.totalKm != null ? Math.round(v.totalKm) : '未对接';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user