From 1900c051fc7db53ef78c1626f8c78048f7e16409 Mon Sep 17 00:00:00 2001 From: XuZhiqiang Date: Sat, 6 Jun 2026 22:22:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(web-antdv-next):=20=E4=BD=BF=E7=94=A8=20Tab?= =?UTF-8?q?s=20items=20=E5=92=8C=20contentRender=20=E8=BF=81=E7=A7=BB=20Io?= =?UTF-8?q?T=20=E8=AF=A6=E6=83=85=E9=A1=B5=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/iot/device/device/detail/index.vue | 71 +++++++++---------- .../device/detail/modules/thing-model.vue | 25 ++++--- .../iot/ota/task/record/modules/list.vue | 9 ++- .../iot/product/product/detail/index.vue | 21 ++++-- .../src/views/iot/rule/data/index.vue | 16 +++-- 5 files changed, 79 insertions(+), 63 deletions(-) diff --git a/apps/web-antdv-next/src/views/iot/device/device/detail/index.vue b/apps/web-antdv-next/src/views/iot/device/device/detail/index.vue index 81d042af7..1671bd76e 100644 --- a/apps/web-antdv-next/src/views/iot/device/device/detail/index.vue +++ b/apps/web-antdv-next/src/views/iot/device/device/detail/index.vue @@ -3,7 +3,7 @@ import type { IotDeviceApi } from '#/api/iot/device/device'; import type { IotProductApi } from '#/api/iot/product/product'; import type { ThingModelApi } from '#/api/iot/thingmodel'; -import { onMounted, ref } from 'vue'; +import { computed, onMounted, ref } from 'vue'; import { useRoute, useRouter } from 'vue-router'; import { Page } from '@vben/common-ui'; @@ -33,6 +33,22 @@ const product = ref({} as IotProductApi.Product); const device = ref({} as IotDeviceApi.Device); const activeTab = ref('info'); const thingModelList = ref([]); +const deviceTabItems = computed(() => [ + { key: 'info', label: '设备信息' }, + { key: 'model', label: '物模型数据' }, + ...(product.value.deviceType === DeviceTypeEnum.GATEWAY + ? [{ key: 'subDevice', label: '子设备管理' }] + : []), + { key: 'log', label: '设备消息' }, + { key: 'simulator', label: '模拟设备' }, + { key: 'config', label: '设备配置' }, + ...([ + ProtocolTypeEnum.MODBUS_TCP_CLIENT, + ProtocolTypeEnum.MODBUS_TCP_SERVER, + ].includes(product.value.protocolType as ProtocolTypeEnum) + ? [{ key: 'modbus', label: 'Modbus 配置' }] + : []), +]); /** 获取设备详情 */ async function getDeviceData(deviceId: number) { @@ -94,69 +110,52 @@ onMounted(async () => { @refresh="() => getDeviceData(id)" /> - - + + diff --git a/apps/web-antdv-next/src/views/iot/device/device/detail/modules/thing-model.vue b/apps/web-antdv-next/src/views/iot/device/device/detail/modules/thing-model.vue index 7e84d9d22..8cad3a7d1 100644 --- a/apps/web-antdv-next/src/views/iot/device/device/detail/modules/thing-model.vue +++ b/apps/web-antdv-next/src/views/iot/device/device/detail/modules/thing-model.vue @@ -18,30 +18,35 @@ const props = defineProps<{ }>(); const activeTab = ref('property'); // 默认选中设备属性 +const thingModelTabItems = [ + { key: 'property', label: '设备属性(运行状态)' }, + { key: 'event', label: '设备事件上报' }, + { key: 'service', label: '设备服务调用' }, +]; diff --git a/apps/web-antdv-next/src/views/iot/ota/task/record/modules/list.vue b/apps/web-antdv-next/src/views/iot/ota/task/record/modules/list.vue index 0f6d8d52a..106acb414 100644 --- a/apps/web-antdv-next/src/views/iot/ota/task/record/modules/list.vue +++ b/apps/web-antdv-next/src/views/iot/ota/task/record/modules/list.vue @@ -98,9 +98,12 @@ watch(