diff --git a/src/api/iot/thinkmodelfunction/index.ts b/src/api/iot/thinkmodelfunction/index.ts index 1fce8137662a21c3ba3a97a369a86ffd5f67e1db..9c01cfa916751d7dcab40b45af40a9ee5e4b7e5c 100644 --- a/src/api/iot/thinkmodelfunction/index.ts +++ b/src/api/iot/thinkmodelfunction/index.ts @@ -1,17 +1,41 @@ 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 // 产品标识 + dataType: string // 数据类型,与 dataSpecs 的 dataType 保持一致 + 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 产品功能(物模型)类型枚举类 @@ -30,39 +54,35 @@ export enum ProductFunctionAccessModeEnum { // IoT 产品物模型 API export const ThinkModelFunctionApi = { // 查询产品物模型分页 - getThinkModelFunctionPage: async (params: any) => { - return await request.get({ url: `/iot/think-model-function/page`, params }) + getProductThingModelPage: async (params: any) => { + return await request.get({ url: `/iot/product-thing-model/page`, params }) }, + // 获得产品物模型 - getThinkModelFunctionListByProductId: async (params: any) => { + getProductThingModelListByProductId: async (params: any) => { return await request.get({ - url: `/iot/think-model-function/list-by-product-id`, + url: `/iot/product-thing-model/list-by-product-id`, params }) }, // 查询产品物模型详情 - getThinkModelFunction: async (id: number) => { - return await request.get({ url: `/iot/think-model-function/get?id=` + id }) + getProductThingModel: async (id: number) => { + return await request.get({ url: `/iot/product-thing-model/get?id=` + id }) }, // 新增产品物模型 - createThinkModelFunction: async (data: ThinkModelFunctionVO) => { - return await request.post({ url: `/iot/think-model-function/create`, data }) + createProductThingModel: async (data: ThingModelData) => { + return await request.post({ url: `/iot/product-thing-model/create`, data }) }, // 修改产品物模型 - updateThinkModelFunction: async (data: ThinkModelFunctionVO) => { - return await request.put({ url: `/iot/think-model-function/update`, data }) + updateProductThingModel: async (data: ThingModelData) => { + return await request.put({ url: `/iot/product-thing-model/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 }) + deleteProductThingModel: async (id: number) => { + return await request.delete({ url: `/iot/product-thing-model/delete?id=` + id }) } } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 335f52703c636b2a7100f7ceb1f07531ba1fc746..8b4bbe0e83b2369ce4b77e1d8789adfdc9b024ff 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -637,7 +637,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ hidden: true, activeMenu: '/iot/device' }, - component: () => import('@/views/iot/device/detail/index.vue') + component: () => import('@/views/iot/device/device/detail/index.vue') } ] } 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 0000000000000000000000000000000000000000..388191059dc028accb52d2975b68bcbb0e4b8789 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue similarity index 45% rename from src/views/iot/product/product/detail/ThinkModelFunctionForm.vue rename to src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue index 963d86b297a1cdafed1879c20d37714df4780845..f3d55d4955f5e7e03b2726404774469a55fbd13a 100644 --- a/src/views/iot/product/product/detail/ThinkModelFunctionForm.vue +++ b/src/views/iot/product/product/detail/ThingModel/ThingModelForm.vue @@ -1,91 +1,54 @@ - + + 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 0000000000000000000000000000000000000000..0c67358a3bfd6b2e3d6c14eacaf5f244bbbc8b80 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue new file mode 100644 index 0000000000000000000000000000000000000000..3920a0f5556ac6887ac5cdfc07f8eb8211c462e5 --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts b/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..f2e1daafaa996ea49c71e6786360340fcfc22b0e --- /dev/null +++ b/src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts @@ -0,0 +1,5 @@ +import ThingModelEnumTypeDataSpecs from './ThingModelEnumTypeDataSpecs.vue' +import ThingModelNumberTypeDataSpecs from './ThingModelNumberTypeDataSpecs.vue' +import ThingModelArrayTypeDataSpecs from './ThingModelArrayTypeDataSpecs.vue' + +export { ThingModelEnumTypeDataSpecs, ThingModelNumberTypeDataSpecs, ThingModelArrayTypeDataSpecs } diff --git a/src/views/iot/product/product/detail/ThinkModelFunction.vue b/src/views/iot/product/product/detail/ThingModel/index.vue similarity index 58% rename from src/views/iot/product/product/detail/ThinkModelFunction.vue rename to src/views/iot/product/product/detail/ThingModel/index.vue index 4f10ad06821e3ff89c9d37273a61a82619089379..41cbb39d513ef3ec2b556afd0f07c8f2a1a39218 100644 --- a/src/views/iot/product/product/detail/ThinkModelFunction.vue +++ b/src/views/iot/product/product/detail/ThingModel/index.vue @@ -2,18 +2,18 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 添加功能 + + 添加功能 - - + + - - - - - + + + + + + + + + -