diff --git a/apps/web-antd/src/router/routes/modules/ops.ts b/apps/web-antd/src/router/routes/modules/ops.ts index fb2ff4ab2..a6739690e 100644 --- a/apps/web-antd/src/router/routes/modules/ops.ts +++ b/apps/web-antd/src/router/routes/modules/ops.ts @@ -21,6 +21,16 @@ const routes: RouteRecordRaw[] = [ }, component: () => import('#/views/ops/area/index.vue'), }, + // 区域设备管理 + { + path: 'area-device', + name: 'OpsAreaDevice', + meta: { + title: '区域设备管理', + activePath: '/ops/area-device', + }, + component: () => import('#/views/ops/area-device/index.vue'), + }, // 客流统计 { path: 'traffic', diff --git a/apps/web-antd/src/views/ops/area-device/index.vue b/apps/web-antd/src/views/ops/area-device/index.vue new file mode 100644 index 000000000..ce196b7c8 --- /dev/null +++ b/apps/web-antd/src/views/ops/area-device/index.vue @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + {{ selectedAreaPath || '请选择区域' }} + + + - 区域设备 ({{ deviceList.length }}) + + + + + 添加设备 + + + + + + + + + + + + + 添加设备 + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/web-antd/src/views/ops/area-device/modules/device-card.vue b/apps/web-antd/src/views/ops/area-device/modules/device-card.vue new file mode 100644 index 000000000..3c19563a7 --- /dev/null +++ b/apps/web-antd/src/views/ops/area-device/modules/device-card.vue @@ -0,0 +1,260 @@ + + + + + + + + + {{ nicknameLabel }} + + + + {{ relationLabel }} + + + ... + + + 查看详情 + 解除绑定 + + + + + + + + + + 设备标识 + {{ deviceNameLabel }} + + + 产品所属 + {{ productLabel }} + + + + + + + + + + diff --git a/apps/web-antd/src/views/ops/area-device/modules/device-detail-drawer.vue b/apps/web-antd/src/views/ops/area-device/modules/device-detail-drawer.vue new file mode 100644 index 000000000..c6e660875 --- /dev/null +++ b/apps/web-antd/src/views/ops/area-device/modules/device-detail-drawer.vue @@ -0,0 +1,845 @@ + + + + + + + + + + {{ deviceInfo?.deviceName || '--' }} + + + {{ deviceInfo?.nickname || '--' }} + + + {{ relation?.productName || '--' }} + + + {{ relation?.deviceKey || '--' }} + + + + + + {{ deviceInfo?.ip || '--' }} + + + {{ formatTime(deviceInfo?.onlineTime) }} + + + + + + + + + 刷新 + + + + + + + + + + 今日进入 + {{ + trafficData.todayIn + }} + + + + 今日离开 + {{ + trafficData.todayOut + }} + + + + 在场 + {{ + Math.max(0, trafficData.todayIn - trafficData.todayOut) + }} + + + + + + + + + + + + + + + + + 电量 + + {{ batteryLevel }}% + + + + + + + + + 蓝牙信标 + + {{ bluetoothDevices.length }} 个 + + + + + + + 信标信号 + + {{ device.mac }} + + + + {{ device.rssi }}dBm + + + + + + + 无信标信号 + + + + + + + + + + + {{ formatTime(record.updateTime) }} + + + + + + + + + + + + + 关联类型 + + {{ getRelationLabel(relation?.relationType) }} + + + + + 启用状态 + + + + + 配置数据 (JSON) + + + + + JSON 格式错误 + + + + + + 保存配置 + + + 解除绑定 + + + + + + + + + diff --git a/apps/web-antd/src/views/ops/area/data.ts b/apps/web-antd/src/views/ops/area/data.ts index 72e1b9b8e..90ee88275 100644 --- a/apps/web-antd/src/views/ops/area/data.ts +++ b/apps/web-antd/src/views/ops/area/data.ts @@ -44,6 +44,23 @@ export const RELATION_TYPE_OPTIONS: { label: string; value: RelationType }[] = [ { label: '工牌', value: 'BADGE' }, ]; +/** 关联类型颜色映射(卡片用) */ +export const RELATION_TYPE_COLORS: Record< + string, + { bg: string; text: string } +> = { + TRAFFIC_COUNTER: { bg: '#e6f4ff', text: '#1677ff' }, + BEACON: { bg: '#f6ffed', text: '#52c41a' }, + BADGE: { bg: '#fff7e6', text: '#fa8c16' }, +}; + +/** 关联类型 Tag 颜色映射(Ant Design Tag 用) */ +export const RELATION_TYPE_TAG_COLORS: Record = { + TRAFFIC_COUNTER: 'blue', + BEACON: 'green', + BADGE: 'orange', +}; + /** 启用状态选项(筛选用) */ export const ACTIVE_OPTIONS = [ { label: '全部', value: undefined },