diff --git a/src/views/protocol/Components.vue b/src/views/protocol/Components.vue index e72376741b08dfe2d75d6b77463099f1d3b59207..afc56b030f93e4cff91d577a8113bc2a3814368a 100755 --- a/src/views/protocol/Components.vue +++ b/src/views/protocol/Components.vue @@ -133,8 +133,130 @@ + + + + + + + + + 服务端模式 + 客户端模式 + + + 设备直连通讯组件,收到设备消息直接进行处理 + + + 设备连接其它tcp服务端接受消息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { @@ -606,6 +748,8 @@ export default { this.editForm.config = JSON.stringify(this.httpConfigForm); } else if (protocol == "mqtt") { this.editForm.config = JSON.stringify(this.mqttConfigForm); + }else if (protocol == "tcp") { + this.editForm.config = JSON.stringify(this.tcpConfigForm); } ComponentSave(this.editForm).then(() => { @@ -694,4 +838,4 @@ export default { .code-dialog.is-fullscreen .el-dialog__body { padding: 5px 5px !important; } - \ No newline at end of file + diff --git a/src/views/rule/Action.vue b/src/views/rule/Action.vue index 8e9933a9b54e5d3aebaa711775df1911e0104f8e..efb1bbbe80ac8ae5809ddc31d3a76cd5faa6c02f 100755 --- a/src/views/rule/Action.vue +++ b/src/views/rule/Action.vue @@ -26,12 +26,17 @@ >kafka推送 + tcp推送 + - - - - + + + + + @@ -40,6 +45,7 @@ import DeviceAction from "./DeviceAction.vue"; import HttpAction from "./HttpAction.vue"; import MqttAction from "@/views/rule/MqttAction"; import KafkaAction from "@/views/rule/KafkaAction"; +import TcpAction from "@/views/rule/TcpAction"; export default { name: "Action", @@ -68,6 +74,7 @@ export default { MqttAction, DeviceAction, HttpAction, + TcpAction }, created() { }, @@ -102,6 +109,15 @@ export default { }`, }, ]; + } else if (this.data.type === "tcp") { + this.data.services = [ + { + host: "", + port: 1883, + script: `this.translate=function(msg){ + }` + }, + ]; } } }, diff --git a/src/views/rule/Rules.vue b/src/views/rule/Rules.vue index 4beb9b57ea848ba7ce1fac3aa56c5421134e6d00..005e86f00fce6cb259a7b5044f7c0114f1b4b4a7 100755 --- a/src/views/rule/Rules.vue +++ b/src/views/rule/Rules.vue @@ -178,7 +178,7 @@ > + + + + + + + + + + + + + + + + + + +