feat(platform): add customer report purpose navigation

This commit is contained in:
lingniu
2026-07-05 20:21:51 +08:00
parent d10291a003
commit 36ac5fe7c5
3 changed files with 147 additions and 0 deletions

View File

@@ -1254,6 +1254,44 @@ export function History({
onClick: () => openQueryTab('fields')
}
];
const customerReportPurposeItems = [
{
title: '日报复盘',
value: '运营早会',
detail: '每天快速交付车辆位置、轨迹覆盖、区间里程和质量提示。',
action: '生成日报',
color: locations.total > 0 ? 'green' as const : 'orange' as const,
disabled: locations.items.length === 0,
onClick: () => exportLocations()
},
{
title: '周报对账',
value: '客户对账',
detail: '把固定车辆范围和时间窗沉淀为周报计划,给客户对账复核。',
action: '生成周报',
color: 'blue' as const,
disabled: false,
onClick: () => copyScheduledHistoryReportPlan()
},
{
title: '临时解释',
value: '质量说明',
detail: '遇到定位、里程或断链质疑时,复制带证据链接的解释说明。',
action: '复制说明',
color: deliveryStateColor,
disabled: false,
onClick: () => copyDeliveryPackage()
},
{
title: '字段模板',
value: '稳定字段',
detail: '按客户固定字段裁剪导出,减少体积并保证每次字段一致。',
action: '字段配置',
color: selectedFieldCount > 0 || rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
disabled: false,
onClick: () => openQueryTab('fields')
}
];
const savedReportViewItems = [
{
title: '当前筛选',
@@ -1905,6 +1943,36 @@ export function History({
) : null}
{mode === 'query' ? (
<Card bordered title="客户报表交付节奏" style={{ marginTop: 16 }}>
<div className="vp-history-report-purpose" aria-label="客户报表用途导航">
<div className="vp-history-report-purpose-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={currentVehicleKeyword ? 'green' : 'grey'}>{currentVehicleKeyword ? '单车范围' : '全部车辆'}</Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary">
RAW
</Typography.Text>
</div>
<div className="vp-history-report-purpose-grid">
{customerReportPurposeItems.map((item) => (
<button
key={item.title}
type="button"
className="vp-history-report-purpose-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>
</div>
<div className="vp-history-report-cadence">
<div className="vp-history-report-cadence-summary">
<Space wrap>

View File

@@ -7598,11 +7598,82 @@ button.vp-realtime-command-item:focus-visible {
}
.vp-history-report-cadence {
margin-top: 14px;
display: grid;
grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
gap: 14px;
}
.vp-history-report-purpose {
display: grid;
grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
gap: 14px;
}
.vp-history-report-purpose-summary {
padding: 14px;
border: 1px solid rgba(10, 168, 107, 0.22);
border-radius: var(--vp-radius);
background: #f5fbf8;
display: grid;
gap: 10px;
align-content: start;
}
.vp-history-report-purpose-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
}
.vp-history-report-purpose-item {
min-height: 158px;
padding: 12px;
border: 1px solid var(--vp-border);
border-radius: var(--vp-radius);
background: #fbfcff;
color: inherit;
text-align: left;
font: inherit;
cursor: pointer;
display: grid;
gap: 8px;
align-content: start;
}
.vp-history-report-purpose-item:hover,
.vp-history-report-purpose-item:focus-visible {
border-color: rgba(22, 100, 255, 0.42);
box-shadow: 0 10px 24px rgba(24, 39, 75, 0.08);
outline: none;
}
.vp-history-report-purpose-item:disabled {
cursor: not-allowed;
opacity: 0.62;
}
.vp-history-report-purpose-item strong {
color: var(--vp-text);
font-size: 18px;
line-height: 24px;
font-weight: 700;
word-break: break-word;
}
.vp-history-report-purpose-item span {
color: var(--vp-text-muted);
font-size: 12px;
line-height: 18px;
}
.vp-history-report-purpose-item em {
color: var(--vp-primary);
font-size: 12px;
font-style: normal;
font-weight: 700;
}
.vp-history-report-cadence-summary {
padding: 14px;
border: 1px solid rgba(22, 100, 255, 0.18);
@@ -9705,6 +9776,8 @@ button.vp-realtime-command-item:focus-visible {
.vp-history-customer-export-steps,
.vp-history-report-templates,
.vp-history-report-template-grid,
.vp-history-report-purpose,
.vp-history-report-purpose-grid,
.vp-history-report-cadence,
.vp-history-report-cadence-grid,
.vp-history-saved-report,

View File

@@ -7092,6 +7092,12 @@ test('shows parsed field history as a flattened evidence table', async () => {
expect(screen.getByRole('button', { name: '报表交付模板 周期交付计划 复制计划' })).toBeInTheDocument();
expect(screen.getByText('客户报表交付节奏')).toBeInTheDocument();
expect(screen.getByText('参考 Fleetio、Samsara、Geotab 的报表能力,把导出从一次性下载升级为可复用的交付节奏。')).toBeInTheDocument();
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();
expect(screen.getByRole('button', { name: '客户报表交付节奏 每日运营复盘 日报导出' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户报表交付节奏 每周客户对账 周报计划' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户报表交付节奏 临时问题解释 复制说明' })).toBeInTheDocument();