From beae103cecbcbf8e03b7e1e6997334d6f6453ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-S9HJSOEB=5C=E6=98=8A=E5=A4=A9?= Date: Thu, 16 Nov 2023 09:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=A7=86=E9=A2=91=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E9=99=90=E5=88=B6=20=E5=81=9C=E6=AD=A2=E6=97=A0?= =?UTF-8?q?=E6=95=88ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/checkManage/index.vue | 70 +++++++++++++------------- src/views/realTimeMonitoring/index.vue | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/views/checkManage/index.vue b/src/views/checkManage/index.vue index 5726d32..9fbb682 100644 --- a/src/views/checkManage/index.vue +++ b/src/views/checkManage/index.vue @@ -289,42 +289,42 @@ export default { }) .catch((err) => {}); }, - initWebSocket() { - //初始化weosocket - const wsuri = "ws://127.0.0.1:8099/ws/111"; - this.websock = new WebSocket(wsuri); - this.websock.onmessage = this.websocketonmessage; - this.websock.onopen = this.websocketonopen; - this.websock.onerror = this.websocketonerror; - this.websock.onclose = this.websocketclose; - }, - websocketonopen() { - //连接建立之后执行send方法发送数据 - this.websocketsend(JSON.stringify(actions)); - }, - websocketonerror() { - //连接建立失败重连 - this.initWebSocket(); - }, - websocketonmessage(e) { - console.log("aaaa"); - var el = JSON.parse(e.data) - console.log(el.type); + // initWebSocket() { + // //初始化weosocket + // const wsuri = "ws://127.0.0.1:8099/ws/111"; + // this.websock = new WebSocket(wsuri); + // this.websock.onmessage = this.websocketonmessage; + // this.websock.onopen = this.websocketonopen; + // this.websock.onerror = this.websocketonerror; + // this.websock.onclose = this.websocketclose; + // }, + // websocketonopen() { + // //连接建立之后执行send方法发送数据 + // this.websocketsend(JSON.stringify(actions)); + // }, + // websocketonerror() { + // //连接建立失败重连 + // this.initWebSocket(); + // }, + // websocketonmessage(e) { + // console.log("aaaa"); + // var el = JSON.parse(e.data) + // console.log(el.type); - if (el.type == "InventoryPush") { - this.wsData.push(el); - } - //数据接收 - const redata = JSON.parse(e.data); - }, - websocketsend(Data) { - //数据发送 - this.websock.send(Data); - }, - websocketclose(e) { - //关闭 - console.log("断开连接", e); - }, + // if (el.type == "InventoryPush") { + // this.wsData.push(el); + // } + // //数据接收 + // const redata = JSON.parse(e.data); + // }, + // websocketsend(Data) { + // //数据发送 + // this.websock.send(Data); + // }, + // websocketclose(e) { + // //关闭 + // console.log("断开连接", e); + // }, }, components: { Subsection, diff --git a/src/views/realTimeMonitoring/index.vue b/src/views/realTimeMonitoring/index.vue index 5e195ca..16f514f 100644 --- a/src/views/realTimeMonitoring/index.vue +++ b/src/views/realTimeMonitoring/index.vue @@ -1,6 +1,6 @@