feat(platform): add export template library

This commit is contained in:
lingniu
2026-07-06 00:01:00 +08:00
parent 6d18e5a017
commit 0c33648b26
3 changed files with 149 additions and 0 deletions

View File

@@ -1330,6 +1330,44 @@ export function History({
onClick: () => openQueryTab('fields')
}
];
const customerExportTemplateLibraryItems = [
{
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 customerReportPurposeItems = [
{
title: '日报复盘',
@@ -2227,6 +2265,38 @@ export function History({
))}
</div>
</div>
<div className="vp-history-export-template-library">
<div className="vp-history-export-template-library-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={selectedFieldCount > 0 || rawFieldRows.length > 0 ? 'green' : 'orange'}>
{fieldEvidenceCount.toLocaleString()}
</Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}> CSV </Typography.Title>
<Typography.Text type="secondary">
</Typography.Text>
</div>
<div className="vp-history-export-template-library-grid">
{customerExportTemplateLibraryItems.map((item) => (
<button
key={item.title}
type="button"
className="vp-history-export-template-library-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>
</Card>
) : null}
{mode === 'query' ? (