Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
59062a1c
authored
Mar 14, 2025
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】IoT: 数据桥梁配置切换使用字典值
parent
5c0a0e66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
src/api/iot/rule/databridge/index.ts
+17
-17
src/views/iot/rule/databridge/IoTDataBridgeForm.vue
+3
-3
No files found.
src/api/iot/rule/databridge/index.ts
View file @
59062a1c
import
request
from
'@/config/axios'
//
IoT
数据桥梁 VO
//数据桥梁 VO
export
interface
DataBridgeVO
{
id
?:
number
// 桥梁编号
name
?:
string
// 桥梁名称
...
...
@@ -81,45 +81,45 @@ export interface RedisStreamMQConfig extends Config {
/** 数据桥梁类型 */
export
const
IoTDataBridgeConfigType
=
{
HTTP
:
'
HTTP
'
,
TCP
:
'
TCP
'
,
WEBSOCKET
:
'
WEBSOCKET
'
,
MQTT
:
'
MQTT
'
,
DATABASE
:
'
DATABASE
'
,
REDIS_STREAM
:
'
REDIS_STREAM
'
,
ROCKETMQ
:
'
ROCKETMQ
'
,
RABBITMQ
:
'
RABBITMQ
'
,
KAFKA
:
'
KAFKA
'
HTTP
:
'
1
'
,
TCP
:
'
2
'
,
WEBSOCKET
:
'
3
'
,
MQTT
:
'
10
'
,
DATABASE
:
'
20
'
,
REDIS_STREAM
:
'
21
'
,
ROCKETMQ
:
'
30
'
,
RABBITMQ
:
'
31
'
,
KAFKA
:
'
32
'
}
as
const
//
IoT
数据桥梁 API
// 数据桥梁 API
export
const
DataBridgeApi
=
{
// 查询
IoT
数据桥梁分页
// 查询数据桥梁分页
getDataBridgePage
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/data-bridge/page`
,
params
})
},
// 查询
IoT
数据桥梁详情
// 查询数据桥梁详情
getDataBridge
:
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/iot/data-bridge/get?id=`
+
id
})
},
// 新增
IoT
数据桥梁
// 新增数据桥梁
createDataBridge
:
async
(
data
:
DataBridgeVO
)
=>
{
return
await
request
.
post
({
url
:
`/iot/data-bridge/create`
,
data
})
},
// 修改
IoT
数据桥梁
// 修改数据桥梁
updateDataBridge
:
async
(
data
:
DataBridgeVO
)
=>
{
return
await
request
.
put
({
url
:
`/iot/data-bridge/update`
,
data
})
},
// 删除
IoT
数据桥梁
// 删除数据桥梁
deleteDataBridge
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/iot/data-bridge/delete?id=`
+
id
})
},
// 导出
IoT
数据桥梁 Excel
// 导出数据桥梁 Excel
exportDataBridge
:
async
(
params
)
=>
{
return
await
request
.
download
({
url
:
`/iot/data-bridge/export-excel`
,
params
})
}
...
...
src/views/iot/rule/databridge/IoTDataBridgeForm.vue
View file @
59062a1c
...
...
@@ -72,7 +72,7 @@
</Dialog>
</template>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
,
getDict
Label
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getDict
Obj
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DataBridgeApi
,
DataBridgeVO
,
IoTDataBridgeConfigType
}
from
'@/api/iot/rule/databridge'
import
{
HttpConfigForm
,
...
...
@@ -140,8 +140,8 @@ const formRules = reactive({
const
formRef
=
ref
()
// 表单 Ref
const
showConfig
=
computed
(()
=>
(
val
:
string
)
=>
{
const
label
=
getDictLabel
(
DICT_TYPE
.
IOT_DATA_BRIDGE_TYPE_ENUM
,
formData
.
value
.
type
)
return
label
&&
label
===
val
const
dict
=
getDictObj
(
DICT_TYPE
.
IOT_DATA_BRIDGE_TYPE_ENUM
,
formData
.
value
.
type
)
return
dict
&&
dict
.
value
+
''
===
val
})
// 显示对应的 Config 配置项
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment