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(