feat(mileage): 点击车辆卡片展示近 15 日行驶里程明细
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端新增 GET /api/mileage/vehicle/:plate/recent,返回近 N 天 + 今日的每日里程 - 缺失日补全为 dailyKm=0 + isDataSynced=false - 前端新增 VehicleDetailModal:头部信息、合计/日均/有数据天 KPI、近 N 日柱状图、每日明细列表 - 移动端从底部弹起;缺失日柱条置灰,明细行标注「未对接」 - 卡片点击改为打开弹窗(不再复制车牌) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,3 +61,17 @@ export async function fetchTrend(targetId?: number, days = 7): Promise<TrendPoin
|
||||
params.set('days', String(days));
|
||||
return fetchJson<TrendPoint[]>(`${BASE}/trend?${params.toString()}`);
|
||||
}
|
||||
|
||||
export interface VehicleRecentDay {
|
||||
date: string;
|
||||
dailyKm: number;
|
||||
isDataSynced: boolean;
|
||||
}
|
||||
|
||||
export async function fetchVehicleRecent(plate: string, days = 15): Promise<{ plate: string; days: VehicleRecentDay[] }> {
|
||||
const params = new URLSearchParams();
|
||||
params.set('days', String(days));
|
||||
return fetchJson<{ plate: string; days: VehicleRecentDay[] }>(
|
||||
`${BASE}/vehicle/${encodeURIComponent(plate)}/recent?${params.toString()}`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user