王通 2 лет назад
Родитель
Сommit
50f46eb16b
1 измененных файлов с 18 добавлено и 8 удалено
  1. 18 8
      src/components/vBottomMenu.vue

+ 18 - 8
src/components/vBottomMenu.vue

@@ -512,6 +512,7 @@
       deptTreeselect().then(response => {
         this.deptOptionsLiandong = response.data
       })
+
     },
     destroyed() { //离开页面关闭Socket连接
       if (this.websock) {
@@ -522,6 +523,7 @@
     },
     mounted() {
       this.websockSid.userId = Cookies.get("userId")
+
     },
 
     methods: {
@@ -583,6 +585,7 @@
           this.messageList.push(message)
           this.messageCount++
         } else if (null != message2) {
+          message2.taskId=message2.id
           this.taskList.push(message2)
           this.taskCount++
         }
@@ -718,6 +721,7 @@
           eventCode: eventCode,
           centerTaskTaskDepts: this.centerTaskTaskDepts
         }
+
         refusedTask(param).then(res => {
           //任务拒绝
           if (res.code == 200) {
@@ -820,10 +824,15 @@
           this.taskList = res.data
           this.taskCount = res.data.length
         })
+
         const that = this
-        setTimeout(function() {
-          //that.initWebSocket('TASK_SOCKET','/taskPush/',that.websockSid.userId)
-        }, 3000);
+        if (!this.weosocket)
+        {
+          setTimeout(function() {
+            that.initWebSocket('TASK_SOCKET','/taskPush/',that.websockSid.userId)
+          }, 3000);
+          }
+
 
       },
 
@@ -846,10 +855,11 @@
           this.messageCount = response.data.length
         });
         const that = this
-        setTimeout(function() {
-          //that.initWebSocket('MESSAGE_SOCKET', '/messagePush/', that.websockSid.userId)
-        }, 2000);
-
+        if (!this.weosocket) {
+          setTimeout(function() {
+            that.initWebSocket('MESSAGE_SOCKET', '/messagePush/', that.websockSid.userId)
+          }, 2000);
+        }
       },
       handleCheckedCitiesChangeBan(value) {
         this.choseLayerSwitchingList(this.banCheckList)
@@ -1377,4 +1387,4 @@
       opacity: 0;
     }
   }
-</style>
+</style>