feat(platform): add operations workflow cockpit

This commit is contained in:
lingniu
2026-07-04 14:58:42 +08:00
parent df37277717
commit cac978f46f
3 changed files with 211 additions and 0 deletions

View File

@@ -235,6 +235,7 @@ export function Dashboard({
const commandLocatedCount = locations.filter(hasValidCoordinate).length;
const commandDegradedCount = locations.filter((row) => row.onlineSourceCount <= 0 || row.onlineSourceCount < row.sourceCount).length;
const highPriorityIssue = qualityIssues.find((item) => item.severity === 'error') ?? qualityIssues[0];
const unhealthyLinkCount = (summary?.linkHealth ?? []).filter((item) => item.status !== 'ok').length;
const commandMapPoints: VehicleMapPoint[] = locations.map((row, index) => ({
id: row.vin || `${row.primaryProtocol || 'source'}-${index}`,
label: row.plate || row.vin || 'unknown',
@@ -285,6 +286,56 @@ export function Dashboard({
onClick: () => onOpenMileage()
}
];
const workflowSteps = [
{
title: '接入巡检',
value: unhealthyLinkCount > 0 ? `${unhealthyLinkCount.toLocaleString()} 项关注` : '链路正常',
color: unhealthyLinkCount > 0 ? 'orange' as const : 'green' as const,
detail: '检查平台转发、Kafka、Redis、MySQL、TDengine 等关键链路。',
action: '查看告警',
onClick: () => onOpenQuality()
},
{
title: '实时态势',
value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
color: 'green' as const,
detail: '确认车辆是否在线、是否有有效坐标以及来源是否完整。',
action: '实时监控',
onClick: () => onOpenRealtime({ online: 'online' })
},
{
title: '轨迹复盘',
value: `${formatCount(summary?.activeToday)} 活跃`,
color: 'blue' as const,
detail: '按车辆进入历史轨迹,复盘位置、速度、里程和断点。',
action: '轨迹回放',
onClick: () => onOpenHistory()
},
{
title: '历史证据',
value: `${formatCount(summary?.frameToday)}`,
color: 'blue' as const,
detail: '查询 RAW 帧和解析字段,形成可追溯的数据证据。',
action: '历史查询',
onClick: () => onOpenHistory({ tab: 'raw' })
},
{
title: '告警通知',
value: `${formatCount(summary?.issueVehicles)} 车辆`,
color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const,
detail: '把断链、缺 VIN、字段缺失等问题进入通知和处置队列。',
action: '告警通知',
onClick: () => onOpenQuality()
},
{
title: '统计复核',
value: `${formatCount(serviceSummary?.totalVehicles)} 车辆`,
color: 'green' as const,
detail: '核对里程统计口径,保证区间统计和每日统计闭合。',
action: '统计查询',
onClick: () => onOpenMileage()
}
];
return (
<div className="vp-page">
@@ -313,6 +364,31 @@ export function Dashboard({
<Tag color={(summary?.kafkaLag ?? 0) > 0 ? 'orange' : 'green'}>Kafka Lag {formatLag(summary?.kafkaLag)}</Tag>
</Space>
</Card>
<Card bordered title="全链路值班闭环" style={{ marginBottom: 16 }}>
<div className="vp-operation-flow">
{workflowSteps.map((item, index) => (
<div key={item.title} className="vp-operation-step">
<div className="vp-operation-index">{index + 1}</div>
<div className="vp-operation-content">
<Space spacing={8} align="center">
<Typography.Title heading={6} style={{ margin: 0 }}>{item.title}</Typography.Title>
<Tag color={item.color}>{item.value}</Tag>
</Space>
<Typography.Text type="secondary">{item.detail}</Typography.Text>
<Button
size="small"
theme="light"
type="primary"
aria-label={`闭环入口 ${item.title}`}
onClick={item.onClick}
>
{item.action}
</Button>
</div>
</div>
))}
</div>
</Card>
<Card bordered title="车辆业务能力矩阵" style={{ marginBottom: 16 }}>
<div className="vp-capability-grid">
{capabilities.map((item) => (