feat(platform): streamline dashboard around vehicle workflows

This commit is contained in:
lingniu
2026-07-05 15:02:14 +08:00
parent e829f143e7
commit 2824982b60
2 changed files with 46 additions and 46 deletions

View File

@@ -956,10 +956,10 @@ export function Dashboard({
onClick: openTimeMonitorHistory
},
{
label: '里程核对',
label: '统计查询',
value: `${formatCount(serviceSummary?.totalVehicles)} 车辆`,
detail: '用同一范围核对区间里程和日统计闭合。',
action: '核对里程',
action: '查看统计',
color: 'green' as const,
onClick: openTimeMonitorMileage
},
@@ -1405,9 +1405,9 @@ export function Dashboard({
onClick: openTimeMonitorHistory
},
{
title: '里程核对',
title: '统计查询',
description: '按车辆口径核对区间里程、日统计和异常来源。',
action: '里程统计',
action: '统计查询',
evidence: `${formatCount(serviceSummary?.totalVehicles)} 辆可统计`,
onClick: openTimeMonitorMileage
},
@@ -1507,7 +1507,7 @@ export function Dashboard({
</div>
<div className="vp-fleet-monitor-panel">
<div className="vp-fleet-monitor-panel-head">
<Typography.Text strong></Typography.Text>
<Typography.Text strong></Typography.Text>
<Button size="small" theme="light" type="primary" onClick={copyCustomerServiceGuide}></Button>
</div>
<div className="vp-fleet-next-actions">
@@ -1526,7 +1526,7 @@ export function Dashboard({
</button>
))}
</div>
<Typography.Text strong></Typography.Text>
<Typography.Text strong></Typography.Text>
<div className="vp-fleet-monitor-actions">
{customerCockpitWorkflows.map((item) => (
<button key={item.title} type="button" className="vp-fleet-monitor-action" onClick={item.onClick} aria-label={`客户车辆工作流 ${item.title} ${item.action}`}>
@@ -1543,10 +1543,10 @@ export function Dashboard({
<Tag color={timeMonitorScope().keyword ? 'green' : 'grey'}>{timeMonitorScope().keyword ? '单车' : '全域'}</Tag>
</Space>
<strong>{timeMonitorSummary}</strong>
<span></span>
<span></span>
<Space wrap>
<Button size="small" theme="solid" type="primary" onClick={openTimeMonitorHistory}></Button>
<Button size="small" theme="light" type="primary" onClick={openTimeMonitorMileage}></Button>
<Button size="small" theme="light" type="primary" onClick={openTimeMonitorMileage}></Button>
<Button size="small" theme="light" type="primary" onClick={openTimeMonitorRaw}></Button>
</Space>
</div>
@@ -1561,39 +1561,6 @@ export function Dashboard({
</div>
</div>
</Card>
<Card bordered title="车辆服务指挥台" style={{ marginBottom: 16 }}>
<div className="vp-command-center-grid">
{commandCenterItems.map((item) => (
<div key={item.title} className="vp-command-center-item">
<div className="vp-command-center-head">
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
</div>
<Typography.Text type="secondary">{item.detail}</Typography.Text>
<Space wrap>
<Button
size="small"
theme="solid"
type="primary"
aria-label={`车辆服务指挥台 ${item.title} ${item.primaryAction}`}
onClick={item.onPrimary}
>
{item.primaryAction}
</Button>
<Button
size="small"
theme="light"
type="primary"
aria-label={`车辆服务指挥台 ${item.title} ${item.secondaryAction}`}
onClick={item.onSecondary}
>
{item.secondaryAction}
</Button>
</Space>
</div>
))}
</div>
</Card>
<Card
bordered
title={<Space><span></span><Tag color="blue">{timeMonitorSummary}</Tag></Space>}
@@ -1749,9 +1716,42 @@ export function Dashboard({
<details className="vp-dashboard-secondary-details">
<summary>
<span></span>
<small>KPI </small>
<small>KPI </small>
</summary>
<div className="vp-dashboard-secondary-body">
<Card bordered title="车辆服务指挥台" style={{ marginBottom: 16 }}>
<div className="vp-command-center-grid">
{commandCenterItems.map((item) => (
<div key={item.title} className="vp-command-center-item">
<div className="vp-command-center-head">
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
</div>
<Typography.Text type="secondary">{item.detail}</Typography.Text>
<Space wrap>
<Button
size="small"
theme="solid"
type="primary"
aria-label={`车辆服务指挥台 ${item.title} ${item.primaryAction}`}
onClick={item.onPrimary}
>
{item.primaryAction}
</Button>
<Button
size="small"
theme="light"
type="primary"
aria-label={`车辆服务指挥台 ${item.title} ${item.secondaryAction}`}
onClick={item.onSecondary}
>
{item.secondaryAction}
</Button>
</Space>
</div>
))}
</div>
</Card>
<Card bordered title="客户常用服务" style={{ marginBottom: 16 }}>
<div className="vp-customer-workflow-grid">
{customerHeroActions.map((item) => (

View File

@@ -802,17 +802,17 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
expect(screen.getByText('客户主流程围绕车辆本身:地图看车、实时状态、时间窗复盘、里程统计、历史数据导出和告警通知。接入来源只作为追溯证据。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆监控指标 车辆总数 1,033' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆监控指标 在线车辆 208' })).toBeInTheDocument();
expect(screen.getByText('下一步建议')).toBeInTheDocument();
expect(screen.getByText('今日先处理')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆运营建议 先处理告警车辆 进入告警' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆运营建议 选择一辆车复盘 车辆中心' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆运营建议 按同一范围交付数据 复制复盘包' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 实时看车 实时地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 轨迹复盘 轨迹回放' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 里程核对 里程统计' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 统计查询 统计查询' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 数据交付 历史导出' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆工作流 告警通知 告警事件' })).toBeInTheDocument();
expect(screen.getByText('来源只作为可信度证据,不作为客户主导航。')).toBeInTheDocument();
expect(screen.getByText('同一时间窗会同步用于轨迹回放、区间里程、历史查询和告警复盘。')).toBeInTheDocument();
expect(screen.getByText('同一时间窗会同步用于轨迹回放、统计查询、历史查询和告警复盘。')).toBeInTheDocument();
expect(screen.getByText('车辆服务指挥台')).toBeInTheDocument();
expect(screen.getByText('全域车辆监控')).toBeInTheDocument();
expect(screen.getByText('异常车辆闭环')).toBeInTheDocument();
@@ -871,7 +871,7 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
expect(screen.getAllByText('统计里程').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('历史查询导出')).toBeInTheDocument();
expect(screen.getAllByText('轨迹回放').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('里程核对').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('统计查询').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('历史证据').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('告警复盘').length).toBeGreaterThanOrEqual(1);
expect(screen.getByRole('button', { name: '时间窗作业 轨迹回放 打开轨迹' })).toBeInTheDocument();