feat(platform): align quality issues with vehicle service
This commit is contained in:
@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
|
||||
import { api } from '../api/client';
|
||||
import type { OpsHealth, QualitySummary, QualityIssueRow } from '../api/types';
|
||||
import { PageHeader } from '../components/PageHeader';
|
||||
import { qualityIssueLabel, qualityProtocolLabel, qualityProtocolOptions } from '../domain/qualityIssue';
|
||||
import { qualityIssueVehicleLookup } from '../domain/vehicleLookup';
|
||||
|
||||
const statusColor: Record<string, 'green' | 'orange' | 'red' | 'grey'> = {
|
||||
@@ -120,7 +121,7 @@ export function Quality({
|
||||
{ label: '错误 / 警告', value: `${summary.errorCount}/${summary.warningCount}` },
|
||||
{
|
||||
label: '主要问题',
|
||||
value: summary.issueTypes.length > 0 ? `${summary.issueTypes[0].name} ${summary.issueTypes[0].count}` : '-'
|
||||
value: summary.issueTypes.length > 0 ? `${qualityIssueLabel(summary.issueTypes[0].name)} ${summary.issueTypes[0].count}` : '-'
|
||||
}
|
||||
].map((item) => (
|
||||
<Card key={item.label} bordered loading={loadingSummary}>
|
||||
@@ -146,9 +147,11 @@ export function Quality({
|
||||
loadSummary(nextFilters);
|
||||
loadIssues(nextFilters, 1, pagination.pageSize);
|
||||
}} style={{ marginBottom: 12 }}>
|
||||
<Form.Input field="keyword" label="关键词" placeholder="手机号 / 来源地址 / 车牌" style={{ width: 260 }} />
|
||||
<Form.Input field="keyword" label="关键词" placeholder="VIN / 车牌 / 手机号 / 来源地址" style={{ width: 260 }} />
|
||||
<Form.Select field="protocol" label="数据来源" placeholder="全部来源" style={{ width: 160 }}>
|
||||
<Select.Option value="JT808">JT808</Select.Option>
|
||||
{qualityProtocolOptions.map((item) => (
|
||||
<Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
|
||||
))}
|
||||
</Form.Select>
|
||||
<Space>
|
||||
<Button htmlType="submit" theme="solid" type="primary">筛选</Button>
|
||||
@@ -176,8 +179,8 @@ export function Quality({
|
||||
{ title: '车牌', dataIndex: 'plate' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '来源地址', dataIndex: 'sourceEndpoint' },
|
||||
{ title: '数据来源', dataIndex: 'protocol' },
|
||||
{ title: '问题', dataIndex: 'issueType' },
|
||||
{ title: '数据来源', render: (_: unknown, row: QualityIssueRow) => qualityProtocolLabel(row.protocol) },
|
||||
{ title: '问题', render: (_: unknown, row: QualityIssueRow) => qualityIssueLabel(row.issueType) },
|
||||
{ title: '级别', render: (_: unknown, row: QualityIssueRow) => <Tag color={row.severity === 'error' ? 'red' : 'orange'}>{row.severity}</Tag> },
|
||||
{ title: '最后时间', dataIndex: 'lastSeen' },
|
||||
{ title: '说明', dataIndex: 'detail' },
|
||||
|
||||
Reference in New Issue
Block a user