feat(platform): add customer evidence package overview
This commit is contained in:
@@ -1216,6 +1216,44 @@ export function History({
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const customerEvidencePackageOverviewItems = [
|
||||
{
|
||||
label: '交付范围',
|
||||
value: `${currentVehicleKeyword || '全部车辆'} / ${currentProtocol || '全部数据通道'}`,
|
||||
detail: `${filters.dateFrom || '-'} 至 ${filters.dateTo || '-'},先确认客户要查的车辆和时间窗。`,
|
||||
action: '查看范围',
|
||||
color: currentVehicleKeyword ? 'green' as const : 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: () => document.querySelector<HTMLInputElement>('input[name="keyword"]')?.focus()
|
||||
},
|
||||
{
|
||||
label: '轨迹证据',
|
||||
value: validLocations.length > 0 ? `${validLocations.length.toLocaleString()} 点` : '0 点',
|
||||
detail: validLocations.length > 0 ? '可进入轨迹回放和位置历史导出。' : '当前范围没有有效轨迹点,需要补查位置历史。',
|
||||
action: '查询轨迹',
|
||||
color: validLocations.length > 0 ? 'green' as const : 'orange' as const,
|
||||
disabled: false,
|
||||
onClick: () => openQueryTab('location')
|
||||
},
|
||||
{
|
||||
label: '明细字段',
|
||||
value: fieldEvidenceCount > 0 ? `${fieldEvidenceCount.toLocaleString()} 字段` : `${(rawFrames.total ?? 0).toLocaleString()} 帧`,
|
||||
detail: fieldEvidenceCount > 0 ? '字段证据已裁剪,可按客户口径导出。' : '可查看历史明细并配置字段裁剪。',
|
||||
action: fieldEvidenceCount > 0 ? '字段导出' : '明细证据',
|
||||
color: fieldEvidenceCount > 0 ? 'green' as const : (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: false,
|
||||
onClick: () => fieldEvidenceCount > 0 ? openQueryTab('fields') : openQueryTab('raw')
|
||||
},
|
||||
{
|
||||
label: '交付说明',
|
||||
value: deliveryState,
|
||||
detail: anomalyTotal > 0 ? `存在 ${anomalyTotal.toLocaleString()} 项质量提示,交付说明需附带异常解释。` : '当前范围可生成客户可读的证据说明。',
|
||||
action: '复制说明',
|
||||
color: deliveryStateColor,
|
||||
disabled: false,
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const customerReportCadenceItems = [
|
||||
{
|
||||
title: '每日运营复盘',
|
||||
@@ -1802,6 +1840,35 @@ export function History({
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
{mode === 'query' ? (
|
||||
<section className="vp-history-evidence-package-overview" aria-label="客户证据包交付总览">
|
||||
<div className="vp-history-evidence-package-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户证据包交付总览</Tag>
|
||||
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
|
||||
<Tag color={fieldEvidenceCount > 0 ? 'green' : 'orange'}>{fieldEvidenceCount.toLocaleString()} 字段</Tag>
|
||||
</Space>
|
||||
<Typography.Text strong>先给客户一个结论:当前筛选能交付哪些证据、还缺哪一类证据、下一步应该导出还是补查。</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-history-evidence-package-grid">
|
||||
{customerEvidencePackageOverviewItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-history-evidence-package-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-service-desk" aria-label="车辆历史服务台">
|
||||
<div className="vp-history-service-desk-summary">
|
||||
|
||||
@@ -8906,6 +8906,76 @@ button.vp-realtime-command-item:focus-visible {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-overview {
|
||||
padding: 14px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.2);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #f7faff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-summary {
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item {
|
||||
min-height: 142px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--vp-border);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #fbfcff;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item:not(:disabled):hover,
|
||||
.vp-history-evidence-package-item:not(:disabled):focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.42);
|
||||
background: #f5f9ff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 17px;
|
||||
line-height: 23px;
|
||||
font-weight: 700;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-history-evidence-package-item em {
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.vp-history-export-center {
|
||||
margin-top: 16px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.16);
|
||||
@@ -11355,6 +11425,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-trajectory-impact-grid,
|
||||
.vp-history-evidence-chain,
|
||||
.vp-history-evidence-chain-grid,
|
||||
.vp-history-evidence-package-overview,
|
||||
.vp-history-evidence-package-grid,
|
||||
.vp-history-service-desk,
|
||||
.vp-history-service-desk-grid,
|
||||
.vp-history-time-window-board,
|
||||
|
||||
@@ -7503,6 +7503,12 @@ test('shows parsed field history as a flattened evidence table', async () => {
|
||||
|
||||
expect(await screen.findByRole('heading', { name: '历史查询导出' })).toBeInTheDocument();
|
||||
expect(screen.getByText('车辆历史服务台')).toBeInTheDocument();
|
||||
expect(screen.getByText('客户证据包交付总览')).toBeInTheDocument();
|
||||
expect(screen.getByText('先给客户一个结论:当前筛选能交付哪些证据、还缺哪一类证据、下一步应该导出还是补查。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户证据包交付总览 交付范围 VIN-FIELDS-001 / GB32960 查看范围' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户证据包交付总览 轨迹证据 0 点 查询轨迹' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户证据包交付总览 明细字段 2 字段 字段导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户证据包交付总览 交付说明 可交付 复制说明' })).toBeInTheDocument();
|
||||
expect(screen.getByText('客户先选车辆和时间窗,再拿到路线、里程、原始证据、字段裁剪和告警说明。')).toBeInTheDocument();
|
||||
expect(screen.getByText('当前服务范围:VIN-FIELDS-001 / GB32960')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆历史服务台 路线复盘 0 点 查询位置' })).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user