heyang 2 vuotta sitten
vanhempi
commit
8cc6dd204d
2 muutettua tiedostoa jossa 15 lisäystä ja 4 poistoa
  1. 6 0
      App.vue
  2. 9 4
      pages/emergencyEvacuationBig.vue

+ 6 - 0
App.vue

@@ -140,6 +140,12 @@
 							        console.log("应急疏散订阅成功",self.mqttIdList[i].type)
 							    }
 							});
+						}else if(self.mqttIdList[i].type == 'lab/fireDevice/Warn/'){
+							self.client.subscribe(self.mqttIdList[i].type, (err) => {
+							    if (!err) {
+							        console.log("一键灭火订阅成功",self.mqttIdList[i].type)
+							    }
+							});
 						}
 					}
                 });

+ 9 - 4
pages/emergencyEvacuationBig.vue

@@ -169,6 +169,7 @@
 </template>
 
 <script>
+import $mqtt from '@/utils/mqtt.min.js';
 import { config } from '@/api/request/config.js'
 import { lablayout,evacuate,closure,lineEvacuate,getRedis,getDeviceList,textParseUrlIps,laboratoryInfo,
   getCameraByFloor,lineEvacuateTow,treeselectByUser,getBuilding,getDeviceListBySub,
@@ -251,7 +252,7 @@ export default {
       address:"",
       videoHardwareNUM:[],//实验室和楼道摄像头编码
 	  outfireData:{},//一键灭火
-	  timer:'',
+	 
 	  countdown:'',//倒计时
 	  timer2: null,//倒计时
 	  dialogVisible:false,//一键灭火弹出层
@@ -267,9 +268,10 @@ export default {
 	  this.itemData.subjectId=85
 	  this.firedeviceStatus();
 	  //定时请求一键灭火设备状态
-	  //this.timer=setInterval(self.firedeviceStatusTiming,5000)
+	
     this.treeselectByUser(option);
     this.getAppExitLine();
+    this.getAppOutfire();
     getApp().watch(this.getMqttLineData,'lineData');
    
     //判断入口(执行疏散)
@@ -277,8 +279,7 @@ export default {
   onShow(){
   },
   onUnload(){
-	  //销毁定时器
-	  clearInterval(this.timer)
+	
   },
   methods: {
     //根据账户信息查询学院楼栋数据
@@ -516,6 +517,10 @@ export default {
       let list = [{type:"lab/exit/line"}];
       getApp().appMqttOn(1,list);
     },
+	getAppOutfire(){
+	  let list = [{type:"lab/fireDevice/Warn/"}];
+	  getApp().appMqttOn(1,list);
+	},
     shadeTypeClick(){
       this.broadcastType = !this.broadcastType
     },