|
@@ -134,7 +134,7 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<view v-if="fireListType"
|
|
|
- :class="!fireListType?'outfire_yes_btn':'outfire_no_btn'" @click="outfireFun()">一键灭火
|
|
|
+ :class="fireListType?'outfire_yes_btn':'outfire_no_btn'" @click="outfireFun()">一键灭火
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 视频部分 -->
|
|
@@ -337,7 +337,7 @@
|
|
|
|
|
|
fireType:false,//有无火焰设备状态
|
|
|
fireListType:false,//灭火设备在线离线
|
|
|
- fireCode:'',// //灭火设备code
|
|
|
+ fireCode:null,// //灭火设备code
|
|
|
fireStartType:false, //灭火启动状态
|
|
|
outfireData: {}, //一键灭火
|
|
|
}
|
|
@@ -345,8 +345,9 @@
|
|
|
onLoad(option) {
|
|
|
this.treeselectByUser();
|
|
|
//一键灭火正式使用需要注销
|
|
|
- this.itemData.subjectId=85
|
|
|
- this.firedeviceStatus();
|
|
|
+ // this.itemData.subjectId=85
|
|
|
+ // this.firedeviceStatus();
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
@@ -382,6 +383,7 @@
|
|
|
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);
|
|
|
}
|
|
|
}
|
|
@@ -394,6 +396,7 @@
|
|
|
this.$set(this,'fireType',false);
|
|
|
this.offMQTT('on');
|
|
|
}
|
|
|
+ this.offMQTT('on');
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -869,7 +872,8 @@
|
|
|
this.$set(this,'pageType',2);
|
|
|
this.getDeviceList();
|
|
|
this.laboratoryInfo();
|
|
|
- this.offMQTT('on');
|
|
|
+ this.firedeviceStatus();
|
|
|
+
|
|
|
},
|
|
|
//执行疏散
|
|
|
async lineEvacuate() {
|
|
@@ -1149,27 +1153,27 @@
|
|
|
password: uni.getStorageSync('mqttUrl'),
|
|
|
}
|
|
|
const connectUrl = uni.getStorageSync('mqttUrl');
|
|
|
- this.floorClient = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
|
|
|
- this.floorClient.on('connect', () => {
|
|
|
- this.floorClient.subscribe(this.evacuationTopic + this.floorId, (err) => {
|
|
|
+ self.floorClient = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
|
|
|
+ self.floorClient.on('connect', () => {
|
|
|
+ self.floorClient.subscribe(self.evacuationTopic + self.floorId, (err) => {
|
|
|
if (!err) {
|
|
|
console.log("疏散-订阅成功", )
|
|
|
- this.getBuildingData();
|
|
|
+ self.getBuildingData();
|
|
|
}
|
|
|
});
|
|
|
- this.floorClient.subscribe(this.fireTopic+this.fireCode, (err) => {
|
|
|
+ self.floorClient.subscribe(self.fireTopic+self.fireCode, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("火灾传感器状态-订阅成功:" + this.fireTopic+this.fireCode);
|
|
|
+ console.log("火灾传感器状态-订阅成功:" + self.fireTopic+self.fireCode);
|
|
|
}
|
|
|
});
|
|
|
- this.floorClient.subscribe(this.fireOnlineTopic+this.fireCode, (err) => {
|
|
|
+ self.floorClient.subscribe(self.fireOnlineTopic+self.fireCode, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("火灾设备是否在线-订阅成功:" + this.fireOnlineTopic+this.fireCode);
|
|
|
+ console.log("火灾设备是否在线-订阅成功:" + self.fireOnlineTopic+self.fireCode);
|
|
|
}
|
|
|
});
|
|
|
- this.floorClient.subscribe(this.firePerformTopic+this.fireCode, (err) => {
|
|
|
+ self.floorClient.subscribe(self.firePerformTopic+self.fireCode, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("火灾是否正在执行灭火操作-订阅成功:" + this.firePerformTopic+this.fireCode);
|
|
|
+ console.log("火灾是否正在执行灭火操作-订阅成功:" + self.firePerformTopic+self.fireCode);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -1222,7 +1226,7 @@
|
|
|
if(!self.fireStartType){
|
|
|
self.$set(self,'fireStartType',true);
|
|
|
self.$set(self,'fireStartText','灭火中');
|
|
|
- self.fireStartTimeFunction(data.direTime);
|
|
|
+ self.sendCode2(data.direTime);
|
|
|
}else if(data.fireStatus == 0){
|
|
|
self.msgError('一键灭火启动失败')
|
|
|
}
|
|
@@ -1244,21 +1248,23 @@
|
|
|
console.log('疏散连接-关闭错误', error)
|
|
|
}
|
|
|
});
|
|
|
- this.floorClient.unsubscribe(self.fireTopic+self.fireCode, error => {
|
|
|
- if (error) {
|
|
|
- console.log('火灾传感器状态-MQTT断开报错=>', error)
|
|
|
- }
|
|
|
- })
|
|
|
- this.floorClient.unsubscribe(self.fireOnlineTopic+self.fireCode, error => {
|
|
|
- if (error) {
|
|
|
- console.log('火灾设备是否在线-MQTT断开报错=>', error)
|
|
|
- }
|
|
|
- })
|
|
|
- this.floorClient.unsubscribe(self.firePerformTopic+self.fireCode, error => {
|
|
|
- if (error) {
|
|
|
- console.log('火灾是否正在执行灭火操作-MQTT断开报错=>', error)
|
|
|
- }
|
|
|
- })
|
|
|
+ if(self.fireCode){
|
|
|
+ this.floorClient.unsubscribe(self.fireTopic+self.fireCode, error => {
|
|
|
+ if (error) {
|
|
|
+ console.log('火灾传感器状态-MQTT断开报错=>', error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.floorClient.unsubscribe(self.fireOnlineTopic+self.fireCode, error => {
|
|
|
+ if (error) {
|
|
|
+ console.log('火灾设备是否在线-MQTT断开报错=>', error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.floorClient.unsubscribe(self.firePerformTopic+self.fireCode, error => {
|
|
|
+ if (error) {
|
|
|
+ console.log('火灾是否正在执行灭火操作-MQTT断开报错=>', error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.floorClient.end(true);
|
|
|
this.$set(this, 'floorClient', {});
|
|
|
}
|