Skip to content

Commit c4ba7ed

Browse files
YunaiVgitee-org
authored andcommitted
!622 【功能完善】IOT: 产品物模型
Merge pull request !622 from puhui999/feature/iot
2 parents fe3715c + 11f9750 commit c4ba7ed

16 files changed

+605
-299
lines changed

src/api/iot/thinkmodelfunction/index.ts renamed to src/api/iot/thinkmodel/index.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import request from '@/config/axios'
33
/**
44
* IoT 产品物模型
55
*/
6-
export interface ThingModelData {
6+
export interface ThinkModelData {
77
id?: number // 物模型功能编号
88
identifier?: string // 功能标识
99
name?: string // 功能名称
@@ -12,29 +12,29 @@ export interface ThingModelData {
1212
productKey?: string // 产品标识
1313
dataType: string // 数据类型,与 dataSpecs 的 dataType 保持一致
1414
type: ProductFunctionTypeEnum // 功能类型
15-
property: ThingModelProperty // 属性
16-
event?: ThingModelEvent // 事件
17-
service?: ThingModelService // 服务
15+
property: ThinkModelProperty // 属性
16+
event?: ThinkModelEvent // 事件
17+
service?: ThinkModelService // 服务
1818
}
1919

2020
/**
21-
* ThingModelProperty 类型
21+
* ThinkModelProperty 类型
2222
*/
23-
export interface ThingModelProperty {
23+
export interface ThinkModelProperty {
2424
[key: string]: any
2525
}
2626

2727
/**
28-
* ThingModelEvent 类型
28+
* ThinkModelEvent 类型
2929
*/
30-
export interface ThingModelEvent {
30+
export interface ThinkModelEvent {
3131
[key: string]: any
3232
}
3333

3434
/**
35-
* ThingModelService 类型
35+
* ThinkModelService 类型
3636
*/
37-
export interface ThingModelService {
37+
export interface ThinkModelService {
3838
[key: string]: any
3939
}
4040

@@ -51,39 +51,38 @@ export enum ProductFunctionAccessModeEnum {
5151
READ_ONLY = 'r' // 只读
5252
}
5353

54-
// TODO @puhui999:getProductThingModelPage => getThingModelPage 哈,不用带 product 前缀
5554
// IoT 产品物模型 API
56-
export const ThinkModelFunctionApi = {
55+
export const ThinkModelApi = {
5756
// 查询产品物模型分页
58-
getProductThingModelPage: async (params: any) => {
59-
return await request.get({ url: `/iot/product-thing-model/page`, params })
57+
getThinkModelPage: async (params: any) => {
58+
return await request.get({ url: `/iot/product-think-model/page`, params })
6059
},
6160

6261
// 获得产品物模型
63-
getProductThingModelListByProductId: async (params: any) => {
62+
getThinkModelListByProductId: async (params: any) => {
6463
return await request.get({
65-
url: `/iot/product-thing-model/list-by-product-id`,
64+
url: `/iot/product-think-model/list-by-product-id`,
6665
params
6766
})
6867
},
6968

7069
// 查询产品物模型详情
71-
getProductThingModel: async (id: number) => {
72-
return await request.get({ url: `/iot/product-thing-model/get?id=` + id })
70+
getThinkModel: async (id: number) => {
71+
return await request.get({ url: `/iot/product-think-model/get?id=` + id })
7372
},
7473

7574
// 新增产品物模型
76-
createProductThingModel: async (data: ThingModelData) => {
77-
return await request.post({ url: `/iot/product-thing-model/create`, data })
75+
createThinkModel: async (data: ThinkModelData) => {
76+
return await request.post({ url: `/iot/product-think-model/create`, data })
7877
},
7978

8079
// 修改产品物模型
81-
updateProductThingModel: async (data: ThingModelData) => {
82-
return await request.put({ url: `/iot/product-thing-model/update`, data })
80+
updateThinkModel: async (data: ThinkModelData) => {
81+
return await request.put({ url: `/iot/product-think-model/update`, data })
8382
},
8483

8584
// 删除产品物模型
86-
deleteProductThingModel: async (id: number) => {
87-
return await request.delete({ url: `/iot/product-thing-model/delete?id=` + id })
85+
deleteThinkModel: async (id: number) => {
86+
return await request.delete({ url: `/iot/product-think-model/delete?id=` + id })
8887
}
8988
}

src/utils/dict.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* 数据字典工具类
33
*/
4-
import { useDictStoreWithOut } from '@/store/modules/dict'
5-
import { ElementPlusInfoType } from '@/types/elementPlus'
4+
import {useDictStoreWithOut} from '@/store/modules/dict'
5+
import {ElementPlusInfoType} from '@/types/elementPlus'
66

77
const dictStore = useDictStoreWithOut()
88

@@ -236,7 +236,7 @@ export enum DICT_TYPE {
236236
IOT_DATA_FORMAT = 'iot_data_format', // IOT 数据格式
237237
IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 接入网关协议
238238
IOT_DEVICE_STATUS = 'iot_device_status', // IOT 设备状态
239-
IOT_PRODUCT_FUNCTION_TYPE = 'iot_product_function_type', // IOT 产品功能类型
239+
IOT_PRODUCT_THINK_MODEL_TYPE = 'iot_product_think_model_type', // IOT 产品功能类型
240240
IOT_DATA_TYPE = 'iot_data_type', // IOT 数据类型
241241
IOT_UNIT_TYPE = 'iot_unit_type', // IOT 单位类型
242242
IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型

src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue

Lines changed: 0 additions & 111 deletions
This file was deleted.

src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/views/iot/product/product/detail/ThingModel/dataSpecs/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/views/iot/product/product/detail/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<el-tab-pane label="Topic 类列表" name="topic">
99
<ProductTopic v-if="activeTab === 'topic'" :product="product" />
1010
</el-tab-pane>
11-
<el-tab-pane label="功能定义" lazy name="thingModel">
12-
<IoTProductThingModel ref="thingModelRef" />
11+
<el-tab-pane label="功能定义" lazy name="thinkModel">
12+
<IoTProductThinkModel ref="thinkModelRef" />
1313
</el-tab-pane>
1414
<el-tab-pane label="消息解析" name="message" />
1515
<el-tab-pane label="服务端订阅" name="subscription" />
@@ -22,7 +22,7 @@ import { DeviceApi } from '@/api/iot/device/device'
2222
import ProductDetailsHeader from './ProductDetailsHeader.vue'
2323
import ProductDetailsInfo from './ProductDetailsInfo.vue'
2424
import ProductTopic from './ProductTopic.vue'
25-
import IoTProductThingModel from './ThingModel/index.vue'
25+
import IoTProductThinkModel from '@/views/iot/thinkmodel/index.vue'
2626
import { useTagsViewStore } from '@/store/modules/tagsView'
2727
import { useRouter } from 'vue-router'
2828
import { IOT_PROVIDE_KEY } from '@/views/iot/utils/constants'

src/views/iot/product/product/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ const openObjectModel = (item: ProductVO) => {
309309
push({
310310
name: 'IoTProductDetail',
311311
params: { id: item.id },
312-
query: { tab: 'thingModel' }
312+
query: { tab: 'thinkModel' }
313313
})
314314
}
315315

0 commit comments

Comments
 (0)