refine Semi UI history data workflow

This commit is contained in:
lingniu
2026-07-18 06:05:58 +08:00
parent 018ec20256
commit 6bb2107f5e
3 changed files with 120 additions and 2 deletions

View File

@@ -115,6 +115,7 @@ test('clears stale rows, charts, and evidence as soon as the history scope chang
}
expect(view.container.querySelector('.v2-history-context .v2-history-metrics')).toBeInTheDocument();
expect(view.container.querySelector('.v2-history-context .v2-history-summary')).toBeInTheDocument();
expect(view.container.querySelector('.v2-history-result-actions.v2-workspace-panel-actions')).toBeInTheDocument();
expect(view.container.querySelector('.v2-history-evidence')).not.toBeInTheDocument();
expect(view.container.querySelector('.v2-history-workspace')).not.toHaveClass('is-inspector-open');
expect(screen.queryByRole('heading', { level: 5, name: '聚合趋势' })).not.toBeInTheDocument();

View File

@@ -378,6 +378,7 @@ export default function HistoryPage() {
title="历史明细"
description={keywords.length ? `${(result?.total ?? 0).toLocaleString('zh-CN')} 条记录 · ${resultSummary?.vehicleCount ?? 0} 辆车辆 · ${summarySources}` : '选择车辆和时间范围后查询'}
meta={resultSummary ? `${resultSummary.queryDurationMs} ms` : undefined}
actionsClassName="v2-history-result-actions"
actions={<>
<Button className={`v2-history-table-trend${trendExpanded ? ' is-expanded' : ''}`} theme="borderless" aria-label={trendExpanded ? '收起趋势' : '展开趋势'} aria-expanded={trendExpanded} icon={<IconChevronRight />} onClick={() => setTrendExpanded((value) => !value)}>{trendExpanded ? '收起趋势' : '聚合趋势'}</Button>
<Button theme="borderless" aria-label="列设置" aria-haspopup="dialog" aria-expanded={columnSettingsOpen} aria-controls="v2-history-column-settings" icon={<IconSetting />} onClick={() => setColumnSettingsOpen((value) => !value)}></Button>