feat(platform): prioritize fleet monitoring dashboard

This commit is contained in:
lingniu
2026-07-05 13:42:25 +08:00
parent 43d6a0438e
commit 46a1b8c3a8
3 changed files with 287 additions and 91 deletions

View File

@@ -1408,28 +1408,28 @@ export function Dashboard({
<div className="vp-page">
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、里程统计、自定义时间监控、历史查询、告警通知和数据导出" />
<Spin spinning={loading}>
<Card bordered className="vp-customer-cockpit" bodyStyle={{ padding: 0 }}>
<div className="vp-customer-cockpit-main">
<div className="vp-customer-cockpit-copy">
<Card bordered className="vp-fleet-monitor" bodyStyle={{ padding: 0 }}>
<div className="vp-fleet-monitor-map">
<div className="vp-fleet-monitor-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color="green"></Tag>
<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.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={openTimeMonitorHistory}></Button>
<Button theme="light" type="primary" onClick={openTimeMonitorRaw}></Button>
<Button theme="light" onClick={copyCustomerServiceGuide}></Button>
</Space>
</div>
<div className="vp-customer-cockpit-metrics">
<VehicleMap
points={commandMapPoints}
maxFallbackPoints={120}
heightClassName="vp-fleet-monitor-map-canvas"
fallbackLabel="显示车辆实时坐标预览"
/>
<div className="vp-fleet-monitor-stats">
{customerCockpitMetrics.map((item) => (
<button key={item.label} type="button" className="vp-customer-cockpit-metric" onClick={item.onClick} aria-label={`客户车辆监控 ${item.label} ${item.value}`}>
<button key={item.label} type="button" className="vp-fleet-monitor-stat" onClick={item.onClick} aria-label={`车辆监控指标 ${item.label} ${item.value}`}>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
@@ -1437,10 +1437,14 @@ export function Dashboard({
))}
</div>
</div>
<div className="vp-customer-cockpit-rail">
<div className="vp-customer-cockpit-workflows">
<div className="vp-fleet-monitor-panel">
<div className="vp-fleet-monitor-panel-head">
<Typography.Text strong></Typography.Text>
<Button size="small" theme="light" type="primary" onClick={copyCustomerServiceGuide}></Button>
</div>
<div className="vp-fleet-monitor-actions">
{customerCockpitWorkflows.map((item) => (
<button key={item.title} type="button" className="vp-customer-cockpit-workflow" onClick={item.onClick} aria-label={`客户车辆工作流 ${item.title} ${item.action}`}>
<button key={item.title} type="button" className="vp-fleet-monitor-action" onClick={item.onClick} aria-label={`客户车辆工作流 ${item.title} ${item.action}`}>
<span>{item.title}</span>
<strong>{item.action}</strong>
<small>{item.description}</small>
@@ -1448,9 +1452,22 @@ export function Dashboard({
</button>
))}
</div>
<div className="vp-customer-cockpit-trust">
<div className="vp-fleet-monitor-time">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={timeMonitorScope().keyword ? 'green' : 'grey'}>{timeMonitorScope().keyword ? '单车' : '全域'}</Tag>
</Space>
<strong>{timeMonitorSummary}</strong>
<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={openTimeMonitorRaw}></Button>
</Space>
</div>
<div className="vp-fleet-monitor-trust">
{customerTrustSignals.map((item) => (
<div key={item.label} className="vp-customer-cockpit-trust-item">
<div key={item.label} className="vp-fleet-monitor-trust-item">
<span>{item.label}</span>
<strong>{item.value}</strong>
<small>{item.detail}</small>
@@ -1459,65 +1476,6 @@ export function Dashboard({
</div>
</div>
</Card>
<Card bordered className="vp-customer-hero" bodyStyle={{ padding: 0 }}>
<div className="vp-customer-hero-map">
<div className="vp-customer-hero-copy">
<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">
</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" type="primary" onClick={openTimeMonitorRaw}></Button>
<Button theme="light" onClick={copyCustomerServiceGuide}></Button>
</Space>
</div>
<VehicleMap
points={commandMapPoints}
maxFallbackPoints={80}
heightClassName="vp-customer-hero-map-canvas"
fallbackLabel="显示车辆实时坐标预览"
/>
</div>
<div className="vp-customer-hero-side">
<div className="vp-customer-hero-side-head">
<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) => (
<button key={item.label} type="button" className="vp-customer-health-item" onClick={item.onClick} aria-label={`车辆运营 ${item.label} ${item.value}`}>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
</button>
))}
</div>
</div>
</Card>
<Card bordered title="车辆服务指挥台" style={{ marginBottom: 16 }}>
<div className="vp-command-center-grid">
{commandCenterItems.map((item) => (