From 4cecafb4b15f029ee48c8c89b2b681c4b215a20f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 2 Jul 2025 09:35:10 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90IoT=20=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=BD=91=E3=80=91=E5=88=9D=E5=A7=8B=E5=8C=96=20IoT=20=E5=9B=BA?= =?UTF-8?q?=E4=BB=B6=E8=AF=A6=E6=83=85=E9=A1=B5=2050%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/ota/firmware/index.ts | 1 + src/utils/dict.ts | 4 +- src/views/iot/ota/firmware/detail/index.vue | 496 ++++---------------- src/views/iot/ota/task/OtaTaskForm.vue | 111 +++++ src/views/iot/ota/task/OtaTaskList.vue | 162 +++++++ src/views/iot/utils/constants.ts | 64 +++ 6 files changed, 428 insertions(+), 410 deletions(-) create mode 100644 src/views/iot/ota/task/OtaTaskForm.vue create mode 100644 src/views/iot/ota/task/OtaTaskList.vue diff --git a/src/api/iot/ota/firmware/index.ts b/src/api/iot/ota/firmware/index.ts index ad61e9733..97e6d0595 100644 --- a/src/api/iot/ota/firmware/index.ts +++ b/src/api/iot/ota/firmware/index.ts @@ -7,6 +7,7 @@ export interface IoTOtaFirmware { description?: string // 固件描述 version?: string // 版本号 productId?: number // 产品编号 + productName?: string // 产品名称 fileUrl?: string // 固件文件 URL fileSize?: number // 固件文件大小 fileDigestAlgorithm?: string // 固件文件签名算法 diff --git a/src/utils/dict.ts b/src/utils/dict.ts index aa7176931..cc14074fc 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -241,5 +241,7 @@ export enum DICT_TYPE { IOT_RULE_SCENE_TRIGGER_TYPE_ENUM = 'iot_rule_scene_trigger_type_enum', // IoT 场景流转的触发类型枚举 IOT_RULE_SCENE_ACTION_TYPE_ENUM = 'iot_rule_scene_action_type_enum', // IoT 规则场景的触发类型枚举 IOT_ALERT_LEVEL = 'iot_alert_level', // IoT 告警级别 - IOT_ALERT_RECEIVE_TYPE = 'iot_alert_receive_type' // IoT 告警接收类型 + IOT_ALERT_RECEIVE_TYPE = 'iot_alert_receive_type', // IoT 告警接收类型 + IOT_OTA_TASK_DEVICE_SCOPE = 'iot_ota_task_device_scope', // IoT OTA任务设备范围 + IOT_OTA_TASK_STATUS = 'iot_ota_task_status' // IoT OTA任务状态 } diff --git a/src/views/iot/ota/firmware/detail/index.vue b/src/views/iot/ota/firmware/detail/index.vue index 661a47ec9..0c0cc9d3e 100644 --- a/src/views/iot/ota/firmware/detail/index.vue +++ b/src/views/iot/ota/firmware/detail/index.vue @@ -1,303 +1,124 @@ - - diff --git a/src/views/iot/ota/task/OtaTaskForm.vue b/src/views/iot/ota/task/OtaTaskForm.vue new file mode 100644 index 000000000..79cd3b699 --- /dev/null +++ b/src/views/iot/ota/task/OtaTaskForm.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/views/iot/ota/task/OtaTaskList.vue b/src/views/iot/ota/task/OtaTaskList.vue new file mode 100644 index 000000000..cdc1ad7c2 --- /dev/null +++ b/src/views/iot/ota/task/OtaTaskList.vue @@ -0,0 +1,162 @@ + + + diff --git a/src/views/iot/utils/constants.ts b/src/views/iot/utils/constants.ts index 50d600490..08af17670 100644 --- a/src/views/iot/utils/constants.ts +++ b/src/views/iot/utils/constants.ts @@ -147,3 +147,67 @@ export const getDataTypeOptionsLabel = (value: string) => { const dataType = getDataTypeOptions().find((option) => option.value === value) return dataType && `${dataType.value}(${dataType.label})` } + +// IoT OTA 任务设备范围枚举 +export const IoTOtaTaskDeviceScopeEnum = { + ALL: { + label: '全部设备', + value: 1 + }, + SPECIFIC: { + label: '指定设备', + value: 2 + } +} as const + +// IoT OTA 任务状态枚举 +export const IoTOtaTaskStatusEnum = { + PENDING: { + label: '待执行', + value: 1 + }, + IN_PROGRESS: { + label: '执行中', + value: 2 + }, + COMPLETED: { + label: '已完成', + value: 3 + }, + CANCELLED: { + label: '已取消', + value: 4 + }, + FAILED: { + label: '执行失败', + value: 5 + } +} as const + +// IoT OTA 升级记录状态枚举 +export const IoTOtaTaskRecordStatusEnum = { + PENDING: { + label: '待推送', + value: 1 + }, + PUSHED: { + label: '已推送', + value: 2 + }, + IN_PROGRESS: { + label: '正在升级', + value: 3 + }, + SUCCESS: { + label: '升级成功', + value: 4 + }, + FAILED: { + label: '升级失败', + value: 5 + }, + CANCELLED: { + label: '升级取消', + value: 6 + } +} as const