From fdc971dd03287c2381722db09c1de4a86e69370c Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 11 Dec 2024 13:14:47 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91IOT:=20=E4=BA=A7=E5=93=81=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=EF=BC=8C20%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/ThingModel/ThingModelDataSpecs.vue | 98 ++++ .../detail/ThingModel/ThingModelDataType.vue | 29 + .../ThingModelForm.vue} | 56 +- .../ThingModelNumberTypeDataSpecs.vue | 59 ++ .../index.vue} | 65 ++- .../iot/product/product/detail/index.vue | 9 +- src/views/iot/utils/constants.ts | 535 ++++++++++++++++++ 7 files changed, 778 insertions(+), 73 deletions(-) create mode 100644 src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue create mode 100644 src/views/iot/product/product/detail/ThingModel/ThingModelDataType.vue rename src/views/iot/product/product/detail/{ThinkModelFunctionForm.vue => ThingModel/ThingModelForm.vue} (72%) create mode 100644 src/views/iot/product/product/detail/ThingModel/ThingModelNumberTypeDataSpecs.vue rename src/views/iot/product/product/detail/{ThinkModelFunction.vue => ThingModel/index.vue} (73%) create mode 100644 src/views/iot/utils/constants.ts diff --git a/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue new file mode 100644 index 00000000..5d5ff7e1 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThingModel/ThingModelDataType.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelDataType.vue new file mode 100644 index 00000000..206d8909 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelDataType.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue similarity index 72% rename from src/views/iot/product/product/detail/ThinkModelFunctionForm.vue rename to src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue index 963d86b2..a2beb91f 100644 --- a/src/views/iot/product/product/detail/ThinkModelFunctionForm.vue +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue @@ -1,17 +1,17 @@ - + + diff --git a/src/views/iot/product/product/detail/ThinkModelFunction.vue b/src/views/iot/product/product/detail/ThingModel/index.vue similarity index 73% rename from src/views/iot/product/product/detail/ThinkModelFunction.vue rename to src/views/iot/product/product/detail/ThingModel/index.vue index 4f10ad06..286fe12d 100644 --- a/src/views/iot/product/product/detail/ThinkModelFunction.vue +++ b/src/views/iot/product/product/detail/ThingModel/index.vue @@ -2,18 +2,18 @@ - 搜索 - 重置 - - 添加功能 + + + 搜索 + + + + 重置 + + + + 添加功能 - - + + - - - - - + + + + + - - - diff --git a/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue index a2beb91f..d551cd4d 100644 --- a/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue @@ -18,28 +18,17 @@ - + - - - - + - + 读写 只读 - + @@ -51,10 +40,9 @@ + + diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue new file mode 100644 index 00000000..db0a58b2 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThingModel/ThingModelNumberTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue similarity index 72% rename from src/views/iot/product/product/detail/ThingModel/ThingModelNumberTypeDataSpecs.vue rename to src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue index 65bd1fc9..7de57631 100644 --- a/src/views/iot/product/product/detail/ThingModel/ThingModelNumberTypeDataSpecs.vue +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue @@ -30,23 +30,13 @@ diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue index db0a58b2..7b977ae6 100644 --- a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue @@ -1,26 +1,41 @@ diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue index 7de57631..3920a0f5 100644 --- a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue @@ -1,17 +1,17 @@ diff --git a/src/views/iot/product/product/detail/ThingModel/config.ts b/src/views/iot/product/product/detail/ThingModel/config.ts index 1a028ac9..cd9d059d 100644 --- a/src/views/iot/product/product/detail/ThingModel/config.ts +++ b/src/views/iot/product/product/detail/ThingModel/config.ts @@ -10,12 +10,6 @@ export interface DataSpecsNumberDataVO { unitName: string // 单位的名称 } -/** dataSpecs 文本型数据结构 */ -export interface DataSpecsTextDataVO { - dataType: 'TEXT' - length: number -} - /** dataSpecs 枚举型数据结构 */ export interface DataSpecsEnumOrBoolDataVO { dataType: 'enum' | 'bool' diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelArrayTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelArrayTypeDataSpecs.vue new file mode 100644 index 00000000..d96bd7fc --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelArrayTypeDataSpecs.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts b/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts index 076dcc50..f2e1daaf 100644 --- a/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts @@ -1,4 +1,5 @@ import ThingModelEnumTypeDataSpecs from './ThingModelEnumTypeDataSpecs.vue' import ThingModelNumberTypeDataSpecs from './ThingModelNumberTypeDataSpecs.vue' +import ThingModelArrayTypeDataSpecs from './ThingModelArrayTypeDataSpecs.vue' -export { ThingModelEnumTypeDataSpecs, ThingModelNumberTypeDataSpecs } +export { ThingModelEnumTypeDataSpecs, ThingModelNumberTypeDataSpecs, ThingModelArrayTypeDataSpecs } From 187b5b03eeaa58f02ee977e53596d00c71a421c8 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 15 Dec 2024 23:15:51 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E3=80=91IOT:=20=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E7=BB=84=E4=BB=B6=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/thinkmodelfunction/index.ts | 56 ++++++++++++------- .../detail/ThingModel/ThingModelDataSpecs.vue | 52 ++++++++++------- .../detail/ThingModel/ThingModelForm.vue | 51 ++++++----------- .../ThingModelArrayTypeDataSpecs.vue | 2 +- 4 files changed, 87 insertions(+), 74 deletions(-) diff --git a/src/api/iot/thinkmodelfunction/index.ts b/src/api/iot/thinkmodelfunction/index.ts index 1fce8137..012ba190 100644 --- a/src/api/iot/thinkmodelfunction/index.ts +++ b/src/api/iot/thinkmodelfunction/index.ts @@ -1,17 +1,40 @@ import request from '@/config/axios' -// IoT 产品物模型 VO -export interface ThinkModelFunctionVO { - id: number // 物模型功能编号 - identifier: string // 功能标识 - name: string // 功能名称 - description: string // 功能描述 - productId: number // 产品编号 - productKey: string // 产品标识 - type: number // 功能类型 - property: string // 属性 - event: string // 事件 - service: string // 服务 +/** + * IoT 产品物模型 + */ +export interface ThingModelData { + id?: number // 物模型功能编号 + identifier?: string // 功能标识 + name?: string // 功能名称 + description?: string // 功能描述 + productId?: number // 产品编号 + productKey?: string // 产品标识 + type: ProductFunctionTypeEnum // 功能类型 + property: ThingModelProperty // 属性 + event?: ThingModelEvent // 事件 + service?: ThingModelService // 服务 +} + +/** + * ThingModelProperty 类型 + */ +export interface ThingModelProperty { + [key: string]: any +} + +/** + * ThingModelEvent 类型 + */ +export interface ThingModelEvent { + [key: string]: any +} + +/** + * ThingModelService 类型 + */ +export interface ThingModelService { + [key: string]: any } // IOT 产品功能(物模型)类型枚举类 @@ -47,22 +70,17 @@ export const ThinkModelFunctionApi = { }, // 新增产品物模型 - createThinkModelFunction: async (data: ThinkModelFunctionVO) => { + createThinkModelFunction: async (data: ThingModelData) => { return await request.post({ url: `/iot/think-model-function/create`, data }) }, // 修改产品物模型 - updateThinkModelFunction: async (data: ThinkModelFunctionVO) => { + updateThinkModelFunction: async (data: ThingModelData) => { return await request.put({ url: `/iot/think-model-function/update`, data }) }, // 删除产品物模型 deleteThinkModelFunction: async (id: number) => { return await request.delete({ url: `/iot/think-model-function/delete?id=` + id }) - }, - - // 导出产品物模型 Excel - exportThinkModelFunction: async (params) => { - return await request.download({ url: `/iot/think-model-function/export-excel`, params }) } } diff --git a/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue index ac585611..a672baab 100644 --- a/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue @@ -1,6 +1,6 @@