From 57a77b2ba9c55ab8e8b15574ee56c103561de449 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 4 Feb 2026 22:05:03 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88iot=EF=BC=89=EF=BC=9A=E3=80=90?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E6=94=B9=E9=80=A0=E3=80=91=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20codecType=EF=BC=8C=E4=BD=BF=E7=94=A8=20protocolType=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/product/product/index.ts | 22 +++++-- src/utils/dict.ts | 3 +- src/views/iot/product/product/ProductForm.vue | 61 +++++++++++++------ .../product/detail/ProductDetailsInfo.vue | 7 ++- 4 files changed, 68 insertions(+), 25 deletions(-) diff --git a/src/api/iot/product/product/index.ts b/src/api/iot/product/product/index.ts index ba465efdc..2025884b7 100644 --- a/src/api/iot/product/product/index.ts +++ b/src/api/iot/product/product/index.ts @@ -16,7 +16,8 @@ export interface ProductVO { status: number // 产品状态 deviceType: number // 设备类型 netType: number // 联网方式 - codecType: string // 数据格式(编解码器类型) + protocolType: string // 协议类型 + serializeType: string // 序列化类型 deviceCount: number // 设备数量 createTime: Date // 创建时间 } @@ -27,9 +28,22 @@ export enum DeviceTypeEnum { GATEWAY_SUB = 1, // 网关子设备 GATEWAY = 2 // 网关设备 } -// IOT 数据格式(编解码器类型)枚举类 -export enum CodecTypeEnum { - ALINK = 'Alink' // 阿里云 Alink 协议 +// IoT 协议类型枚举 +export enum ProtocolTypeEnum { + TCP = 'tcp', + UDP = 'udp', + WEBSOCKET = 'websocket', + HTTP = 'http', + MQTT = 'mqtt', + EMQX = 'emqx', + COAP = 'coap', + MODBUS_TCP = 'modbus_tcp' +} + +// IoT 序列化类型枚举 +export enum SerializeTypeEnum { + JSON = 'json', + BINARY = 'binary' } // IoT 产品 API diff --git a/src/utils/dict.ts b/src/utils/dict.ts index b4f0c5870..e68f1384d 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -233,7 +233,8 @@ export enum DICT_TYPE { IOT_NET_TYPE = 'iot_net_type', // IOT 联网方式 IOT_PRODUCT_STATUS = 'iot_product_status', // IOT 产品状态 IOT_PRODUCT_DEVICE_TYPE = 'iot_product_device_type', // IOT 产品设备类型 - IOT_CODEC_TYPE = 'iot_codec_type', // IOT 数据格式(编解码器类型) + IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 协议类型 + IOT_SERIALIZE_TYPE = 'iot_serialize_type', // IOT 序列化类型 IOT_LOCATION_TYPE = 'iot_location_type', // IOT 定位类型 IOT_DEVICE_STATE = 'iot_device_state', // IOT 设备状态 IOT_THING_MODEL_TYPE = 'iot_thing_model_type', // IOT 产品功能类型 diff --git a/src/views/iot/product/product/ProductForm.vue b/src/views/iot/product/product/ProductForm.vue index 9cb7c5099..7bc3e4903 100644 --- a/src/views/iot/product/product/ProductForm.vue +++ b/src/views/iot/product/product/ProductForm.vue @@ -4,7 +4,7 @@ ref="formRef" :model="formData" :rules="formRules" - label-width="110px" + label-width="120px" v-loading="formLoading" > @@ -49,11 +49,7 @@ label="联网方式" prop="netType" > - + - - - + + + + + + + + + @@ -109,7 +125,13 @@