feat(platform): surface selected vehicle map actions
This commit is contained in:
@@ -1367,6 +1367,53 @@ export function Realtime({
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="vp-map-selected-service-strip">
|
||||
<div className="vp-map-selected-service-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">选中车辆服务</Tag>
|
||||
{selectedMapRow ? (
|
||||
<>
|
||||
<Tag color={vehicleServiceStatus(selectedMapRow).color}>{vehicleServiceStatus(selectedMapRow).label}</Tag>
|
||||
<Tag color={dataFreshness(selectedMapRow).color}>{dataFreshness(selectedMapRow).detail}</Tag>
|
||||
</>
|
||||
) : (
|
||||
<Tag color="grey">等待选车</Tag>
|
||||
)}
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>{selectedVehicleLabel}</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
客户在地图上选中车辆后,直接进入车辆档案、轨迹回放、里程核对、数据导出和告警处置。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-map-selected-service-actions">
|
||||
{mapVehicleWorkItems.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-map-selected-service-action"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`地图选中车辆 ${item.title} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.title}</Tag>
|
||||
<strong>{item.action}</strong>
|
||||
<span>{item.value}</span>
|
||||
</button>
|
||||
))}
|
||||
<button
|
||||
type="button"
|
||||
className="vp-map-selected-service-action"
|
||||
disabled={!selectedMapRow || !canOpenVehicle(selectedMapRow.vin)}
|
||||
onClick={openSelectedVehicleRaw}
|
||||
aria-label="地图选中车辆 数据导出 历史导出"
|
||||
>
|
||||
<Tag color="blue">数据导出</Tag>
|
||||
<strong>历史导出</strong>
|
||||
<span>{selectedMapRow ? selectedVehicleProtocol || selectedMapRow.primaryProtocol || '全部通道' : '等待选择'}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="vp-map-task-strip">
|
||||
{mapCustomerTasks.map((item) => (
|
||||
<div key={item.title} className="vp-map-task-item">
|
||||
|
||||
@@ -1937,6 +1937,76 @@ button.vp-realtime-command-item:focus-visible {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-strip {
|
||||
padding: 14px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.18);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #ffffff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(280px, 0.64fr) minmax(0, 1.36fr);
|
||||
gap: 14px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-summary {
|
||||
min-width: 0;
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-summary .semi-typography {
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-actions {
|
||||
min-width: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-action {
|
||||
min-width: 0;
|
||||
min-height: 104px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--vp-border);
|
||||
border-radius: 8px;
|
||||
background: #fbfcff;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
display: grid;
|
||||
align-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-action:hover,
|
||||
.vp-map-selected-service-action:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.45);
|
||||
background: #f5f9ff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-action:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.58;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-action strong {
|
||||
color: var(--vp-primary);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.vp-map-selected-service-action span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-map-task-strip {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
@@ -5242,6 +5312,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-map-decision-board,
|
||||
.vp-map-decision-grid,
|
||||
.vp-map-kpi-strip,
|
||||
.vp-map-selected-service-strip,
|
||||
.vp-map-selected-service-actions,
|
||||
.vp-map-task-strip,
|
||||
.vp-map-customer-package,
|
||||
.vp-map-customer-package-grid,
|
||||
|
||||
@@ -9330,6 +9330,12 @@ test('shows realtime freshness status for recently updated and stale vehicles',
|
||||
expect(screen.getAllByText('选中车辆').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('车辆列表')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('1 辆更新超时').length).toBeGreaterThanOrEqual(1);
|
||||
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();
|
||||
fireEvent.click(screen.getByRole('button', { name: /复制地图监控包/ }));
|
||||
await waitFor(() => {
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户地图监控包】'));
|
||||
|
||||
Reference in New Issue
Block a user