File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed
views/iot/rule/databridge Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 1
1
import request from '@/config/axios'
2
2
3
- // IoT 数据桥梁 VO
3
+ //数据桥梁 VO
4
4
export interface DataBridgeVO {
5
5
id ?: number // 桥梁编号
6
6
name ?: string // 桥梁名称
@@ -81,45 +81,45 @@ export interface RedisStreamMQConfig extends Config {
81
81
82
82
/** 数据桥梁类型 */
83
83
export const IoTDataBridgeConfigType = {
84
- HTTP : 'HTTP ' ,
85
- TCP : 'TCP ' ,
86
- WEBSOCKET : 'WEBSOCKET ' ,
87
- MQTT : 'MQTT ' ,
88
- DATABASE : 'DATABASE ' ,
89
- REDIS_STREAM : 'REDIS_STREAM ' ,
90
- ROCKETMQ : 'ROCKETMQ ' ,
91
- RABBITMQ : 'RABBITMQ ' ,
92
- KAFKA : 'KAFKA '
84
+ HTTP : '1 ' ,
85
+ TCP : '2 ' ,
86
+ WEBSOCKET : '3 ' ,
87
+ MQTT : '10 ' ,
88
+ DATABASE : '20 ' ,
89
+ REDIS_STREAM : '21 ' ,
90
+ ROCKETMQ : '30 ' ,
91
+ RABBITMQ : '31 ' ,
92
+ KAFKA : '32 '
93
93
} as const
94
94
95
- // IoT 数据桥梁 API
95
+ // 数据桥梁 API
96
96
export const DataBridgeApi = {
97
- // 查询IoT 数据桥梁分页
97
+ // 查询数据桥梁分页
98
98
getDataBridgePage : async ( params : any ) => {
99
99
return await request . get ( { url : `/iot/data-bridge/page` , params } )
100
100
} ,
101
101
102
- // 查询IoT 数据桥梁详情
102
+ // 查询数据桥梁详情
103
103
getDataBridge : async ( id : number ) => {
104
104
return await request . get ( { url : `/iot/data-bridge/get?id=` + id } )
105
105
} ,
106
106
107
- // 新增IoT 数据桥梁
107
+ // 新增数据桥梁
108
108
createDataBridge : async ( data : DataBridgeVO ) => {
109
109
return await request . post ( { url : `/iot/data-bridge/create` , data } )
110
110
} ,
111
111
112
- // 修改IoT 数据桥梁
112
+ // 修改数据桥梁
113
113
updateDataBridge : async ( data : DataBridgeVO ) => {
114
114
return await request . put ( { url : `/iot/data-bridge/update` , data } )
115
115
} ,
116
116
117
- // 删除IoT 数据桥梁
117
+ // 删除数据桥梁
118
118
deleteDataBridge : async ( id : number ) => {
119
119
return await request . delete ( { url : `/iot/data-bridge/delete?id=` + id } )
120
120
} ,
121
121
122
- // 导出IoT 数据桥梁 Excel
122
+ // 导出数据桥梁 Excel
123
123
exportDataBridge : async ( params ) => {
124
124
return await request . download ( { url : `/iot/data-bridge/export-excel` , params } )
125
125
}
Original file line number Diff line number Diff line change 72
72
</Dialog >
73
73
</template >
74
74
<script lang="ts" setup>
75
- import { DICT_TYPE , getDictLabel , getIntDictOptions } from ' @/utils/dict'
75
+ import { DICT_TYPE , getDictObj , getIntDictOptions } from ' @/utils/dict'
76
76
import { DataBridgeApi , DataBridgeVO , IoTDataBridgeConfigType } from ' @/api/iot/rule/databridge'
77
77
import {
78
78
HttpConfigForm ,
@@ -140,8 +140,8 @@ const formRules = reactive({
140
140
141
141
const formRef = ref () // 表单 Ref
142
142
const showConfig = computed (() => (val : string ) => {
143
- const label = getDictLabel (DICT_TYPE .IOT_DATA_BRIDGE_TYPE_ENUM , formData .value .type )
144
- return label && label === val
143
+ const dict = getDictObj (DICT_TYPE .IOT_DATA_BRIDGE_TYPE_ENUM , formData .value .type )
144
+ return dict && dict . value + ' ' === val
145
145
}) // 显示对应的 Config 配置项
146
146
/** 打开弹窗 */
147
147
const open = async (type : string , id ? : number ) => {
You can’t perform that action at this time.
0 commit comments