diff --git a/src/utils/dict.ts b/src/utils/dict.ts index c1823631..db8b9d9f 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -236,9 +236,9 @@ export enum DICT_TYPE { IOT_DATA_FORMAT = 'iot_data_format', // IOT 数据格式 IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 接入网关协议 IOT_DEVICE_STATUS = 'iot_device_status', // IOT 设备状态 - IOT_PRODUCT_THING_MODEL_TYPE = 'iot_product_thing_model_type', // IOT 产品功能类型 + IOT_THING_MODEL_TYPE = 'iot_thing_model_type', // IOT 产品功能类型 IOT_DATA_TYPE = 'iot_data_type', // IOT 数据类型 - IOT_PRODUCT_THING_MODEL_UNIT = 'iot_product_thing_model_unit', // IOT 物模型单位 + IOT_THING_MODEL_UNIT = 'iot_thing_model_unit', // IOT 物模型单位 IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型 IOT_PLUGIN_DEPLOY_TYPE = 'iot_plugin_deploy_type', // IOT 插件部署类型 IOT_PLUGIN_STATUS = 'iot_plugin_status', // IOT 插件状态 diff --git a/src/views/iot/thingmodel/ThingModelForm.vue b/src/views/iot/thingmodel/ThingModelForm.vue index 873dc749..31c4bbc8 100644 --- a/src/views/iot/thingmodel/ThingModelForm.vue +++ b/src/views/iot/thingmodel/ThingModelForm.vue @@ -10,7 +10,7 @@ @@ -103,6 +103,24 @@ const open = async (type: string, id?: number) => { formLoading.value = true try { formData.value = await ThingModelApi.getThingModel(id) + // 情况一:属性初始化 + if (isEmpty(formData.value.property)) { + formData.value.dataType = DataSpecsDataType.INT + formData.value.property = { + dataType: DataSpecsDataType.INT, + dataSpecs: { + dataType: DataSpecsDataType.INT + } + } + } + // 情况二:服务初始化 + if (isEmpty(formData.value.service)) { + formData.value.service = {} + } + // 情况三:事件初始化 + if (isEmpty(formData.value.event)) { + formData.value.event = {} + } } finally { formLoading.value = false } diff --git a/src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue b/src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue index 2340c556..c05ca065 100644 --- a/src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue +++ b/src/views/iot/thingmodel/dataSpecs/ThingModelNumberDataSpecs.vue @@ -47,7 +47,7 @@ @change="unitChange" >