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 online = summary?.online || identity?.online || false;
|
||||||
const lastSeen = summary?.lastSeen || latest?.lastSeen || '-';
|
const lastSeen = summary?.lastSeen || latest?.lastSeen || '-';
|
||||||
const formKey = `${query.keyword}-${query.protocol ?? ''}`;
|
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 (
|
return (
|
||||||
<div className="vp-page">
|
<div className="vp-page">
|
||||||
@@ -142,6 +157,8 @@ export function VehicleDetail({
|
|||||||
) : null}
|
) : null}
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
{hasResolvedVIN ? (
|
||||||
|
<>
|
||||||
<Card bordered title="数据来源覆盖" style={{ marginTop: 16 }}>
|
<Card bordered title="数据来源覆盖" style={{ marginTop: 16 }}>
|
||||||
{detail?.sourceStatus?.length ? (
|
{detail?.sourceStatus?.length ? (
|
||||||
<div className="vp-source-grid">
|
<div className="vp-source-grid">
|
||||||
@@ -186,7 +203,18 @@ export function VehicleDetail({
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{!hasResolvedVIN ? (
|
||||||
|
<Card bordered style={{ marginTop: 16 }}>
|
||||||
|
<Tabs>
|
||||||
|
<Tabs.TabPane tab="质量问题" itemKey="quality">
|
||||||
|
{qualityTable}
|
||||||
|
</Tabs.TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</Card>
|
||||||
|
) : (
|
||||||
<Card bordered style={{ marginTop: 16 }}>
|
<Card bordered style={{ marginTop: 16 }}>
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tabs.TabPane tab="实时状态" itemKey="realtime">
|
<Tabs.TabPane tab="实时状态" itemKey="realtime">
|
||||||
@@ -271,22 +299,11 @@ export function VehicleDetail({
|
|||||||
/>
|
/>
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab="质量问题" itemKey="quality">
|
<Tabs.TabPane tab="质量问题" itemKey="quality">
|
||||||
<Table
|
{qualityTable}
|
||||||
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' }
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Card>
|
</Card>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user