diff --git a/vehicle-data-platform/apps/web/src/App.tsx b/vehicle-data-platform/apps/web/src/App.tsx index 5a8c4651..29d41e94 100644 --- a/vehicle-data-platform/apps/web/src/App.tsx +++ b/vehicle-data-platform/apps/web/src/App.tsx @@ -429,9 +429,6 @@ export default function App() { const nextFilters = normalizeMileageFilterValues(filters); const nextVin = nextFilters.keyword?.trim() || analysisVin; const nextProtocol = nextFilters.protocol?.trim() ?? activeProtocol; - if (!nextVin) { - return; - } setAnalysisVin(nextVin); setActiveProtocol(nextProtocol); setMileageFilters({ ...nextFilters, keyword: nextVin, protocol: nextProtocol }); diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index 450ebca3..43e7b8f1 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -1215,6 +1215,73 @@ export function Dashboard({ onSecondary: () => exportDashboardSnapshot() } ]; + const customerServicePathItems = [ + { + title: '找车', + value: formatCount(serviceSummary?.totalVehicles), + detail: '按 VIN、车牌、手机号或 OEM 进入车辆服务,协议来源只作为证据。', + action: '车辆中心', + color: 'blue' as const, + onClick: () => onOpenVehicles({}) + }, + { + title: '看位置', + value: `${commandLocatedCount.toLocaleString()} 有定位`, + detail: '优先打开实时地图,判断车辆是否在线、坐标是否有效、是否存在断链。', + action: '实时地图', + color: commandLocatedCount > 0 ? 'green' as const : 'orange' as const, + onClick: () => onOpenMap({ online: 'online' }) + }, + { + title: '复盘时间', + value: dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo), + detail: '同一个时间窗贯穿轨迹回放、里程统计、RAW 证据和告警复盘。', + action: '轨迹回放', + color: 'blue' as const, + onClick: openTimeMonitorHistory + }, + { + title: '交付数据', + value: `${formatCount(summary?.frameToday)} 今日数据`, + detail: '按车辆、时间、字段裁剪导出位置历史、原始记录和字段明细。', + action: '数据导出', + color: 'blue' as const, + onClick: openTimeMonitorRaw + }, + { + title: '闭环异常', + value: `${formatCount(summary?.issueVehicles)} 告警`, + detail: highPriorityIssue ? `${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}` : '暂无高优先级告警,保持日常巡检。', + action: '告警事件', + color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const, + onClick: () => onOpenQuality() + } + ]; + const copyCustomerServiceGuide = () => { + const scope = timeMonitorScope(); + const rawFilters = { ...scope, tab: 'raw', includeFields: 'true' }; + const lines = [ + '【车辆客户服务说明】', + '服务对象:车辆,不是协议数据源。', + `车辆规模:${formatCount(serviceSummary?.totalVehicles)},在线车辆:${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)},有效定位:${commandLocatedCount.toLocaleString()}`, + `当前时间窗:${timeMonitorSummary}(${dayRangeText(scope.dateFrom, scope.dateTo)})`, + `告警车辆:${formatCount(summary?.issueVehicles)},最高优先级:${highPriorityIssue ? `${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}` : '暂无'}`, + '', + '客户服务路径:', + '1. 找车:先按 VIN、车牌、手机号或 OEM 锁定车辆。', + '2. 看位置:打开实时地图确认车辆在线、坐标和最新上报。', + '3. 复盘时间:同一时间窗查看轨迹、里程和告警。', + '4. 交付数据:按车辆、时间、字段导出位置历史、RAW 和字段明细。', + '5. 闭环异常:告警事件进入通知和处置流程。', + `车辆中心:${appURL(buildAppHash({ page: 'vehicles' }))}`, + `实时地图:${appURL(buildAppHash({ page: 'map', filters: { online: 'online' } }))}`, + `轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: scope.keyword, protocol: scope.protocol, filters: scope }))}`, + `里程统计:${appURL(buildAppHash({ page: 'mileage', keyword: scope.keyword, protocol: scope.protocol, filters: scope }))}`, + `数据导出:${appURL(buildAppHash({ page: 'history-query', keyword: scope.keyword, protocol: scope.protocol, filters: rawFilters }))}`, + `告警事件:${appURL(buildAppHash({ page: 'alert-events', keyword: scope.keyword, protocol: scope.protocol, filters: scope }))}` + ]; + copyText(lines.join('\n'), '客户服务说明'); + }; return (