diff --git a/src/modules/mileage/MonitoringView.tsx b/src/modules/mileage/MonitoringView.tsx
index fb517b8..78694ab 100644
--- a/src/modules/mileage/MonitoringView.tsx
+++ b/src/modules/mileage/MonitoringView.tsx
@@ -528,15 +528,15 @@ export default function MonitoringView() {
{fullscreenVehicles.map((v) => (
|
-
+
|
{v.plate} |
{v.customer || '-'} |
{v.rentStatus || '-'} |
{v.department || '-'} |
-
- {v.isDataSynced ? <>{Math.max(0, v.dailyKm || 0).toLocaleString()} km> : 未对接}
+
+ {(v.isDataSynced || v.totalKm != null) ? <>{Math.max(0, v.dailyKm || 0).toLocaleString()} km> : 未对接}
|
@@ -926,12 +926,12 @@ export default function MonitoringView() {
- {!v.isDataSynced && (
+ {!v.isDataSynced && v.totalKm == null && (
)}
今
-
- {v.isDataSynced ? <>{Math.max(0, v.dailyKm || 0).toLocaleString()} km> : 未对接}
+
+ {(v.isDataSynced || v.totalKm != null) ? <>{Math.max(0, v.dailyKm || 0).toLocaleString()} km> : 未对接}
diff --git a/src/modules/mileage/xlsx-export.ts b/src/modules/mileage/xlsx-export.ts
index 5b8de8e..dd413f2 100644
--- a/src/modules/mileage/xlsx-export.ts
+++ b/src/modules/mileage/xlsx-export.ts
@@ -18,10 +18,10 @@ function statusLabel(v: MonitoringVehicle): string {
function mileageCell(v: MonitoringVehicle, kind: 'today' | 'total'): string | number {
if (kind === 'today') {
- if (!v.isDataSynced) return '未对接';
+ // 当日未对接但有历史累计,视作今日 0;只有完全无数据才标「未对接」
+ if (!v.isDataSynced && v.totalKm == null) return '未对接';
return Math.max(0, Math.round(v.dailyKm || 0));
}
- // 累计里程:当日未对接也允许使用历史兜底值
return v.totalKm != null ? Math.round(v.totalKm) : '未对接';
}
|