feat(platform): focus unresolved vehicle detail on binding
This commit is contained in:
@@ -83,6 +83,21 @@ export function VehicleDetail({
|
||||
const online = summary?.online || identity?.online || false;
|
||||
const lastSeen = summary?.lastSeen || latest?.lastSeen || '-';
|
||||
const formKey = `${query.keyword}-${query.protocol ?? ''}`;
|
||||
const qualityTable = (
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={false}
|
||||
rowKey={(row?: QualityIssueRow) => `${row?.protocol ?? ''}-${row?.issueType ?? ''}-${row?.lastSeen ?? ''}`}
|
||||
dataSource={detail?.quality.items ?? []}
|
||||
columns={[
|
||||
{ title: '来源', dataIndex: 'protocol', width: 130 },
|
||||
{ title: '问题', dataIndex: 'issueType', width: 150 },
|
||||
{ title: '级别', width: 110, render: (_: unknown, row: QualityIssueRow) => <Tag color={row.severity === 'error' ? 'red' : 'orange'}>{row.severity}</Tag> },
|
||||
{ title: '最后时间', dataIndex: 'lastSeen', width: 190 },
|
||||
{ title: '说明', dataIndex: 'detail' }
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -142,6 +157,8 @@ export function VehicleDetail({
|
||||
) : null}
|
||||
</Card>
|
||||
|
||||
{hasResolvedVIN ? (
|
||||
<>
|
||||
<Card bordered title="数据来源覆盖" style={{ marginTop: 16 }}>
|
||||
{detail?.sourceStatus?.length ? (
|
||||
<div className="vp-source-grid">
|
||||
@@ -186,7 +203,18 @@ export function VehicleDetail({
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{!hasResolvedVIN ? (
|
||||
<Card bordered style={{ marginTop: 16 }}>
|
||||
<Tabs>
|
||||
<Tabs.TabPane tab="质量问题" itemKey="quality">
|
||||
{qualityTable}
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
</Card>
|
||||
) : (
|
||||
<Card bordered style={{ marginTop: 16 }}>
|
||||
<Tabs>
|
||||
<Tabs.TabPane tab="实时状态" itemKey="realtime">
|
||||
@@ -271,22 +299,11 @@ export function VehicleDetail({
|
||||
/>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab="质量问题" itemKey="quality">
|
||||
<Table
|
||||
loading={loading}
|
||||
pagination={false}
|
||||
rowKey={(row?: QualityIssueRow) => `${row?.protocol ?? ''}-${row?.issueType ?? ''}-${row?.lastSeen ?? ''}`}
|
||||
dataSource={detail?.quality.items ?? []}
|
||||
columns={[
|
||||
{ title: '来源', dataIndex: 'protocol', width: 130 },
|
||||
{ title: '问题', dataIndex: 'issueType', width: 150 },
|
||||
{ title: '级别', width: 110, render: (_: unknown, row: QualityIssueRow) => <Tag color={row.severity === 'error' ? 'red' : 'orange'}>{row.severity}</Tag> },
|
||||
{ title: '最后时间', dataIndex: 'lastSeen', width: 190 },
|
||||
{ title: '说明', dataIndex: 'detail' }
|
||||
]}
|
||||
/>
|
||||
{qualityTable}
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user