feat(platform): add history delivery readiness
This commit is contained in:
@@ -1254,6 +1254,44 @@ export function History({
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const customerDeliveryReadinessItems = [
|
||||
{
|
||||
label: currentVehicleKeyword ? '范围已锁定' : '范围待选择',
|
||||
value: currentVehicleKeyword || '全部车辆',
|
||||
detail: `${currentProtocol || '全部数据通道'} / ${filters.dateFrom || '-'} 至 ${filters.dateTo || '-'}`,
|
||||
action: '查看范围',
|
||||
color: currentVehicleKeyword ? 'green' as const : 'orange' as const,
|
||||
disabled: false,
|
||||
onClick: () => document.querySelector<HTMLInputElement>('input[name="keyword"]')?.focus()
|
||||
},
|
||||
{
|
||||
label: validLocations.length > 0 ? '轨迹可交付' : '轨迹待补',
|
||||
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: fieldEvidenceCount > 0 ? '字段已裁剪' : '字段待配置',
|
||||
value: fieldEvidenceCount > 0 ? `${fieldEvidenceCount.toLocaleString()} 字段` : '待配置',
|
||||
detail: fieldEvidenceCount > 0 ? '只交付客户需要的字段,减少证据包体积。' : '先选择客户需要的字段,再导出 CSV。',
|
||||
action: fieldEvidenceCount > 0 ? '字段导出' : '字段配置',
|
||||
color: fieldEvidenceCount > 0 ? 'green' as const : 'orange' as const,
|
||||
disabled: false,
|
||||
onClick: () => openQueryTab('fields')
|
||||
},
|
||||
{
|
||||
label: '说明可复制',
|
||||
value: deliveryState,
|
||||
detail: anomalyTotal > 0 ? `附带 ${anomalyTotal.toLocaleString()} 项质量提示。` : '可直接复制客户可读的交付说明。',
|
||||
action: '复制说明',
|
||||
color: deliveryStateColor,
|
||||
disabled: false,
|
||||
onClick: () => copyDeliveryPackage()
|
||||
}
|
||||
];
|
||||
const customerReportCadenceItems = [
|
||||
{
|
||||
title: '每日运营复盘',
|
||||
@@ -1869,6 +1907,36 @@ export function History({
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
{mode === 'query' ? (
|
||||
<section className="vp-history-delivery-readiness" aria-label="客户交付准备度">
|
||||
<div className="vp-history-delivery-readiness-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户交付准备度</Tag>
|
||||
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
|
||||
</Space>
|
||||
<Typography.Text strong>
|
||||
把一次历史查询收敛成四个交付判断:范围是否锁定、轨迹是否可用、字段是否裁剪、说明是否可复制。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-history-delivery-readiness-grid">
|
||||
{customerDeliveryReadinessItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-history-delivery-readiness-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">
|
||||
|
||||
@@ -9581,6 +9581,77 @@ button.vp-realtime-command-item:focus-visible {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness {
|
||||
margin-top: 16px;
|
||||
padding: 14px;
|
||||
border: 1px solid rgba(0, 174, 116, 0.2);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #f7fffb;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-copy {
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item {
|
||||
min-height: 130px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(0, 174, 116, 0.18);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #fbfffd;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item:not(:disabled):hover,
|
||||
.vp-history-delivery-readiness-item:not(:disabled):focus-visible {
|
||||
border-color: rgba(0, 174, 116, 0.42);
|
||||
background: #f2fff8;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 17px;
|
||||
line-height: 23px;
|
||||
font-weight: 700;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-history-delivery-readiness-item em {
|
||||
color: #008f5f;
|
||||
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);
|
||||
@@ -12060,6 +12131,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-history-evidence-chain-grid,
|
||||
.vp-history-evidence-package-overview,
|
||||
.vp-history-evidence-package-grid,
|
||||
.vp-history-delivery-readiness,
|
||||
.vp-history-delivery-readiness-grid,
|
||||
.vp-history-service-desk,
|
||||
.vp-history-service-desk-grid,
|
||||
.vp-history-time-window-board,
|
||||
|
||||
@@ -7544,6 +7544,12 @@ test('shows parsed field history as a flattened evidence table', async () => {
|
||||
expect(screen.getByText('车辆历史服务台')).toBeInTheDocument();
|
||||
expect(screen.getByText('客户证据包交付总览')).toBeInTheDocument();
|
||||
expect(screen.getByText('先给客户一个结论:当前筛选能交付哪些证据、还缺哪一类证据、下一步应该导出还是补查。')).toBeInTheDocument();
|
||||
expect(screen.getByText('客户交付准备度')).toBeInTheDocument();
|
||||
expect(screen.getByText('把一次历史查询收敛成四个交付判断:范围是否锁定、轨迹是否可用、字段是否裁剪、说明是否可复制。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付准备度 范围已锁定 VIN-FIELDS-001 查看范围' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付准备度 轨迹待补 0 点 查询轨迹' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付准备度 字段已裁剪 2 字段 字段导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付准备度 说明可复制 可交付 复制说明' })).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();
|
||||
|
||||
Reference in New Issue
Block a user