refactor(ui): unify semi mobile query workspaces
This commit is contained in:
@@ -427,6 +427,11 @@ export default function HistoryPage() {
|
||||
setSelectedRowRef({ scope: dataScope, id: '' });
|
||||
}, [dataScope]);
|
||||
const mobileFiltersOpen = mobileLayout && !filtersCollapsed;
|
||||
const draftVehicleCount = parseHistoryKeywords(draft.keywords).length;
|
||||
const draftCategoryLabel = catalogQuery.data?.categories.find((item) => item.key === draft.category)?.label
|
||||
?? (draft.category === 'raw' ? '原始报文' : draft.category === 'mileage' ? '日里程' : '位置数据');
|
||||
const draftSourceLabel = draft.protocol || '全部来源';
|
||||
const draftWindowLabel = `${draft.dateFrom.slice(5, 10)}–${draft.dateTo.slice(5, 10)}`;
|
||||
const historyRangePresets = useMemo(() => [
|
||||
{ key: 'today' as const, label: '今天', range: historyPresetWindow('today') },
|
||||
{ key: 'yesterday' as const, label: '昨天', range: historyPresetWindow('yesterday') },
|
||||
@@ -537,6 +542,25 @@ export default function HistoryPage() {
|
||||
closeLabel="关闭历史查询范围"
|
||||
title="筛选历史数据"
|
||||
description="车辆、时间、数据类型与协议来源"
|
||||
summaryItems={[
|
||||
{
|
||||
label: '车辆范围',
|
||||
value: draftVehicleCount ? `${draftVehicleCount} 辆` : '待选择',
|
||||
detail: '最多 5 台车辆',
|
||||
tone: 'primary'
|
||||
},
|
||||
{
|
||||
label: '时间范围',
|
||||
value: draftWindowLabel,
|
||||
detail: '上海时区'
|
||||
},
|
||||
{
|
||||
label: '数据范围',
|
||||
value: draftCategoryLabel,
|
||||
detail: draftSourceLabel,
|
||||
tone: draft.protocol ? 'success' : 'neutral'
|
||||
}
|
||||
]}
|
||||
onCancel={() => setFiltersCollapsed(true)}
|
||||
secondaryAction={{ label: '重置条件', onClick: resetDraft }}
|
||||
primaryAction={{ label: '应用并查询', disabled: !parseHistoryKeywords(draft.keywords).length, onClick: applyDraft }}
|
||||
|
||||
Reference in New Issue
Block a user