From 1a837146fb1c1fb1fee7325b98b9a6e526a71c6a Mon Sep 17 00:00:00 2001 From: huangwenlong Date: Wed, 14 Dec 2022 19:02:53 +0800 Subject: [PATCH] =?UTF-8?q?tcp=E7=BB=84=E4=BB=B6=20tcpAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/protocol/Components.vue | 146 +++++++++++++++++++++++++++++- src/views/rule/Action.vue | 24 ++++- src/views/rule/Rules.vue | 2 +- src/views/rule/TcpAction.vue | 125 +++++++++++++++++++++++++ 4 files changed, 291 insertions(+), 6 deletions(-) create mode 100644 src/views/rule/TcpAction.vue diff --git a/src/views/protocol/Components.vue b/src/views/protocol/Components.vue index e723767..afc56b0 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 8e9933a..efb1bbb 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 4beb9b5..005e86f 100755 --- a/src/views/rule/Rules.vue +++ b/src/views/rule/Rules.vue @@ -178,7 +178,7 @@ > +
+ + + + + + + + + + + +
+ + + + + + -- Gitee