|
@@ -330,9 +330,9 @@
|
|
|
evacuationTopic: "lab/newexit/line", //疏散
|
|
|
//灭火设备MQTT相关
|
|
|
fireClient:{},
|
|
|
- fireTopic:"lab/fireDevice/Warn",//传感器状态异常
|
|
|
- fireOnlineTopic:"lab/fireDevice/isOnline",//设备是否在线
|
|
|
- firePerformTopic:"lab/fireDevice/executing",//是否正在执行灭火操作
|
|
|
+ fireTopic:"lab/fireDevice/Warn/",//传感器状态异常
|
|
|
+ fireOnlineTopic:"lab/fireDevice/isOnline/",//设备是否在线
|
|
|
+ firePerformTopic:"lab/fireDevice/executing/",//是否正在执行灭火操作
|
|
|
|
|
|
|
|
|
fireType:false,//有无火焰设备状态
|
|
@@ -382,7 +382,6 @@
|
|
|
if(data.data.temperature && data.data.smoke){
|
|
|
if(!this.fireStartType){
|
|
|
this.$set(this,'fireStartType',true);
|
|
|
- this.$set(this,'fireListType',false);
|
|
|
this.sendCode2(data.data.timeDifference);
|
|
|
}
|
|
|
}
|
|
@@ -426,9 +425,9 @@
|
|
|
const {data} = await firedeviceCancel(_this.itemData.subjectId)
|
|
|
if (data.code == 200) {
|
|
|
wx.showToast({
|
|
|
- title: '放弃一键灭火失败!',
|
|
|
+ title: '放弃一键灭火!',
|
|
|
icon: "none",
|
|
|
- duration: 6000
|
|
|
+ duration: 2000
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -442,11 +441,10 @@
|
|
|
confirmColor: "#0183FA",
|
|
|
success: function(res) {
|
|
|
if (res.confirm) {
|
|
|
- console.log('用户点击确定');
|
|
|
_this.firedeviceStart(); //启动灭火设备
|
|
|
|
|
|
} else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -485,19 +483,21 @@
|
|
|
clearInterval(this.timer2);
|
|
|
this.timer2 = null;
|
|
|
this.dialogVisible = false;
|
|
|
- this.countdown = 6;
|
|
|
|
|
|
},
|
|
|
//进行中倒计时
|
|
|
sendCode2(time) {
|
|
|
let _this = this;
|
|
|
- _this.$set(self,'conductCountdown',time);
|
|
|
+ _this.conductCountdown=time
|
|
|
_this.loading2(); //启动定时器
|
|
|
_this.timer3 = setInterval(() => {
|
|
|
//创建定时器
|
|
|
if (_this.conductCountdown === 1) {
|
|
|
_this.clearTimer2(); //关闭定时器
|
|
|
_this.outfireEnd = true; //灭火倒计时结束
|
|
|
+ _this.fireStartType = false; //灭火状态
|
|
|
+
|
|
|
+ console.log()
|
|
|
} else {
|
|
|
_this.loading2();
|
|
|
}
|
|
@@ -1193,6 +1193,7 @@
|
|
|
// 收到消息
|
|
|
this.floorClient.on('message', (topic, message) => {
|
|
|
let data = JSON.parse(message)
|
|
|
+ console.log(data)
|
|
|
if (data) {
|
|
|
if (topic == (this.evacuationTopic + this.floorId)) {
|
|
|
console.log('疏散通知', data)
|
|
@@ -1218,11 +1219,12 @@
|
|
|
//设备在线状态
|
|
|
console.log('设备在线状态');
|
|
|
}else if(topic == (self.firePerformTopic + self.fireCode)){
|
|
|
+ console.log('灭火中')
|
|
|
//灭火执行操作
|
|
|
if(data.fireStatus == 1){
|
|
|
if(!self.fireStartType){
|
|
|
self.$set(self,'fireStartType',true);
|
|
|
- self.$set(self,'fireStartText','灭火中');
|
|
|
+ self.$set(self,'fireListType',false);
|
|
|
self.sendCode2(data.direTime);
|
|
|
}else if(data.fireStatus == 0){
|
|
|
self.msgError('一键灭火启动失败')
|