From 5391720b8bb3abee9a7374f85ef80aac0c6bb60c Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 25 Dec 2024 23:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E3=80=91IOT:=20ThingModel=20=E6=9C=8D=E5=8A=A1=E5=92=8C?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/thingmodel/index.ts | 53 ------ src/views/iot/thingmodel/ThingModelEvent.vue | 24 ++- src/views/iot/thingmodel/ThingModelForm.vue | 18 ++- .../thingmodel/ThingModelInputOutputParam.vue | 153 ++++++++++++++++++ .../iot/thingmodel/ThingModelProperty.vue | 24 ++- .../iot/thingmodel/ThingModelService.vue | 16 +- src/views/iot/thingmodel/config.ts | 62 ++++++- src/views/iot/thingmodel/index.vue | 67 +++++++- 8 files changed, 331 insertions(+), 86 deletions(-) create mode 100644 src/views/iot/thingmodel/ThingModelInputOutputParam.vue diff --git a/src/api/iot/thingmodel/index.ts b/src/api/iot/thingmodel/index.ts index 3c21ee80..9cb795ac 100644 --- a/src/api/iot/thingmodel/index.ts +++ b/src/api/iot/thingmodel/index.ts @@ -38,59 +38,6 @@ export interface ThingModelService { [key: string]: any } -// IOT 产品物模型类型枚举类 -export const ThingModelType = { - PROPERTY: 1, // 属性 - SERVICE: 2, // 服务 - EVENT: 3 // 事件 -} as const - -// IOT 产品物模型访问模式枚举类 -export const ThingModelAccessMode = { - READ_WRITE: { - label: '读写', - value: 'rw' - }, - READ_ONLY: { - label: '只读', - value: 'r' - } -} as const - -// IOT 产品物模型服务调用方式枚举 -export const ThingModelServiceCallType = { - ASYNC: { - label: '异步调用', - value: 'async' - }, - SYNC: { - label: '同步调用', - value: 'sync' - } -} as const - -// IOT 产品物模型事件类型枚举 -export const ThingModelServiceEventType = { - INFO: { - label: '信息', - value: 'info' - }, - ALERT: { - label: '告警', - value: 'alert' - }, - ERROR: { - label: '故障', - value: 'error' - } -} as const - -// IOT 产品物模型参数是输入参数还是输出参数 -export const ThingModelParamDirection = { - INPUT: 'input', // 输入参数 - OUTPUT: 'output' // 输出参数 -} as const - // IoT 产品物模型 API export const ThingModelApi = { // 查询产品物模型分页 diff --git a/src/views/iot/thingmodel/ThingModelEvent.vue b/src/views/iot/thingmodel/ThingModelEvent.vue index 7a49b2e7..827e59dc 100644 --- a/src/views/iot/thingmodel/ThingModelEvent.vue +++ b/src/views/iot/thingmodel/ThingModelEvent.vue @@ -2,25 +2,33 @@ - - {{ ThingModelServiceEventType.INFO.label }} + + {{ ThingModelEventType.INFO.label }} - - {{ ThingModelServiceEventType.ALERT.label }} + + {{ ThingModelEventType.ALERT.label }} - - {{ ThingModelServiceEventType.ERROR.label }} + + {{ ThingModelEventType.ERROR.label }} + + + + + diff --git a/src/views/iot/thingmodel/ThingModelProperty.vue b/src/views/iot/thingmodel/ThingModelProperty.vue index 2f496cdc..cb3bfa15 100644 --- a/src/views/iot/thingmodel/ThingModelProperty.vue +++ b/src/views/iot/thingmodel/ThingModelProperty.vue @@ -75,7 +75,7 @@ v-if="property.dataType === DataSpecsDataType.STRUCT" v-model="property.dataSpecsList" /> - + {{ ThingModelAccessMode.READ_WRITE.label }} @@ -85,32 +85,28 @@ - - -