From 98cc4b438910c27c1dd2ac21d0a9aab3d98aa642 Mon Sep 17 00:00:00 2001 From: Administrator <425053404@qq.com> Date: Wed, 22 Oct 2025 18:16:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E8=81=94=E7=BD=91?= =?UTF-8?q?=E6=A8=A1=E5=9D=97OTA=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/iot/ota/task/record/index.ts | 2 +- apps/web-antd/src/api/iot/rule/scene/index.ts | 1 + .../web-antd/src/router/routes/modules/iot.ts | 9 + .../src/views/iot/alert/config/data.ts | 4 +- .../src/views/iot/alert/record/data.ts | 6 +- .../src/views/iot/alert/record/index.vue | 2 +- .../src/views/iot/device/device/data.ts | 18 +- .../src/views/iot/device/device/index.vue | 1 - .../iot/device/device/modules/DeviceForm.vue | 12 +- .../device/device/modules/DeviceGroupForm.vue | 2 +- .../modules/detail/DeviceDetailConfig.vue | 15 +- .../modules/detail/DeviceDetailsMessage.vue | 19 +- .../modules/detail/DeviceDetailsSimulator.vue | 441 +++++++++--------- .../modules/detail/DeviceDetailsSubDevice.vue | 1 - ...DeviceDetailsThingModelPropertyHistory.vue | 172 +++---- .../src/views/iot/device/group/data.ts | 8 +- apps/web-antd/src/views/iot/ota/data.ts | 4 +- .../src/views/iot/ota/firmware/data.ts | 4 +- .../src/views/iot/ota/firmware/index.vue | 31 +- .../views/iot/ota/modules/detail/index.vue | 36 +- .../src/views/iot/product/category/data.ts | 8 +- .../src/views/iot/product/product/data.ts | 4 +- .../src/views/iot/product/product/index.vue | 3 +- .../product/product/modules/ProductForm.vue | 20 +- .../modules/detail/ProductDetailsInfo.vue | 4 +- apps/web-antd/src/views/iot/rule/data/data.ts | 2 +- .../scene/form/configs/ConditionConfig.vue | 5 +- .../configs/CurrentTimeConditionConfig.vue | 2 +- .../web-antd/src/views/iot/thingmodel/data.ts | 1 - .../src/views/iot/thingmodel/index.vue | 14 +- .../thingmodel/modules/ThingModelEvent.vue | 6 +- .../iot/thingmodel/modules/ThingModelForm.vue | 3 +- .../thingmodel/modules/ThingModelProperty.vue | 33 +- .../iot/thingmodel/modules/ThingModelTSL.vue | 12 +- .../modules/components/DataDefinition.vue | 18 +- .../dataSpecs/ThingModelArrayDataSpecs.vue | 5 +- .../dataSpecs/ThingModelEnumDataSpecs.vue | 3 +- .../dataSpecs/ThingModelNumberDataSpecs.vue | 63 ++- .../dataSpecs/ThingModelStructDataSpecs.vue | 9 +- 39 files changed, 515 insertions(+), 488 deletions(-) diff --git a/apps/web-antd/src/api/iot/ota/task/record/index.ts b/apps/web-antd/src/api/iot/ota/task/record/index.ts index 3ad7b0990..8d41d1b74 100644 --- a/apps/web-antd/src/api/iot/ota/task/record/index.ts +++ b/apps/web-antd/src/api/iot/ota/task/record/index.ts @@ -95,7 +95,7 @@ export function getOtaTaskRecordStatusStatistics( taskId?: number, ) { return requestClient.get>( - '/iot/ota/task/record/status-statistics', + '/iot/ota/task/record/get-status-statistics', { params: { firmwareId, taskId } }, ); } diff --git a/apps/web-antd/src/api/iot/rule/scene/index.ts b/apps/web-antd/src/api/iot/rule/scene/index.ts index 5fc3224e1..59c8255a7 100644 --- a/apps/web-antd/src/api/iot/rule/scene/index.ts +++ b/apps/web-antd/src/api/iot/rule/scene/index.ts @@ -101,6 +101,7 @@ export interface Action { identifier?: string; value?: any; alertConfigId?: number; + params?: string; } /** 查询场景联动规则分页 */ diff --git a/apps/web-antd/src/router/routes/modules/iot.ts b/apps/web-antd/src/router/routes/modules/iot.ts index f43a547b0..c90a5978f 100644 --- a/apps/web-antd/src/router/routes/modules/iot.ts +++ b/apps/web-antd/src/router/routes/modules/iot.ts @@ -29,6 +29,15 @@ const routes: RouteRecordRaw[] = [ }, component: () => import('#/views/iot/device/device/modules/detail/index.vue'), }, + { + path: 'ota/firmware/detail/:id', + name: 'IoTOtaFirmwareDetail', + meta: { + title: '固件详情', + activePath: '/iot/ota', + }, + component: () => import('#/views/iot/ota/modules/firmware-detail/index.vue'), + }, ], }, ]; diff --git a/apps/web-antd/src/views/iot/alert/config/data.ts b/apps/web-antd/src/views/iot/alert/config/data.ts index 09ca905c7..379867edb 100644 --- a/apps/web-antd/src/views/iot/alert/config/data.ts +++ b/apps/web-antd/src/views/iot/alert/config/data.ts @@ -63,7 +63,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '关联场景联动规则', component: 'ApiSelect', componentProps: { - api: getSimpleRuleSceneList, + api: () => getSimpleRuleSceneList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -76,7 +76,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '接收的用户', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', mode: 'multiple', diff --git a/apps/web-antd/src/views/iot/alert/record/data.ts b/apps/web-antd/src/views/iot/alert/record/data.ts index 10ebb12f3..70b13b267 100644 --- a/apps/web-antd/src/views/iot/alert/record/data.ts +++ b/apps/web-antd/src/views/iot/alert/record/data.ts @@ -17,7 +17,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '告警配置', component: 'ApiSelect', componentProps: { - api: getSimpleAlertConfigList, + api: () => getSimpleAlertConfigList(), labelField: 'name', valueField: 'id', placeholder: '请选择告警配置', @@ -40,7 +40,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -53,7 +53,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '设备', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceList, + api: () => getSimpleDeviceList(), labelField: 'deviceName', valueField: 'id', placeholder: '请选择设备', diff --git a/apps/web-antd/src/views/iot/alert/record/index.vue b/apps/web-antd/src/views/iot/alert/record/index.vue index 560aae39a..64ba6cfac 100644 --- a/apps/web-antd/src/views/iot/alert/record/index.vue +++ b/apps/web-antd/src/views/iot/alert/record/index.vue @@ -101,7 +101,7 @@ async function handleProcess(row: AlertRecord) { try { await processAlertRecord(row.id as number, processRemark); message.success('处理成功'); - onRefresh(); + handleRefresh(); } catch (error) { console.error('处理失败:', error); throw error; diff --git a/apps/web-antd/src/views/iot/device/device/data.ts b/apps/web-antd/src/views/iot/device/device/data.ts index 86996ceae..a2fef45e8 100644 --- a/apps/web-antd/src/views/iot/device/device/data.ts +++ b/apps/web-antd/src/views/iot/device/device/data.ts @@ -5,6 +5,7 @@ import { DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; import { z } from '#/adapter/form'; +import { getSimpleDeviceList } from '#/api/iot/device/device'; import { getSimpleDeviceGroupList } from '#/api/iot/device/group'; import { DeviceTypeEnum, @@ -27,7 +28,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -55,12 +56,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '网关设备', component: 'ApiSelect', componentProps: { - api: async () => { - const { getSimpleDeviceList } = await import( - '#/api/iot/device/device' - ); - return getSimpleDeviceList(DeviceTypeEnum.GATEWAY); - }, + api: () => getSimpleDeviceList(DeviceTypeEnum.GATEWAY), labelField: 'nickname', valueField: 'id', placeholder: '子设备可选择父设备', @@ -93,7 +89,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -160,7 +156,7 @@ export function useGroupFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -203,7 +199,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -253,7 +249,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', placeholder: '请选择设备分组', diff --git a/apps/web-antd/src/views/iot/device/device/index.vue b/apps/web-antd/src/views/iot/device/device/index.vue index 06e34ac5e..f83a7c14a 100644 --- a/apps/web-antd/src/views/iot/device/device/index.vue +++ b/apps/web-antd/src/views/iot/device/device/index.vue @@ -32,7 +32,6 @@ import { getSimpleProductList } from '#/api/iot/product/product'; import { $t } from '#/locales'; import { useGridColumns } from './data'; -// @ts-ignore import DeviceCardView from './modules/DeviceCardView.vue'; import DeviceForm from './modules/DeviceForm.vue'; import DeviceGroupForm from './modules/DeviceGroupForm.vue'; diff --git a/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue b/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue index 32875e43f..39fe16a99 100644 --- a/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue +++ b/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue @@ -1,15 +1,13 @@