From f521ebc2551d468c4c478783a18d4b0714394d61 Mon Sep 17 00:00:00 2001
From: suerprisePlus <15810472099@163.com>
Date: 星期一, 14 十月 2024 15:00:13 +0800
Subject: [PATCH] 配网大屏功能优化

---
 src/App.vue |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 055b6a9..6181d2e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -24,14 +24,39 @@
   },
   data() {
     return {
-     
+
     }
   },
   mounted() {
-  
+    this.createSocket();
+    setTimeout(() => {
+      this.$store.state.mapLayers.msgList.push({
+        msg: "鍙樺帇鍣ㄦ晠闅�",
+        point: "POINT (112.56978672907 37.8558881392881)"
+      })
+
+    }, 10000);
   },
   methods: {
-  
+    createSocket() {
+      this.wsSocket = new WebSocket(config.pySocket);
+      this.wsSocket.onopen = (event) => {
+        console.log('WebSocket杩炴帴鎴愬姛');
+      };
+      this.wsSocket.onmessage = (event) => {
+        // console.log('Received message:', event.data);
+
+        if (event.data != "杩炴帴鎴愬姛") {
+          const obj = JSON.parse(event.data)
+
+
+          this.leftChartData = {
+            type: 'left1',
+            val: obj
+          }
+        }
+      };
+    }
   }
 };
 </script>

--
Gitblit v1.9.3