feat(platform): show active vehicle filters
This commit is contained in:
@@ -34,6 +34,29 @@ function sourceEvidenceText(row: VehicleCoverageRow) {
|
||||
return `${row.onlineSourceCount}/${row.sourceCount} 来源在线`;
|
||||
}
|
||||
|
||||
const coverageLabel: Record<string, string> = {
|
||||
single: '单源',
|
||||
multi: '多源'
|
||||
};
|
||||
|
||||
const serviceStatusLabel: Record<string, string> = {
|
||||
healthy: '服务正常',
|
||||
degraded: '来源不完整',
|
||||
offline: '车辆离线',
|
||||
no_data: '暂无数据来源',
|
||||
identity_required: '身份未绑定'
|
||||
};
|
||||
|
||||
const onlineLabel: Record<string, string> = {
|
||||
online: '在线',
|
||||
offline: '离线'
|
||||
};
|
||||
|
||||
const bindingStatusLabel: Record<string, string> = {
|
||||
bound: '已绑定',
|
||||
unbound: '未绑定'
|
||||
};
|
||||
|
||||
function sourceDiagnosisText(row: VehicleCoverageRow) {
|
||||
const parts = [sourceEvidenceText(row)];
|
||||
if ((row.missingProtocols ?? []).length > 0) {
|
||||
@@ -110,6 +133,15 @@ export function Vehicles({
|
||||
}
|
||||
return items;
|
||||
}, [pagination.total, summary]);
|
||||
const filterSummary = [
|
||||
filters.keyword ? `关键词:${filters.keyword}` : '',
|
||||
filters.protocol ? `数据来源:${filters.protocol}` : '',
|
||||
filters.coverage ? `来源覆盖:${coverageLabel[filters.coverage] ?? filters.coverage}` : '',
|
||||
filters.missingProtocol ? `缺失来源:${filters.missingProtocol}` : '',
|
||||
filters.serviceStatus ? `服务状态:${serviceStatusLabel[filters.serviceStatus] ?? filters.serviceStatus}` : '',
|
||||
filters.online ? `在线:${onlineLabel[filters.online] ?? filters.online}` : '',
|
||||
filters.bindingStatus ? `绑定:${bindingStatusLabel[filters.bindingStatus] ?? filters.bindingStatus}` : ''
|
||||
].filter(Boolean);
|
||||
|
||||
const load = (values: Record<string, string> = filters, page = pagination.currentPage, pageSize = pagination.pageSize) => {
|
||||
setLoading(true);
|
||||
@@ -249,6 +281,16 @@ export function Vehicles({
|
||||
</Space>
|
||||
</Form>
|
||||
</Card>
|
||||
{filterSummary.length > 0 ? (
|
||||
<Card bordered title="当前车辆筛选" style={{ marginTop: 16 }}>
|
||||
<Space wrap>
|
||||
{filterSummary.map((item) => (
|
||||
<Tag key={item} color="blue">{item}</Tag>
|
||||
))}
|
||||
<Button size="small" onClick={() => applyFilters({})}>清空筛选</Button>
|
||||
</Space>
|
||||
</Card>
|
||||
) : null}
|
||||
<Card bordered title="当前车辆结果" style={{ marginTop: 16 }}>
|
||||
<div className="vp-result-summary-grid">
|
||||
{resultSummary.map((item) => (
|
||||
|
||||
Reference in New Issue
Block a user