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
5c0a0e66
authored
Mar 14, 2025
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】IoT: 数据桥梁函数注释统一样式
parent
065cb816
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
src/utils/dict.ts
+2
-2
src/views/iot/rule/databridge/IoTDataBridgeForm.vue
+10
-10
src/views/iot/rule/databridge/config/HttpConfigForm.vue
+2
-2
src/views/iot/rule/databridge/config/components/KeyValueEditor.vue
+5
-5
No files found.
src/utils/dict.ts
View file @
5c0a0e66
/**
* 数据字典工具类
*/
import
{
useDictStoreWithOut
}
from
'@/store/modules/dict'
import
{
ElementPlusInfoType
}
from
'@/types/elementPlus'
import
{
useDictStoreWithOut
}
from
'@/store/modules/dict'
import
{
ElementPlusInfoType
}
from
'@/types/elementPlus'
const
dictStore
=
useDictStoreWithOut
()
...
...
src/views/iot/rule/databridge/IoTDataBridgeForm.vue
View file @
5c0a0e66
...
...
@@ -40,15 +40,15 @@
/>
<KafkaMQConfigForm
v-if=
"showConfig(IoTDataBridgeConfigType.KAFKA)"
v-model=
"formData.config
!
"
v-model=
"formData.config"
/>
<RabbitMQConfigForm
v-if=
"showConfig(IoTDataBridgeConfigType.RABBITMQ)"
v-model=
"formData.config
!
"
v-model=
"formData.config"
/>
<RedisStreamMQConfigForm
v-if=
"showConfig(IoTDataBridgeConfigType.REDIS_STREAM)"
v-model=
"formData.config
!
"
v-model=
"formData.config"
/>
<el-form-item
label=
"桥梁状态"
prop=
"status"
>
<el-radio-group
v-model=
"formData.status"
>
...
...
@@ -100,28 +100,28 @@ const formData = ref<DataBridgeVO>({
config
:
{}
as
any
})
const
formRules
=
reactive
({
/
/ 通用字段
/
** 通用字段 */
name
:
[{
required
:
true
,
message
:
'桥梁名称不能为空'
,
trigger
:
'blur'
}],
status
:
[{
required
:
true
,
message
:
'桥梁状态不能为空'
,
trigger
:
'blur'
}],
direction
:
[{
required
:
true
,
message
:
'桥梁方向不能为空'
,
trigger
:
'blur'
}],
type
:
[{
required
:
true
,
message
:
'桥梁类型不能为空'
,
trigger
:
'change'
}],
/
/ HTTP 配置
/
** HTTP 配置 */
'config.url'
:
[{
required
:
true
,
message
:
'请求地址不能为空'
,
trigger
:
'blur'
}],
'config.method'
:
[{
required
:
true
,
message
:
'请求方法不能为空'
,
trigger
:
'blur'
}],
/
/ MQTT 配置
/
** MQTT 配置 */
'config.username'
:
[{
required
:
true
,
message
:
'用户名不能为空'
,
trigger
:
'blur'
}],
'config.password'
:
[{
required
:
true
,
message
:
'密码不能为空'
,
trigger
:
'blur'
}],
'config.clientId'
:
[{
required
:
true
,
message
:
'客户端ID不能为空'
,
trigger
:
'blur'
}],
'config.topic'
:
[{
required
:
true
,
message
:
'主题不能为空'
,
trigger
:
'blur'
}],
/
/ RocketMQ 配置
/
** RocketMQ 配置 */
'config.nameServer'
:
[{
required
:
true
,
message
:
'NameServer 地址不能为空'
,
trigger
:
'blur'
}],
'config.accessKey'
:
[{
required
:
true
,
message
:
'AccessKey 不能为空'
,
trigger
:
'blur'
}],
'config.secretKey'
:
[{
required
:
true
,
message
:
'SecretKey 不能为空'
,
trigger
:
'blur'
}],
'config.group'
:
[{
required
:
true
,
message
:
'消费组不能为空'
,
trigger
:
'blur'
}],
/
/ Kafka 配置
/
** Kafka 配置 */
'config.bootstrapServers'
:
[{
required
:
true
,
message
:
'服务地址不能为空'
,
trigger
:
'blur'
}],
'config.ssl'
:
[{
required
:
true
,
message
:
'SSL 配置不能为空'
,
trigger
:
'change'
}],
/
/ RabbitMQ 配置
/
** RabbitMQ 配置 */
'config.host'
:
[{
required
:
true
,
message
:
'主机地址不能为空'
,
trigger
:
'blur'
}],
'config.port'
:
[
{
required
:
true
,
message
:
'端口不能为空'
,
trigger
:
'blur'
},
...
...
@@ -131,7 +131,7 @@ const formRules = reactive({
'config.exchange'
:
[{
required
:
true
,
message
:
'交换机不能为空'
,
trigger
:
'blur'
}],
'config.routingKey'
:
[{
required
:
true
,
message
:
'路由键不能为空'
,
trigger
:
'blur'
}],
'config.queue'
:
[{
required
:
true
,
message
:
'队列不能为空'
,
trigger
:
'blur'
}],
/
/ Redis Stream 配置
/
** Redis Stream 配置 */
'config.database'
:
[
{
required
:
true
,
message
:
'数据库索引不能为空'
,
trigger
:
'blur'
},
{
type
:
'number'
,
min
:
0
,
message
:
'数据库索引必须是非负整数'
,
trigger
:
'blur'
}
...
...
src/views/iot/rule/databridge/config/HttpConfigForm.vue
View file @
5c0a0e66
...
...
@@ -42,14 +42,14 @@ const props = defineProps<{
const
emit
=
defineEmits
([
'update:modelValue'
])
const
config
=
useVModel
(
props
,
'modelValue'
,
emit
)
as
Ref
<
HttpConfig
>
/
/ URL处理
/
** URL处理 */
const
urlPrefix
=
ref
(
'http://'
)
const
urlPath
=
ref
(
''
)
const
fullUrl
=
computed
(()
=>
{
return
urlPath
.
value
?
urlPrefix
.
value
+
urlPath
.
value
:
''
})
/
/ 监听URL变化
/
** 监听URL变化 */
watch
([
urlPrefix
,
urlPath
],
()
=>
{
config
.
value
.
url
=
fullUrl
.
value
})
...
...
src/views/iot/rule/databridge/config/components/KeyValueEditor.vue
View file @
5c0a0e66
...
...
@@ -33,22 +33,22 @@ const props = defineProps<{
addButtonText
:
string
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
/
/ 内部key-value项列表
/
** 内部 key-value 项列表 */
const
items
=
ref
<
KeyValueItem
[]
>
([])
/
/ 添加项目
/
** 添加项目 */
const
addItem
=
()
=>
{
items
.
value
.
push
({
key
:
''
,
value
:
''
})
updateModelValue
()
}
/
/ 移除项目
/
** 移除项目 */
const
removeItem
=
(
index
:
number
)
=>
{
items
.
value
.
splice
(
index
,
1
)
updateModelValue
()
}
/
/ 更新modelValue
/
** 更新 modelValue */
const
updateModelValue
=
()
=>
{
const
result
:
Record
<
string
,
string
>
=
{}
items
.
value
.
forEach
((
item
)
=>
{
...
...
@@ -59,7 +59,7 @@ const updateModelValue = () => {
emit
(
'update:modelValue'
,
result
)
}
/
/ 监听项目变化
/
** 监听项目变化 */
watch
(
items
,
updateModelValue
,
{
deep
:
true
})
watch
(
()
=>
props
.
modelValue
,
...
...
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