feat(platform): sharpen customer vehicle workspace

This commit is contained in:
lingniu
2026-07-05 04:30:20 +08:00
parent 84a1f70284
commit f5cfc86d63
3 changed files with 153 additions and 26 deletions

View File

@@ -397,7 +397,7 @@ export function Dashboard({
}));
const customerHeroActions = [
{
title: '实时车辆地图',
title: '车辆地图',
value: `${commandLocatedCount.toLocaleString()} 辆有定位`,
detail: '按车查看实时位置、在线状态、速度和最新上报时间。',
action: '进入地图',
@@ -418,13 +418,50 @@ export function Dashboard({
onClick: () => onOpenMileage({})
},
{
title: '历史数据导出',
title: '数据导出',
value: `${formatCount(summary?.frameToday)} 今日数据`,
detail: '按车辆、时间和字段裁剪查询历史位置与原始记录。',
action: '查询导出',
onClick: () => onOpenHistory({ tab: 'raw', includeFields: 'true' })
}
];
const customerJourneySteps = [
{
step: '01',
title: '定位车辆',
detail: '先在地图上确认车辆是否在线、坐标是否可信。',
action: '车辆地图',
onClick: () => onOpenMap({ online: 'online' })
},
{
step: '02',
title: '查看状态',
detail: '进入实时监控查看速度、SOC、里程和最新上报。',
action: '实时监控',
onClick: () => onOpenRealtime({ online: 'online' })
},
{
step: '03',
title: '复盘轨迹',
detail: '按自定义时间窗回放位置、速度和里程断点。',
action: '轨迹回放',
onClick: () => onOpenHistory()
},
{
step: '04',
title: '统计里程',
detail: '用同一时间窗核对区间里程和每日统计。',
action: '里程统计',
onClick: () => onOpenMileage({})
},
{
step: '05',
title: '导出交付',
detail: '导出历史位置、原始记录、字段明细和告警证据。',
action: '数据导出',
onClick: () => openTimeMonitorRaw()
}
];
const customerHealthItems = [
{
label: '在线车辆',
@@ -1285,20 +1322,26 @@ export function Dashboard({
return (
<div className="vp-page">
<PageHeader title="车辆运营监控台" description="面向客户的车辆地图、实时状态、轨迹回放、里程统计、历史查询和数据导出入口" />
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、里程统计、自定义时间监控、历史查询、告警通知和数据导出" />
<Spin spinning={loading}>
<Card bordered className="vp-customer-hero" bodyStyle={{ padding: 0 }}>
<div className="vp-customer-hero-map">
<div className="vp-customer-hero-copy">
<Typography.Title heading={3} style={{ margin: 0 }}></Typography.Title>
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '地图可用' : '地图待配置'}</Tag>
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} </Tag>
</Space>
<Typography.Title heading={3} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary">
32960808 MQTT 线
32960808 MQTT
</Typography.Text>
<Space wrap>
<Button theme="solid" type="primary" onClick={() => onOpenMap({ online: 'online' })}></Button>
<Button theme="light" type="primary" onClick={() => onOpenHistory()}></Button>
<Button theme="light" type="primary" onClick={() => onOpenMileage({})}></Button>
<Button theme="light" onClick={exportDashboardSnapshot}></Button>
<Button theme="light" type="primary" onClick={openTimeMonitorRaw}></Button>
<Button theme="light" onClick={copyCustomerServiceGuide}></Button>
</Space>
</div>
<VehicleMap
@@ -1310,8 +1353,24 @@ export function Dashboard({
</div>
<div className="vp-customer-hero-side">
<div className="vp-customer-hero-side-head">
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '地图可用' : '地图待配置'}</Tag>
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} </Tag>
<Typography.Text strong></Typography.Text>
<Button size="small" theme="light" type="primary" onClick={copyCustomerServiceGuide}></Button>
</div>
<div className="vp-customer-journey">
{customerJourneySteps.map((item) => (
<button
key={item.step}
type="button"
className="vp-customer-journey-item"
onClick={item.onClick}
aria-label={`车辆服务路径 ${item.title} ${item.action}`}
>
<span>{item.step}</span>
<strong>{item.title}</strong>
<em>{item.action}</em>
<small>{item.detail}</small>
</button>
))}
</div>
<div className="vp-customer-health-grid">
{customerHealthItems.map((item) => (
@@ -1324,7 +1383,7 @@ export function Dashboard({
</div>
</div>
</Card>
<Card bordered title="车辆监控指挥台" style={{ marginBottom: 16 }}>
<Card bordered title="车辆服务指挥台" style={{ marginBottom: 16 }}>
<div className="vp-command-center-grid">
{commandCenterItems.map((item) => (
<div key={item.title} className="vp-command-center-item">
@@ -1338,7 +1397,7 @@ export function Dashboard({
size="small"
theme="solid"
type="primary"
aria-label={`车辆监控指挥台 ${item.title} ${item.primaryAction}`}
aria-label={`车辆服务指挥台 ${item.title} ${item.primaryAction}`}
onClick={item.onPrimary}
>
{item.primaryAction}
@@ -1347,7 +1406,7 @@ export function Dashboard({
size="small"
theme="light"
type="primary"
aria-label={`车辆监控指挥台 ${item.title} ${item.secondaryAction}`}
aria-label={`车辆服务指挥台 ${item.title} ${item.secondaryAction}`}
onClick={item.onSecondary}
>
{item.secondaryAction}
@@ -1357,7 +1416,7 @@ export function Dashboard({
))}
</div>
</Card>
<Card bordered title="客户常用工作流" style={{ marginBottom: 16 }}>
<Card bordered title="客户常用服务" style={{ marginBottom: 16 }}>
<div className="vp-customer-workflow-grid">
{customerHeroActions.map((item) => (
<button key={item.title} type="button" className="vp-customer-workflow-item" onClick={item.onClick} aria-label={`客户工作流 ${item.title}`}>