Browse Source

问题修改

SunZehao 3 days ago
parent
commit
94b36d3bbb

+ 7 - 6
src/components/alarm-badge/index.vue

@@ -159,17 +159,18 @@ export default {
   },
   },
   mounted() {
   mounted() {
     this.wsinit();
     this.wsinit();
-    // this.timer = setInterval(() => {
-    //   this.wsinit();
-    // }, 2000);
+    this.timer = setInterval(() => {
+      this.wsinit();
+    }, 60000);
   },
   },
   unmounted() {
   unmounted() {
     console.log("离开标记", this.socketLeaveFlag);
     console.log("离开标记", this.socketLeaveFlag);
-    // clearInterval(this.timer);
-    // this.timer = null;
+    clearInterval(this.timer);
+    this.timer = null;
   },
   },
   methods: {
   methods: {
     wsinit() {
     wsinit() {
+        this.$store.commit("setWarningList", []);
         this.getAlarmConfig();
         this.getAlarmConfig();
         this.x = 80;
         this.x = 80;
         this.y = 80;
         this.y = 80;
@@ -197,7 +198,7 @@ export default {
             if (!this.socketLeaveFlag1) {
             if (!this.socketLeaveFlag1) {
             // 没有离开——重连
             // 没有离开——重连
             // websocket重连
             // websocket重连
-            this.socketReconnect1();
+            // this.socketReconnect1();
             }
             }
         })
         })
         .catch(() => {
         .catch(() => {

+ 1 - 1
src/components/deligoAlarmList/index.vue

@@ -7,7 +7,7 @@
             <img src="@assets/imgs/warn-icon.png" />
             <img src="@assets/imgs/warn-icon.png" />
           </div>
           </div>
           <div class="warn-name">实时告警</div>
           <div class="warn-name">实时告警</div>
-          <div class="warn-num">{{ warnNum ? warnNum : 0 }}</div>
+          <div class="warn-num">{{ warnList ? warnList.length : 0 }}</div>
         </div>
         </div>
         <div class="warn-close" @click="displayAlarm">
         <div class="warn-close" @click="displayAlarm">
           <img src="@assets/imgs/warn-close.png" />
           <img src="@assets/imgs/warn-close.png" />

+ 1 - 0
src/views/IntegratedAlarm/safe/components/safecomponent.vue

@@ -278,6 +278,7 @@ export default {
     initWarningList() {
     initWarningList() {
       if (this.$store.state.warningList?.length > 0) {
       if (this.$store.state.warningList?.length > 0) {
         let alarmList = [];
         let alarmList = [];
+        this.alarmList = []
         // let fullTableData = [];
         // let fullTableData = [];
         let dialogTableData = [];
         let dialogTableData = [];
         this.$store.state.warningList.forEach((ele) => {
         this.$store.state.warningList.forEach((ele) => {