feat(platform): add amap vehicle service foundation

This commit is contained in:
lingniu
2026-07-05 23:15:57 +08:00
parent 4eda7b7e1b
commit 122ba079fb
3 changed files with 166 additions and 0 deletions

View File

@@ -1011,6 +1011,44 @@ export function Vehicles({
onClick: () => onOpenHistory?.({ ...serviceScopeFilters, tab: 'location' })
}
];
const amapServiceFoundationItems = [
{
title: '实时看车',
value: `${(summary?.onlineVehicles ?? 0).toLocaleString()} 在线`,
detail: '打开车辆地图,先看车辆是否仍在上报、位置是否有效、是否需要调度。',
action: '打开地图',
color: (summary?.onlineVehicles ?? 0) > 0 ? 'green' as const : 'orange' as const,
disabled: !onOpenMap,
onClick: () => onOpenMap?.({ ...serviceScopeFilters, online: 'online' })
},
{
title: '轨迹复盘',
value: filters.keyword?.trim() ? '单车可回放' : '先选车辆',
detail: filters.keyword?.trim() ? '按当前车辆进入轨迹回放,解释时间窗内怎么跑。' : '从车辆池先锁定 VIN、车牌或手机号再回放轨迹。',
action: '回放轨迹',
color: filters.keyword?.trim() ? 'green' as const : 'grey' as const,
disabled: !onOpenHistory || !filters.keyword?.trim(),
onClick: () => onOpenHistory?.({ ...serviceScopeFilters, tab: 'location' })
},
{
title: '围栏告警',
value: `${pendingVehicleCount.toLocaleString()} 待处理`,
detail: '围绕车辆位置、断链、身份缺口和后续围栏规则,把异常转成通知闭环。',
action: '告警通知',
color: pendingVehicleCount > 0 ? 'orange' as const : 'green' as const,
disabled: !onOpenQuality,
onClick: () => onOpenQuality?.(serviceScopeFilters)
},
{
title: '数据交付',
value: `${rows.length.toLocaleString()} 当前页`,
detail: '把车辆清单、地图筛选、轨迹证据和历史数据导出给客户或运营人员。',
action: '导出清单',
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
disabled: rows.length === 0,
onClick: exportVehicles
}
];
useEffect(() => {
setFilters(initialFilters);
@@ -1149,6 +1187,33 @@ export function Vehicles({
))}
</div>
</section>
<section className="vp-vehicle-amap-foundation" aria-label="高德地图车辆服务底座">
<div className="vp-vehicle-amap-foundation-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={filters.keyword?.trim() ? 'green' : 'grey'}>{filters.keyword?.trim() ? '单车地图' : '车辆池地图'}</Tag>
</Space>
<strong></strong>
<span>线</span>
</div>
<div className="vp-vehicle-amap-foundation-grid">
{amapServiceFoundationItems.map((item) => (
<button
key={item.title}
type="button"
className="vp-vehicle-amap-foundation-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`高德地图车辆服务底座 ${item.title} ${item.value} ${item.action}`}
>
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</section>
<section className="vp-customer-vehicle-service-hub" aria-label="客户车辆服务台">
<div className="vp-customer-vehicle-service-summary">
<Space wrap>

View File

@@ -4418,6 +4418,99 @@ button.vp-realtime-command-item:focus-visible {
line-height: 20px;
}
.vp-vehicle-amap-foundation {
margin-bottom: 16px;
border: 1px solid rgba(0, 174, 116, 0.22);
border-radius: var(--vp-radius);
background: #fff;
display: grid;
grid-template-columns: minmax(300px, 0.58fr) minmax(0, 1.42fr);
overflow: hidden;
box-shadow: var(--vp-shadow-sm);
}
.vp-vehicle-amap-foundation-summary {
padding: 18px;
border-right: 1px solid var(--vp-border);
background: #f4fbf8;
display: grid;
gap: 12px;
align-content: start;
}
.vp-vehicle-amap-foundation-summary strong {
color: var(--vp-text);
font-size: 20px;
font-weight: 700;
line-height: 28px;
word-break: break-word;
}
.vp-vehicle-amap-foundation-summary span {
color: var(--vp-text-muted);
font-size: 13px;
line-height: 20px;
}
.vp-vehicle-amap-foundation-grid {
padding: 14px;
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 10px;
}
.vp-vehicle-amap-foundation-item {
min-height: 148px;
padding: 12px;
border: 1px solid var(--vp-border);
border-radius: 8px;
background: #fbfefd;
color: inherit;
cursor: pointer;
font: inherit;
text-align: left;
display: grid;
gap: 8px;
align-content: start;
transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.vp-vehicle-amap-foundation-item:disabled {
cursor: not-allowed;
opacity: 0.62;
}
.vp-vehicle-amap-foundation-item:not(:disabled):hover,
.vp-vehicle-amap-foundation-item:not(:disabled):focus-visible {
border-color: rgba(0, 174, 116, 0.42);
background: #f3fbf7;
box-shadow: 0 0 0 3px rgba(0, 174, 116, 0.08);
outline: none;
}
.vp-vehicle-amap-foundation-item strong {
color: var(--vp-text);
font-size: 20px;
font-weight: 700;
line-height: 26px;
word-break: break-word;
}
.vp-vehicle-amap-foundation-item span {
color: var(--vp-text-muted);
font-size: 12px;
line-height: 18px;
word-break: break-word;
}
.vp-vehicle-amap-foundation-item em {
color: var(--vp-primary);
font-size: 13px;
font-style: normal;
font-weight: 700;
line-height: 20px;
}
.vp-customer-vehicle-service-hub {
margin-bottom: 16px;
border: 1px solid rgba(22, 100, 255, 0.18);
@@ -11532,6 +11625,8 @@ button.vp-realtime-command-item:focus-visible {
.vp-current-service-grid,
.vp-fleet-command-center,
.vp-fleet-command-grid,
.vp-vehicle-amap-foundation,
.vp-vehicle-amap-foundation-grid,
.vp-customer-vehicle-service-hub,
.vp-customer-vehicle-service-grid,
.vp-alert-closure-timeline,

View File

@@ -2645,6 +2645,12 @@ test('shows vehicle service result summary on vehicle list filters', async () =>
expect(screen.getByRole('button', { name: '客户车队指挥台 待处理车辆 13 辆 告警通知' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车队指挥台 当前交付 2 辆 数据导出' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车队指挥台 轨迹复盘 先选车辆 轨迹回放' })).toBeInTheDocument();
expect(screen.getByText('高德地图车辆服务底座')).toBeInTheDocument();
expect(screen.getByText('用地图把车辆监控、轨迹回放、围栏告警、统计查询和历史导出串成客户能理解的一条服务路径。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '高德地图车辆服务底座 实时看车 73 在线 打开地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '高德地图车辆服务底座 轨迹复盘 先选车辆 回放轨迹' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '高德地图车辆服务底座 围栏告警 13 待处理 告警通知' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '高德地图车辆服务底座 数据交付 2 当前页 导出清单' })).toBeInTheDocument();
expect(screen.getByText('客户车辆服务台')).toBeInTheDocument();
expect(screen.getByText('三个接入源最终服务同一辆车,客户从这里进入找车、实时、轨迹、统计、导出和告警。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户车辆服务台 车辆池 181 车辆 找车' })).toBeInTheDocument();