Ver código fonte

修改设备详情逻辑

wangming 1 mês atrás
pai
commit
0df8a7b503
1 arquivos alterados com 11 adições e 10 exclusões
  1. 11 10
      src/pagesA/deviceDetail/deviceDetail.vue

+ 11 - 10
src/pagesA/deviceDetail/deviceDetail.vue

@@ -1012,6 +1012,7 @@ export default {
 
         if (this.mqttData) {
             this.mqttData.on("message", (topic, message) => {
+                // console.log("topicDeviceDetail", topic, message);
                 const dataMatch = topic.match(/^\/dev\/(.+)\/tracker_targets$/);
                 const cmdMatch = topic.match(/^\/mps\/wx_(.+)\/notice$/);
                 if (dataMatch) {
@@ -1033,21 +1034,21 @@ export default {
         this.inactivityTimer = null;
         this.autoPlayinterval = null;
         this.showModle = false;
-        if (this.mqttData) {
-            this.mqttData.end();
-            this.mqttData = null;
-            console.log("页面 DATA MQTT 已断开");
-        }
+        // if (this.mqttData) {
+        //     this.mqttData.end();
+        //     this.mqttData = null;
+        //     console.log("页面 DATA MQTT 已断开");
+        // }
     },
     onHide() {
         this.inactivityTimer = null;
         this.autoPlayinterval = null;
         this.showModle = false;
-        if (this.mqttData) {
-            this.mqttData.end();
-            this.mqttData = null;
-            console.log("页面 DATA MQTT 已断开");
-        }
+        // if (this.mqttData) {
+        //     this.mqttData.end();
+        //     this.mqttData = null;
+        //     console.log("页面 DATA MQTT 已断开");
+        // }
     },
 };
 </script>