|
@@ -65,11 +65,11 @@
|
|
<div id="container" ref="container" @mousedown="getMouseXY($event)">
|
|
<div id="container" ref="container" @mousedown="getMouseXY($event)">
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <div class="position-floor-user-box">
|
|
|
|
- <img src="@/assets/ZDimages/bigData3_2/icon_zhpt_rs.png">
|
|
|
|
- <p>实时人数:</p>
|
|
|
|
- <p>{{userNum}}人</p>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!--<div class="position-floor-user-box">-->
|
|
|
|
+ <!--<img src="@/assets/ZDimages/bigData3_2/icon_zhpt_rs.png">-->
|
|
|
|
+ <!--<p>实时人数:</p>-->
|
|
|
|
+ <!--<p>{{userNum}}人</p>-->
|
|
|
|
+ <!--</div>-->
|
|
<div class="position-floor-button-box" v-if="mapList[0]">
|
|
<div class="position-floor-button-box" v-if="mapList[0]">
|
|
<p class="position-floor-for-button-p" :class="item.checkType?'check-button-box':''"
|
|
<p class="position-floor-for-button-p" :class="item.checkType?'check-button-box':''"
|
|
@click="dataDispose(item.index)"
|
|
@click="dataDispose(item.index)"
|
|
@@ -108,6 +108,7 @@
|
|
import { SceneUtils } from 'three/examples/jsm/utils/SceneUtils.js'
|
|
import { SceneUtils } from 'three/examples/jsm/utils/SceneUtils.js'
|
|
import newEvacuationBigDataSubPageKYDXNH from './differenceComponent/newEvacuationBigDataSubPageKYDXNH.vue'
|
|
import newEvacuationBigDataSubPageKYDXNH from './differenceComponent/newEvacuationBigDataSubPageKYDXNH.vue'
|
|
import newEvacuationBigDataSubPagePublic from './differenceComponent/newEvacuationBigDataSubPagePublic.vue'
|
|
import newEvacuationBigDataSubPagePublic from './differenceComponent/newEvacuationBigDataSubPagePublic.vue'
|
|
|
|
+ import { airbottleBluetoothGetBeaconNotice } from "@/api/gasBottleManage/index";
|
|
export default {
|
|
export default {
|
|
name: 'newEvacuationBigDataHome',
|
|
name: 'newEvacuationBigDataHome',
|
|
components: {
|
|
components: {
|
|
@@ -122,7 +123,7 @@
|
|
watch:{
|
|
watch:{
|
|
Obj(newVal,oldVal){
|
|
Obj(newVal,oldVal){
|
|
//可以对数据执行相应的操作
|
|
//可以对数据执行相应的操作
|
|
- console.log(newVal,oldVal)
|
|
|
|
|
|
+ // console.log(newVal,oldVal)
|
|
this.selectTriggerInfo();
|
|
this.selectTriggerInfo();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -192,6 +193,9 @@
|
|
//楼栋MQTT相关
|
|
//楼栋MQTT相关
|
|
buildingClient:{},
|
|
buildingClient:{},
|
|
userTopic:"lab/horn",//消息
|
|
userTopic:"lab/horn",//消息
|
|
|
|
+ //气瓶MQTT相关
|
|
|
|
+ gasBottleClient:{},
|
|
|
|
+ gasBottleTopic:"air/blueTooth/gateway",//预案
|
|
//摄像头数据
|
|
//摄像头数据
|
|
monitorNumList:[],
|
|
monitorNumList:[],
|
|
monitorType:null,
|
|
monitorType:null,
|
|
@@ -685,6 +689,8 @@
|
|
this.getLotStatis();
|
|
this.getLotStatis();
|
|
//楼栋MQTT
|
|
//楼栋MQTT
|
|
this.offBuildingMQTT('on');
|
|
this.offBuildingMQTT('on');
|
|
|
|
+ //气瓶MQTT
|
|
|
|
+ this.offGasBottleMQTT('on');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -701,6 +707,8 @@
|
|
this.getLotStatis();
|
|
this.getLotStatis();
|
|
//楼栋MQTT
|
|
//楼栋MQTT
|
|
this.offBuildingMQTT('on');
|
|
this.offBuildingMQTT('on');
|
|
|
|
+ //气瓶MQTT
|
|
|
|
+ this.offGasBottleMQTT('on');
|
|
},
|
|
},
|
|
//获取楼栋人数
|
|
//获取楼栋人数
|
|
getBuildOrFloorInfo(){
|
|
getBuildOrFloorInfo(){
|
|
@@ -1039,59 +1047,65 @@
|
|
//查询预案发生
|
|
//查询预案发生
|
|
selectTriggerInfo(){
|
|
selectTriggerInfo(){
|
|
let self = this;
|
|
let self = this;
|
|
- selectTriggerInfo().then(response => {
|
|
|
|
- if(response.data[0]){
|
|
|
|
- for(let i=0;i<response.data.length;i++){
|
|
|
|
- for(let o=0;o<self.mapList.length;o++){
|
|
|
|
- for(let x=0;x<self.mapList[o].relationalData.length;x++){
|
|
|
|
- if (self.mapList[o].relationalData[x].type == '1' && self.mapList[o].relationalData[x].roomType!='-99'){
|
|
|
|
- if(response.data[i].subId == self.mapList[o].relationalData[x].subId){
|
|
|
|
- self.mapList[o].relationalData[x].planType = true;
|
|
|
|
- //判断预案是否进入过
|
|
|
|
- for(let s=0;s<response.data.length;s++){
|
|
|
|
- if(response.data[s].riskAttribute != '1'&&response.data[s].ifCheck != '1'){
|
|
|
|
- setTimeout(function (){
|
|
|
|
- if(self.$route.query.buildId){
|
|
|
|
- delete self.$route.query.buildId;
|
|
|
|
- }
|
|
|
|
- if(self.$route.query.subId){
|
|
|
|
- delete self.$route.query.subId;
|
|
|
|
- }
|
|
|
|
- if(self.$route.query.floorId){
|
|
|
|
- delete self.$route.query.floorId;
|
|
|
|
- }
|
|
|
|
- if(self.$route.query.groupId){
|
|
|
|
- delete self.$route.query.groupId;
|
|
|
|
- }
|
|
|
|
- let obj = {
|
|
|
|
- buildId:response.data[s].buildId,
|
|
|
|
- floorId:response.data[s].floorId,
|
|
|
|
- subId:response.data[s].subId,
|
|
|
|
- groupId:response.data[s].groupId,
|
|
|
|
- planType:true
|
|
|
|
- }
|
|
|
|
- self.$parent.goPage(2,obj);
|
|
|
|
- },5000)
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
|
|
+ let newList = [];
|
|
|
|
+ selectTriggerInfo().then(responseOne => {
|
|
|
|
+ newList = newList.concat(responseOne.data);
|
|
|
|
+ airbottleBluetoothGetBeaconNotice().then(responseTow => {
|
|
|
|
+ newList = newList.concat(responseTow.data);
|
|
|
|
+ //********************处理数据********************
|
|
|
|
+ if(newList[0]){
|
|
|
|
+ for(let i=0;i<newList.length;i++){
|
|
|
|
+ for(let o=0;o<self.mapList.length;o++){
|
|
|
|
+ for(let x=0;x<self.mapList[o].relationalData.length;x++){
|
|
|
|
+ if (self.mapList[o].relationalData[x].type == '1' && self.mapList[o].relationalData[x].roomType!='-99'){
|
|
|
|
+ if(newList[i].subId == self.mapList[o].relationalData[x].subId){
|
|
|
|
+ self.mapList[o].relationalData[x].planType = true;
|
|
|
|
+ //判断预案是否进入过
|
|
|
|
+ // for(let s=0;s<newList.length;s++){
|
|
|
|
+ // if(newList[s].riskAttribute != '1'&&newList[s].ifCheck != '1'){
|
|
|
|
+ // setTimeout(function (){
|
|
|
|
+ // if(self.$route.query.buildId){
|
|
|
|
+ // delete self.$route.query.buildId;
|
|
|
|
+ // }
|
|
|
|
+ // if(self.$route.query.subId){
|
|
|
|
+ // delete self.$route.query.subId;
|
|
|
|
+ // }
|
|
|
|
+ // if(self.$route.query.floorId){
|
|
|
|
+ // delete self.$route.query.floorId;
|
|
|
|
+ // }
|
|
|
|
+ // if(self.$route.query.groupId){
|
|
|
|
+ // delete self.$route.query.groupId;
|
|
|
|
+ // }
|
|
|
|
+ // let obj = {
|
|
|
|
+ // buildId:newList[s].buildId,
|
|
|
|
+ // floorId:newList[s].floorId,
|
|
|
|
+ // subId:newList[s].subId,
|
|
|
|
+ // groupId:newList[s].groupId,
|
|
|
|
+ // planType:true
|
|
|
|
+ // }
|
|
|
|
+ // self.$parent.goPage(2,obj);
|
|
|
|
+ // },5000)
|
|
|
|
+ // break
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ }else{
|
|
|
|
+ self.mapList[o].relationalData[x].planType = false;
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- self.mapList[o].relationalData[x].planType = false;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- for(let o=0;o<self.mapList.length;o++){
|
|
|
|
- for(let x=0;x<self.mapList[o].relationalData.length;x++){
|
|
|
|
- if (self.mapList[o].relationalData[x].type == '1' && self.mapList[o].relationalData[x].roomType!='-99'){
|
|
|
|
- self.mapList[o].relationalData[x].planType = false;
|
|
|
|
|
|
+ }else{
|
|
|
|
+ for(let o=0;o<self.mapList.length;o++){
|
|
|
|
+ for(let x=0;x<self.mapList[o].relationalData.length;x++){
|
|
|
|
+ if (self.mapList[o].relationalData[x].type == '1' && self.mapList[o].relationalData[x].roomType!='-99'){
|
|
|
|
+ self.mapList[o].relationalData[x].planType = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- this.initAdd();
|
|
|
|
|
|
+ this.initAdd();
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//全局-MQTT订阅
|
|
//全局-MQTT订阅
|
|
@@ -1102,10 +1116,10 @@
|
|
password: localStorage.getItem('mqttPassword')
|
|
password: localStorage.getItem('mqttPassword')
|
|
});
|
|
});
|
|
this.allClient.on("connect", e =>{
|
|
this.allClient.on("connect", e =>{
|
|
- console.log("连接成功");
|
|
|
|
|
|
+ // console.log("连接成功");
|
|
this.allClient.subscribe(self.planTopic, (err) => {
|
|
this.allClient.subscribe(self.planTopic, (err) => {
|
|
if (!err) {
|
|
if (!err) {
|
|
- console.log("预案-订阅成功:" + self.planTopic);
|
|
|
|
|
|
+ // console.log("预案-订阅成功:" + self.planTopic);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -1113,10 +1127,10 @@
|
|
if (message){
|
|
if (message){
|
|
let data = JSON.parse(message)
|
|
let data = JSON.parse(message)
|
|
if(data){
|
|
if(data){
|
|
- console.log('data',data);
|
|
|
|
|
|
+ // console.log('data',data);
|
|
if(topic == self.planTopic){
|
|
if(topic == self.planTopic){
|
|
//传感器状态
|
|
//传感器状态
|
|
- console.log('预案-状态');
|
|
|
|
|
|
+ // console.log('预案-状态');
|
|
self.selectTriggerInfo();
|
|
self.selectTriggerInfo();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1132,16 +1146,16 @@
|
|
});
|
|
});
|
|
this.buildingClient.subscribe(self.userTopic+self.buildingId, (err) => {
|
|
this.buildingClient.subscribe(self.userTopic+self.buildingId, (err) => {
|
|
if (!err) {
|
|
if (!err) {
|
|
- console.log("实验室人数-订阅成功:" + self.userTopic+self.buildingId);
|
|
|
|
|
|
+ // console.log("实验室人数-订阅成功:" + self.userTopic+self.buildingId);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.buildingClient.on("message", (topic, message) => {
|
|
this.buildingClient.on("message", (topic, message) => {
|
|
if (message){
|
|
if (message){
|
|
let data = JSON.parse(message)
|
|
let data = JSON.parse(message)
|
|
if(data){
|
|
if(data){
|
|
- console.log('data',data);
|
|
|
|
|
|
+ // console.log('data',data);
|
|
if(topic == (self.userTopic+self.buildingId)){
|
|
if(topic == (self.userTopic+self.buildingId)){
|
|
- console.log('实验室人数-状态');
|
|
|
|
|
|
+ // console.log('实验室人数-状态');
|
|
//实验室人数
|
|
//实验室人数
|
|
self.getBuildOrFloorInfo();
|
|
self.getBuildOrFloorInfo();
|
|
}
|
|
}
|
|
@@ -1149,9 +1163,39 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //气瓶-MQTT订阅
|
|
|
|
+ onGasBottleMQTT(){
|
|
|
|
+ let self = this;
|
|
|
|
+ this.gasBottleClient = mqtt.connect(localStorage.getItem('mqttUrl'), {
|
|
|
|
+ username: localStorage.getItem('mqttUser'),
|
|
|
|
+ password: localStorage.getItem('mqttPassword')
|
|
|
|
+ });
|
|
|
|
+ this.gasBottleClient.on("connect", e =>{
|
|
|
|
+ // console.log("气瓶-连接成功");
|
|
|
|
+ this.gasBottleClient.subscribe(self.gasBottleTopic, (err) => {
|
|
|
|
+ if (!err) {
|
|
|
|
+ // console.log("气瓶-订阅成功:" + self.gasBottleTopic);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.gasBottleClient.on("message", (topic, message) => {
|
|
|
|
+ if (message){
|
|
|
|
+ let data = JSON.parse(message)
|
|
|
|
+ if(data){
|
|
|
|
+ // console.log('data',data);
|
|
|
|
+ if(topic == (self.gasBottleTopic)){
|
|
|
|
+ //气瓶-预案触发
|
|
|
|
+ // console.log('气瓶-预案触发');
|
|
|
|
+ // this.$set(this,'sensorList',this.sensorIconMatching(data.data.functionStatuses));
|
|
|
|
+ this.selectTriggerInfo();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//取消订阅-全局-关闭MQTT连接
|
|
//取消订阅-全局-关闭MQTT连接
|
|
offAllMQTT(type){
|
|
offAllMQTT(type){
|
|
- console.log('type',type)
|
|
|
|
|
|
+ // console.log('type',type)
|
|
let self = this;
|
|
let self = this;
|
|
//判断是否已有连接如果有责断开
|
|
//判断是否已有连接如果有责断开
|
|
if(this.allClient.unsubscribe){
|
|
if(this.allClient.unsubscribe){
|
|
@@ -1186,6 +1230,25 @@
|
|
this.onBuildingMQTT();
|
|
this.onBuildingMQTT();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //取消订阅气瓶-MQTT连接
|
|
|
|
+ offGasBottleMQTT(type){
|
|
|
|
+ let self = this;
|
|
|
|
+ //判断是否已有连接如果有责断开
|
|
|
|
+ if(this.gasBottleClient.unsubscribe){
|
|
|
|
+ this.gasBottleClient.unsubscribe(self.gasBottleTopic, error => {
|
|
|
|
+ if (error) {
|
|
|
|
+ console.log('气瓶-MQTT断开报错=>', error)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.gasBottleClient.end();
|
|
|
|
+ this.$set(this,'gasBottleClient',{});
|
|
|
|
+ }
|
|
|
|
+ //判断传入参数如果存在 发起一次新的连接
|
|
|
|
+ if(type){
|
|
|
|
+ // console.log('===========>')
|
|
|
|
+ this.onGasBottleMQTT();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//跳转
|
|
//跳转
|
|
goRoute(){
|
|
goRoute(){
|
|
if(this.routeType){
|
|
if(this.routeType){
|
|
@@ -1211,6 +1274,7 @@
|
|
self.videoOff();
|
|
self.videoOff();
|
|
// self.offAllMQTT();
|
|
// self.offAllMQTT();
|
|
self.offBuildingMQTT();
|
|
self.offBuildingMQTT();
|
|
|
|
+ self.offGasBottleMQTT();
|
|
cancelAnimationFrame(self.animateData);
|
|
cancelAnimationFrame(self.animateData);
|
|
self.scene.traverse((child) => {
|
|
self.scene.traverse((child) => {
|
|
if (child.material) {
|
|
if (child.material) {
|