|
@@ -392,6 +392,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import mqtt from 'mqtt'
|
|
|
+ import { controlsRestrictVerify} from '@/utils/index'
|
|
|
import { laboratoryBigViewGetBuildByBigView, laboratoryBigViewGetFloorByBigView,
|
|
|
laboratoryExitLineGetRedisEvacuation,laboratoryExitLineExecuteEvacuation,
|
|
|
laboratoryExitLineEndEvacuation,laboratoryBigViewOnLineUserList,
|
|
@@ -560,18 +561,18 @@
|
|
|
this.iotBigViewDeviceFindByType();
|
|
|
//查询实验室危险源
|
|
|
this.laboratoryBigViewHazardCensus();
|
|
|
- //MQTT相关
|
|
|
- this.offHardwareMQTT('on')
|
|
|
- this.offSensorMQTT('on')
|
|
|
- this.offLightMQTT('on')
|
|
|
- //判断是否已有链接
|
|
|
- if(!this.evacuateClient.unsubscribe){
|
|
|
- this.offEvacuateMQTT('on');
|
|
|
- }
|
|
|
- //判断是否已有链接
|
|
|
- if(!this.planClient.unsubscribe){
|
|
|
- this.offPlanMQTT('on');
|
|
|
- }
|
|
|
+ }
|
|
|
+ //MQTT相关
|
|
|
+ this.offHardwareMQTT('on')
|
|
|
+ this.offSensorMQTT('on')
|
|
|
+ this.offLightMQTT('on')
|
|
|
+ //判断是否已有链接
|
|
|
+ if(!this.evacuateClient.unsubscribe){
|
|
|
+ this.offEvacuateMQTT('on');
|
|
|
+ }
|
|
|
+ //判断是否已有链接
|
|
|
+ if(!this.planClient.unsubscribe){
|
|
|
+ this.offPlanMQTT('on');
|
|
|
}
|
|
|
},
|
|
|
//楼栋选中方法
|
|
@@ -663,6 +664,22 @@
|
|
|
this.$set(this.mapData,'width',obj.maxWidth);
|
|
|
this.$set(this.mapData,'height',obj.maxHeight);
|
|
|
this.$set(this.mapData,'zoomData',obj.zoomData);
|
|
|
+ //标记第一间实验室
|
|
|
+ let subNum = 0;
|
|
|
+ for(let x=0;x<list.length;x++){
|
|
|
+ if(list[x].subId != -1 &&list[x].type == 1){
|
|
|
+ subNum++
|
|
|
+ this.$set(this,'subName',list[x].subName);
|
|
|
+ this.$set(this,'roomNum',list[x].roomNum);
|
|
|
+ this.$set(this,'checkSubId',list[x].subId);
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(subNum == 0){
|
|
|
+ this.$set(this,'subName','');
|
|
|
+ this.$set(this,'roomNum','');
|
|
|
+ this.$set(this,'checkSubId','');
|
|
|
+ }
|
|
|
this.$set(this,'mapList',JSON.parse(JSON.stringify(list)));
|
|
|
this.$set(this,'shadeMapList',JSON.parse(JSON.stringify(list)));
|
|
|
this.$set(this,'mapType',true);
|
|
@@ -708,10 +725,16 @@
|
|
|
this.$set(this,'mapType',false);
|
|
|
this.$set(this,'planMapList',[]);
|
|
|
}
|
|
|
- //获取报警数据
|
|
|
- this.laboratoryBigViewSelectTriggerInfo();
|
|
|
- //获取疏散数据
|
|
|
- this.laboratoryExitLineGetRedisEvacuation();
|
|
|
+
|
|
|
+
|
|
|
+ // 等待配置与字段获取到后跳转
|
|
|
+ Promise.all([
|
|
|
+ //获取路由判断权限
|
|
|
+ this.laboratoryBigViewSelectTriggerInfo(),
|
|
|
+ this.laboratoryExitLineGetRedisEvacuation(),
|
|
|
+ ]).then((result)=>{
|
|
|
+ this.buttonSubject();
|
|
|
+ }).catch((error) => {})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -789,23 +812,6 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(num == 0){
|
|
|
- let checkNum = 0;
|
|
|
- for(let x=0;x<self.mapList.length;x++){
|
|
|
- if(self.mapList[x].subId != -1 &&self.mapList[x].type == 1){
|
|
|
- this.$set(this,'subName',self.mapList[x].subName);
|
|
|
- this.$set(this,'roomNum',self.mapList[x].roomNum);
|
|
|
- this.$set(this,'checkSubId',self.mapList[x].subId);
|
|
|
- checkNum++
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (checkNum == 0){
|
|
|
- this.$set(this,'subName','');
|
|
|
- this.$set(this,'roomNum','');
|
|
|
- this.$set(this,'checkSubId',null);
|
|
|
- }
|
|
|
- }
|
|
|
//浮层实验室预案标记
|
|
|
for(let o=0;o<self.shadeMapList.length;o++){
|
|
|
if(self.shadeMapList[o].type == 1){
|
|
@@ -827,7 +833,7 @@
|
|
|
})
|
|
|
})
|
|
|
this.$set(this,'planSensorList',planSensorList);
|
|
|
- this.buttonSubject();
|
|
|
+
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
},
|
|
@@ -839,7 +845,6 @@
|
|
|
floorId:this.floorId,
|
|
|
}
|
|
|
laboratoryExitLineGetRedisEvacuation(obj).then(response => {
|
|
|
- console.log('response.data',response.data);
|
|
|
if(response.data.doorPointNames){
|
|
|
this.$set(this,'evacuationType',true);
|
|
|
for(let o=0;o<self.mapList.length;o++){
|
|
@@ -856,19 +861,28 @@
|
|
|
self.mapList[o].lightList[x].openType = num != 0;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- for(let i=0;i<response.data.doorPointNames.length;i++){
|
|
|
- for(let o=0;o<self.mapList.length;o++){
|
|
|
- if(self.mapList[o].type == 3){
|
|
|
+ if(self.mapList[o].type == 3){
|
|
|
+ let age = 0;
|
|
|
+ for(let i=0;i<response.data.doorPointNames.length;i++){
|
|
|
if(response.data.doorPointNames[i] == self.mapList[o].key){
|
|
|
- self.mapList[o].roomCheckType = true;
|
|
|
+ age++
|
|
|
}
|
|
|
}
|
|
|
+ self.mapList[o].roomCheckType = age != 0;
|
|
|
}
|
|
|
}
|
|
|
- this.$forceUpdate();
|
|
|
}else{
|
|
|
this.$set(this,'evacuationType',false);
|
|
|
+ for(let o=0;o<self.mapList.length;o++){
|
|
|
+ if(self.mapList[o].type == 2){
|
|
|
+ for(let x=0;x<self.mapList[o].lightList.length;x++){
|
|
|
+ self.mapList[o].lightList[x].openType = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(self.mapList[o].type == 3){
|
|
|
+ self.mapList[o].roomCheckType = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -924,7 +938,7 @@
|
|
|
},
|
|
|
//查询实验室硬件
|
|
|
iotBigViewHardwareFindByType(){
|
|
|
- iotBigViewHardwareFindByType({subId:this.checkSubId}).then(response => {
|
|
|
+ iotBigViewHardwareFindByType({subjectId:this.checkSubId}).then(response => {
|
|
|
this.$set(this,'controlsList',response.data);
|
|
|
})
|
|
|
},
|
|
@@ -1022,6 +1036,10 @@
|
|
|
},
|
|
|
//喇叭播放文字
|
|
|
iotBigViewSpeakerPlayText(){
|
|
|
+ if(!controlsRestrictVerify('performEvacuation')){
|
|
|
+ this.msgError('没有相关操作权限,请联系管理员')
|
|
|
+ return
|
|
|
+ }
|
|
|
if(!this.loudspeakerInput){
|
|
|
this.msgError('请输入内容')
|
|
|
return
|
|
@@ -1254,6 +1272,10 @@
|
|
|
//开始/结束疏散按钮
|
|
|
evacuationButton(){
|
|
|
let self = this;
|
|
|
+ if(!controlsRestrictVerify('performEvacuation')){
|
|
|
+ this.msgError('没有相关操作权限,请联系管理员')
|
|
|
+ return
|
|
|
+ }
|
|
|
if(this.evacuationType){
|
|
|
//结束疏散
|
|
|
this.$set(this,'shadeText','是否结束疏散?');
|
|
@@ -1337,6 +1359,10 @@
|
|
|
},
|
|
|
//遮罩层开关/弹层提示确认
|
|
|
shadeButton(type,text){
|
|
|
+ if(!controlsRestrictVerify('performEvacuation')){
|
|
|
+ this.msgError('没有相关操作权限,请联系管理员')
|
|
|
+ return
|
|
|
+ }
|
|
|
if(type == 1){
|
|
|
this.$set(this,'shadeType',1);
|
|
|
}else if(type == 2){
|
|
@@ -1377,7 +1403,7 @@
|
|
|
}
|
|
|
laboratoryExitLineEndEvacuation(obj).then(response => {
|
|
|
this.$set(this,'shadeType',0);
|
|
|
- this.laboratoryBigViewGetFloorByBigView();
|
|
|
+ this.laboratoryExitLineGetRedisEvacuation();
|
|
|
})
|
|
|
}else if(this.shadeType == 5){
|
|
|
//结束预案
|
|
@@ -1461,7 +1487,7 @@
|
|
|
this.hardwareClient.on("connect", e =>{
|
|
|
this.hardwareClient.subscribe(self.hardwareOpic+self.checkSubId, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("智能控制-订阅成功:" + self.hardwareOpic+self.checkSubId);
|
|
|
+ // console.log("智能控制-订阅成功:" + self.hardwareOpic+self.checkSubId);
|
|
|
}else{
|
|
|
// console.log("智能控制-连接错误:" + err);
|
|
|
}
|
|
@@ -1507,7 +1533,7 @@
|
|
|
this.sensorClient.on("connect", e =>{
|
|
|
this.sensorClient.subscribe(self.sensorOpic+self.checkSubId, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("智能监测-订阅成功:" + self.sensorOpic+self.checkSubId);
|
|
|
+ // console.log("智能监测-订阅成功:" + self.sensorOpic+self.checkSubId);
|
|
|
}else{
|
|
|
// console.log("智能监测-连接错误:" + err);
|
|
|
}
|
|
@@ -1556,7 +1582,7 @@
|
|
|
this.evacuateClient.on("connect", e =>{
|
|
|
this.evacuateClient.subscribe(self.evacuateOpic, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("疏散-订阅成功:" + self.evacuateOpic);
|
|
|
+ // console.log("疏散-订阅成功:" + self.evacuateOpic);
|
|
|
}else{
|
|
|
// console.log("疏散-连接错误:" + err);
|
|
|
}
|
|
@@ -1564,8 +1590,8 @@
|
|
|
});
|
|
|
this.evacuateClient.on("message", (topic, message) => {
|
|
|
if (message){
|
|
|
- //获取当前楼层数据
|
|
|
- this.laboratoryBigViewGetFloorByBigView();
|
|
|
+ //获取疏散数据
|
|
|
+ this.laboratoryExitLineGetRedisEvacuation();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1596,7 +1622,7 @@
|
|
|
this.lightClient.on("connect", e =>{
|
|
|
this.lightClient.subscribe(self.lightOpic+self.floorId, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("疏散灯-订阅成功:" + self.lightOpic+self.floorId);
|
|
|
+ // console.log("疏散灯-订阅成功:" + self.lightOpic+self.floorId);
|
|
|
}else{
|
|
|
// console.log("疏散灯-连接错误:" + err);
|
|
|
}
|
|
@@ -1644,7 +1670,7 @@
|
|
|
this.planClient.on("connect", e =>{
|
|
|
this.planClient.subscribe(self.planOpic, (err) => {
|
|
|
if (!err) {
|
|
|
- console.log("预案-订阅成功:" + self.evacuateOpic);
|
|
|
+ // console.log("预案-订阅成功:" + self.planOpic);
|
|
|
}else{
|
|
|
// console.log("预案-连接错误:" + err);
|
|
|
}
|
|
@@ -1652,8 +1678,8 @@
|
|
|
});
|
|
|
this.planClient.on("message", (topic, message) => {
|
|
|
if (message){
|
|
|
- //获取当前楼层数据
|
|
|
- this.laboratoryBigViewGetFloorByBigView();
|
|
|
+ //获取预案数据
|
|
|
+ this.laboratoryBigViewSelectTriggerInfo();
|
|
|
}
|
|
|
});
|
|
|
},
|