From 17b583422095aff6bb91bd8ddff5faeb41c8edb2 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期六, 02 十二月 2023 09:06:24 +0800
Subject: [PATCH] 更新电气管理通讯逻辑

---
 CanadaMes-ui/src/views/Electrical/alarm.vue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/CanadaMes-ui/src/views/Electrical/alarm.vue b/CanadaMes-ui/src/views/Electrical/alarm.vue
index 14f8fd3..50dc757 100644
--- a/CanadaMes-ui/src/views/Electrical/alarm.vue
+++ b/CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -102,10 +102,23 @@
 
 
   },
-  created () {
+  // created () {
+  //   this.init();
+
+
+  //   if (this.shijian1 == "" || this.shijian2 == "") {
+  //     //鏌ヨ褰撳ぉ鎶ヨ淇℃伅
+  //     this.load();
+  //   }
+  //   else {
+  //     //鏍规嵁鏃堕棿鏌ヨ鎶ヨ淇℃伅
+  //     this.selectTime();
+  //   }
+
+  // },
+  activated(){
+
     this.init();
-
-
     if (this.shijian1 == "" || this.shijian2 == "") {
       //鏌ヨ褰撳ぉ鎶ヨ淇℃伅
       this.load();
@@ -115,7 +128,7 @@
       this.selectTime();
     }
 
-  },
+ },
   methods: {
 
     load () {
@@ -198,6 +211,9 @@
         socket.onerror = function () {
           console.log("websocket鍙戠敓浜嗛敊璇�");
         }
+        this.$router.afterEach(function(){
+          socket.close();
+        })
       }
 
     },

--
Gitblit v1.8.0