feat(platform): add vehicle history service desk
This commit is contained in:
@@ -1169,6 +1169,53 @@ export function History({
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const vehicleHistoryServiceItems = [
|
||||
{
|
||||
label: '路线复盘',
|
||||
value: validLocations.length > 0 ? `${validLocations.length.toLocaleString()} 点` : '0 点',
|
||||
detail: '先看同一时间窗内的路线、速度和断点。',
|
||||
color: validLocations.length > 0 ? 'green' as const : 'orange' as const,
|
||||
action: '查询位置',
|
||||
disabled: false,
|
||||
onClick: () => openQueryTab('location')
|
||||
},
|
||||
{
|
||||
label: '里程核对',
|
||||
value: formatNumber(mileageDelta, ' km'),
|
||||
detail: '带着车辆和时间窗进入统计页,核对区间里程。',
|
||||
color: isFiniteNumber(mileageDelta) ? 'green' as const : 'grey' as const,
|
||||
action: '统计查询',
|
||||
disabled: !onOpenMileage,
|
||||
onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) })
|
||||
},
|
||||
{
|
||||
label: '明细证据',
|
||||
value: `${(rawFrames.total ?? 0).toLocaleString()} 帧`,
|
||||
detail: '查看接入明细,解释位置、里程和字段来源。',
|
||||
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
|
||||
action: '查看证据',
|
||||
disabled: false,
|
||||
onClick: () => openQueryTab('raw')
|
||||
},
|
||||
{
|
||||
label: '字段裁剪',
|
||||
value: rawFieldRows.length > 0 ? `${rawFieldRows.length.toLocaleString()} 字段` : `${selectedFieldCount.toLocaleString()} 字段`,
|
||||
detail: '按客户需要裁剪字段,减少导出体积。',
|
||||
color: rawFieldRows.length > 0 || selectedFieldCount > 0 ? 'green' as const : 'orange' as const,
|
||||
action: '字段配置',
|
||||
disabled: false,
|
||||
onClick: () => openQueryTab('fields')
|
||||
},
|
||||
{
|
||||
label: '客户导出',
|
||||
value: deliveryState,
|
||||
detail: '复制交付说明,或继续导出 CSV 证据。',
|
||||
color: deliveryStateColor,
|
||||
action: '复制交付',
|
||||
disabled: false,
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const customerReportCadenceItems = [
|
||||
{
|
||||
title: '每日运营复盘',
|
||||
@@ -1628,6 +1675,42 @@ export function History({
|
||||
<Tag color={currentProtocol ? 'blue' : 'green'}>数据通道:{currentProtocol || '全部数据通道'}</Tag>
|
||||
<Typography.Text type="tertiary">{scopeDescription}</Typography.Text>
|
||||
</div>
|
||||
{mode === 'query' ? (
|
||||
<section className="vp-history-service-desk" aria-label="车辆历史服务台">
|
||||
<div className="vp-history-service-desk-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">车辆历史服务台</Tag>
|
||||
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
|
||||
<Tag color={currentVehicleKeyword ? 'green' : 'orange'}>{currentVehicleKeyword || '全部车辆'}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>
|
||||
客户先选车辆和时间窗,再拿到路线、里程、原始证据、字段裁剪和告警说明。
|
||||
</Typography.Title>
|
||||
<div className="vp-history-service-desk-meta">
|
||||
<span>当前服务范围:{currentVehicleKeyword || '全部车辆'} / {currentProtocol || '全部数据通道'}</span>
|
||||
<span>时间窗:{filters.dateFrom || '-'} 至 {filters.dateTo || '-'}</span>
|
||||
<span>协议来源只作为证据过滤,不作为客户主流程。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-history-service-desk-grid">
|
||||
{vehicleHistoryServiceItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-history-service-desk-item"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`车辆历史服务台 ${item.label} ${item.value} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
{mode === 'query' ? (
|
||||
<section className="vp-history-export-center" aria-label="客户导出中心">
|
||||
<div className="vp-history-export-center-summary">
|
||||
|
||||
@@ -7088,6 +7088,91 @@ button.vp-realtime-command-item:focus-visible {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-history-service-desk {
|
||||
margin-top: 16px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.18);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #fff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--vp-shadow-sm);
|
||||
}
|
||||
|
||||
.vp-history-service-desk-summary {
|
||||
padding: 18px;
|
||||
border-right: 1px solid var(--vp-border);
|
||||
background: #f7fbff;
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-meta {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-grid {
|
||||
padding: 16px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item {
|
||||
min-height: 144px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.14);
|
||||
border-radius: 8px;
|
||||
background: #fbfcff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item:hover,
|
||||
.vp-history-service-desk-item:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.42);
|
||||
background: #f5f9ff;
|
||||
box-shadow: var(--vp-shadow-sm);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-history-service-desk-item em {
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-history-export-center {
|
||||
margin-top: 16px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.16);
|
||||
@@ -9424,6 +9509,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-trajectory-anomaly-grid,
|
||||
.vp-trajectory-impact-board,
|
||||
.vp-trajectory-impact-grid,
|
||||
.vp-history-service-desk,
|
||||
.vp-history-service-desk-grid,
|
||||
.vp-history-time-window-board,
|
||||
.vp-history-time-window-grid,
|
||||
.vp-history-export-center,
|
||||
|
||||
@@ -7036,6 +7036,14 @@ test('shows parsed field history as a flattened evidence table', async () => {
|
||||
render(<App />);
|
||||
|
||||
expect(await screen.findByRole('heading', { name: '历史查询导出' })).toBeInTheDocument();
|
||||
expect(screen.getByText('车辆历史服务台')).toBeInTheDocument();
|
||||
expect(screen.getByText('客户先选车辆和时间窗,再拿到路线、里程、原始证据、字段裁剪和告警说明。')).toBeInTheDocument();
|
||||
expect(screen.getByText('当前服务范围:VIN-FIELDS-001 / GB32960')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆历史服务台 路线复盘 0 点 查询位置' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆历史服务台 里程核对 - 统计查询' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆历史服务台 明细证据 1 帧 查看证据' })).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: '客户导出中心 行程历史 0 点 导出轨迹' })).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user