refactor(ui): converge semi access workspace

This commit is contained in:
lingniu
2026-07-19 16:38:17 +08:00
parent 40c210a192
commit a198e0fc4e
3 changed files with 81 additions and 23 deletions

View File

@@ -390,17 +390,18 @@ export default function AccessPage() {
};
};
const attentionVehicles = Math.max(0, (summary?.totalVehicles ?? 0) - (summary?.healthyVehicles ?? 0));
const accessMetrics: WorkspaceQueueMetricRailItem[] = mobileLayout
? [
accessMetric('需关注', attentionVehicles, 'attention', { note: '异常与缺失', tone: 'warning', emphasis: 'primary' }),
accessMetric('全部车辆', summary?.totalVehicles ?? 0, '', { note: '权威主车辆', tone: 'neutral', emphasis: 'primary' })
]
: [
accessMetric('需关注', attentionVehicles, 'attention', { note: '异常、离线或缺失', tone: 'warning', emphasis: 'primary' }),
accessMetric('全部车辆', summary?.totalVehicles ?? 0, '', { note: '权威主车辆口径', tone: 'neutral', emphasis: 'primary' }),
accessMetric('尚无来源', summary?.neverReported ?? 0, 'not_connected', { note: '待核对设备映射', tone: 'warning', emphasis: 'secondary' }),
accessMetric('资料待维护', summary?.masterDataIncompleteVehicles ?? 0, 'master_data', { note: '品牌、车型或来源', tone: (summary?.masterDataIncompleteVehicles ?? 0) > 0 ? 'warning' : 'success', emphasis: 'secondary' })
];
const accessMetrics: WorkspaceQueueMetricRailItem[] = [
accessMetric('需关注', attentionVehicles, 'attention', {
note: mobileLayout ? '异常与缺失' : '异常、离线或缺失',
tone: 'warning',
emphasis: 'primary'
}),
accessMetric('全部车辆', summary?.totalVehicles ?? 0, '', {
note: mobileLayout ? '权威主车辆' : '权威主车辆口径',
tone: 'neutral',
emphasis: 'primary'
})
];
const scrollAccessTable = (event: KeyboardEvent<HTMLDivElement>) => {
if (mobileLayout || event.currentTarget !== event.target || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) return;
const tableScroller = event.currentTarget.scrollWidth > event.currentTarget.clientWidth