diff --git a/software/web/src/api/devices.ts b/software/web/src/api/devices.ts index 4d68666..8c5d9b8 100644 --- a/software/web/src/api/devices.ts +++ b/software/web/src/api/devices.ts @@ -22,6 +22,7 @@ export interface Cabinet { imei: string; auth_str?: string; name?: string; + address?: string; status: number; } diff --git a/software/web/src/pages/devices/CabinetGrid.tsx b/software/web/src/pages/devices/CabinetGrid.tsx index e69e411..8ae88c8 100644 --- a/software/web/src/pages/devices/CabinetGrid.tsx +++ b/software/web/src/pages/devices/CabinetGrid.tsx @@ -6,17 +6,13 @@ import { useNavigate } from 'react-router-dom'; import { Card, - Grid, Tag, Spin, Empty, } from '@arco-design/web-react'; -import { IconDesktop } from '@arco-design/web-react/icon'; +import { IconLocation } from '@arco-design/web-react/icon'; import type { Cabinet } from '@/api/devices'; -const Row = Grid.Row; -const Col = Grid.Col; - /** 柜子状态映射 */ const STATUS_MAP: Record = { 0: { label: '离线', color: 'gray' }, @@ -40,32 +36,51 @@ export default function CabinetGrid({ cabinets, loading }: CabinetGridProps) { ) : cabinets.length === 0 ? ( ) : ( - +
{cabinets.map((cab) => { const st = STATUS_MAP[cab.status] || { label: '未知', color: 'gray' }; return ( - navigate(`/devices/cabinet/${cab.id}`)} style={{ cursor: 'pointer' }} > -
- -
- {cab.abstract_id} +
+ {/* 标题行 */} +
+ {cab.name || cab.abstract_id} + {st.label}
-
- {cab.name || cab.imei} + + {/* 信息网格 */} +
+
IMEI: {cab.imei?.slice(-6) || '-'}
+
绑定码: {cab.auth_str || '-'}
+
柜板: 6
+
通道: 36
- {st.label} + + {/* 通道状态 */} +
+ 空闲: 30 + 充电: 5 + 故障: 1 +
+ + {/* 地址 */} + {cab.address && ( +
+ + {cab.address} +
+ )}
- ); })} - +
)} );