|
@@ -12,7 +12,8 @@
|
|
)))" :style="'top:'+item.y+'px;left:'+item.x+'px;width:'+(item.w-4)+'px;height:'+(item.h-4)+'px;'">
|
|
)))" :style="'top:'+item.y+'px;left:'+item.x+'px;width:'+(item.w-4)+'px;height:'+(item.h-4)+'px;'">
|
|
<view class="map-max-for-min-box">
|
|
<view class="map-max-for-min-box">
|
|
<view class="map-for-name-p" :style="'margin-top:'+((item.h/2)-20)+'px;'">
|
|
<view class="map-for-name-p" :style="'margin-top:'+((item.h/2)-20)+'px;'">
|
|
- {{item.roomType == '-99'?item.roomName:item.subName}}</view>
|
|
|
|
|
|
+ {{item.roomType == '-99'?item.roomName:item.subName}}
|
|
|
|
+ </view>
|
|
<view class="map-for-num-p">({{item.roomNum}})</view>
|
|
<view class="map-for-num-p">({{item.roomNum}})</view>
|
|
<view class="position-box" src="@/images/evacuation3_2/icon_sysbjt_m.png"
|
|
<view class="position-box" src="@/images/evacuation3_2/icon_sysbjt_m.png"
|
|
:class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
|
|
:class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
|
|
@@ -35,8 +36,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="map-max-for-box for-map-box-two" v-if="item.type == 3" v-for="(item,index) in mapList"
|
|
<view class="map-max-for-box for-map-box-two" v-if="item.type == 3" v-for="(item,index) in mapList"
|
|
- @click="checkRoom(item)"
|
|
|
|
- :key="index" :class="item.roomCheckType?'for-map-box-two-check':''"
|
|
|
|
|
|
+ @click="checkRoom(item)" :key="index" :class="item.roomCheckType?'for-map-box-two-check':''"
|
|
:style="'top:'+item.y+'px;left:'+item.x+'px;width:'+item.w+'px;height:'+item.h+'px;'">
|
|
:style="'top:'+item.y+'px;left:'+item.x+'px;width:'+item.w+'px;height:'+item.h+'px;'">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -55,6 +55,13 @@
|
|
closeLight,
|
|
closeLight,
|
|
executeEvacuation
|
|
executeEvacuation
|
|
} from '@/api/apiDemo/index.js'
|
|
} from '@/api/apiDemo/index.js'
|
|
|
|
+ import {
|
|
|
|
+ laboratoryBigViewGetFloorByBigView,
|
|
|
|
+ laboratoryExitLineExecuteEvacuation,
|
|
|
|
+ laboratoryExitLineGetRedisEvacuation,
|
|
|
|
+ laboratoryExitRelayOpenLight,
|
|
|
|
+ laboratoryExitRelayCloseLight
|
|
|
|
+ } from '@/api/manage/index.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -63,7 +70,7 @@
|
|
//楼层id
|
|
//楼层id
|
|
floorId: null,
|
|
floorId: null,
|
|
//实验室ID
|
|
//实验室ID
|
|
- subId:null,
|
|
|
|
|
|
+ subId: null,
|
|
//当前选中实验室
|
|
//当前选中实验室
|
|
checkSubId: null,
|
|
checkSubId: null,
|
|
//页面开关
|
|
//页面开关
|
|
@@ -77,22 +84,22 @@
|
|
buildingOptions: {},
|
|
buildingOptions: {},
|
|
//mqtt
|
|
//mqtt
|
|
floorClient: {},
|
|
floorClient: {},
|
|
- evacuationTopic: "lab/newexit/line", //疏散
|
|
|
|
|
|
+ evacuationTopic: "lab/floor/exit/line", //疏散
|
|
//疏散按钮
|
|
//疏散按钮
|
|
- buttonType:false
|
|
|
|
|
|
+ buttonType: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
- if(option.item){
|
|
|
|
|
|
+ if (option.item) {
|
|
let obj = JSON.parse(decodeURIComponent(option.item));
|
|
let obj = JSON.parse(decodeURIComponent(option.item));
|
|
- this.$set(this,'buildingId',obj.buildingId);
|
|
|
|
- this.$set(this,'floorId',obj.floorId);
|
|
|
|
- this.$set(this,'subId',obj.subId);
|
|
|
|
- this.$set(this,'checkSubId',obj.subId);
|
|
|
|
- if(obj.type == 2){
|
|
|
|
- this.$set(this,'buttonType',true);
|
|
|
|
- }else{
|
|
|
|
- this.$set(this,'buttonType',false);
|
|
|
|
|
|
+ this.$set(this, 'buildingId', obj.buildingId);
|
|
|
|
+ this.$set(this, 'floorId', obj.floorId);
|
|
|
|
+ this.$set(this, 'subId', obj.subId);
|
|
|
|
+ this.$set(this, 'checkSubId', obj.subId);
|
|
|
|
+ if (obj.type == 2) {
|
|
|
|
+ this.$set(this, 'buttonType', true);
|
|
|
|
+ } else {
|
|
|
|
+ this.$set(this, 'buttonType', false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -101,7 +108,7 @@
|
|
this.getBuildingData();
|
|
this.getBuildingData();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- mqttPageFunction(type){
|
|
|
|
|
|
+ mqttPageFunction(type) {
|
|
let self = this;
|
|
let self = this;
|
|
if (type == 'FLOOR_EXITLINE') {
|
|
if (type == 'FLOOR_EXITLINE') {
|
|
this.getRedisEvacuation();
|
|
this.getRedisEvacuation();
|
|
@@ -117,27 +124,27 @@
|
|
}, 2000);
|
|
}, 2000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- checkRoom(item){
|
|
|
|
- if(this.buttonType){
|
|
|
|
|
|
+ checkRoom(item) {
|
|
|
|
+ if (this.buttonType) {
|
|
item.roomCheckType = !item.roomCheckType;
|
|
item.roomCheckType = !item.roomCheckType;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//开始疏散
|
|
//开始疏散
|
|
- async executeEvacuation(){
|
|
|
|
|
|
+ async executeEvacuation() {
|
|
let self = this;
|
|
let self = this;
|
|
let list = [];
|
|
let list = [];
|
|
let doorPointNames = [];
|
|
let doorPointNames = [];
|
|
- for(let i=0;i<self.mapList.length;i++){
|
|
|
|
- if(self.mapList[i].type == 3){
|
|
|
|
- if(!self.mapList[i].roomCheckType){
|
|
|
|
|
|
+ for (let i = 0; i < self.mapList.length; i++) {
|
|
|
|
+ if (self.mapList[i].type == 3) {
|
|
|
|
+ if (!self.mapList[i].roomCheckType) {
|
|
list.push(self.mapList[i].key)
|
|
list.push(self.mapList[i].key)
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
doorPointNames.push(self.mapList[i].key)
|
|
doorPointNames.push(self.mapList[i].key)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(!doorPointNames[0]){
|
|
|
|
|
|
+ if (!doorPointNames[0]) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请选择疏散出口',
|
|
title: '请选择疏散出口',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -147,13 +154,15 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let obj = {
|
|
let obj = {
|
|
- buildId:this.buildingId,
|
|
|
|
- floorId:this.floorId,
|
|
|
|
- subId: this.subId,
|
|
|
|
- badPointNames:list,
|
|
|
|
- doorPointNames:doorPointNames,
|
|
|
|
|
|
+ buildId: this.buildingId,
|
|
|
|
+ floorId: this.floorId,
|
|
|
|
+ subId: this.subId,
|
|
|
|
+ badPointNames: list,
|
|
|
|
+ doorPointNames: doorPointNames,
|
|
}
|
|
}
|
|
- const { data } = await executeEvacuation(obj)
|
|
|
|
|
|
+ const {
|
|
|
|
+ data
|
|
|
|
+ } = await laboratoryExitLineExecuteEvacuation(obj)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '执行成功',
|
|
title: '执行成功',
|
|
@@ -161,9 +170,9 @@
|
|
mask: true,
|
|
mask: true,
|
|
duration: 2000
|
|
duration: 2000
|
|
});
|
|
});
|
|
- setTimeout(function(){
|
|
|
|
|
|
+ setTimeout(function() {
|
|
uni.navigateBack();
|
|
uni.navigateBack();
|
|
- },2000);
|
|
|
|
|
|
+ }, 2000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//疏散页面
|
|
//疏散页面
|
|
@@ -175,10 +184,12 @@
|
|
let self = this;
|
|
let self = this;
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
- } = await getFloorData(this.floorId)
|
|
|
|
|
|
+ } = await laboratoryBigViewGetFloorByBigView({
|
|
|
|
+ id: this.floorId
|
|
|
|
+ })
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
- if (data.data.buildFloorLayoutVoList[0]) {
|
|
|
|
- let list = JSON.parse(data.data.labExitLineVertex.layoutJoinData)
|
|
|
|
|
|
+ if (data.data[0].buildLayoutVoList[0]) {
|
|
|
|
+ let list = JSON.parse(data.data[0].labExitLineVo.layoutJoinData)
|
|
this.getWXSystemInfo(list);
|
|
this.getWXSystemInfo(list);
|
|
for (let i = 0; i < list.length; i++) {
|
|
for (let i = 0; i < list.length; i++) {
|
|
if (list[i].type == '2') {
|
|
if (list[i].type == '2') {
|
|
@@ -187,18 +198,18 @@
|
|
list[i].lightList[o].openType = false;
|
|
list[i].lightList[o].openType = false;
|
|
}
|
|
}
|
|
} else if (list[i].type == '1') {
|
|
} else if (list[i].type == '1') {
|
|
- for (let o = 0; o < data.data.buildFloorLayoutVoList.length; o++) {
|
|
|
|
- if (list[i].key == data.data.buildFloorLayoutVoList[o].pointName) {
|
|
|
|
- list[i].id = data.data.buildFloorLayoutVoList[o].id;
|
|
|
|
- list[i].buildId = data.data.buildFloorLayoutVoList[o].buildId;
|
|
|
|
- list[i].floorId = data.data.buildFloorLayoutVoList[o].floorId;
|
|
|
|
- list[i].roomType = data.data.buildFloorLayoutVoList[o].roomType;
|
|
|
|
- list[i].roomName = data.data.buildFloorLayoutVoList[o].roomName;
|
|
|
|
- list[i].roomNum = data.data.buildFloorLayoutVoList[o].roomNum;
|
|
|
|
- list[i].subName = data.data.buildFloorLayoutVoList[o].subName;
|
|
|
|
- list[i].subId = data.data.buildFloorLayoutVoList[o].subId;
|
|
|
|
- list[i].online = data.data.buildFloorLayoutVoList[o].online;
|
|
|
|
- list[i].loginAdmin = data.data.buildFloorLayoutVoList[o].loginAdmin;
|
|
|
|
|
|
+ for (let o = 0; o < data.data[0].buildLayoutVoList.length; o++) {
|
|
|
|
+ if (list[i].key == data.data[0].buildLayoutVoList[o].pointName) {
|
|
|
|
+ list[i].id = data.data[0].buildLayoutVoList[o].id;
|
|
|
|
+ list[i].buildId = data.data[0].buildLayoutVoList[o].buildId;
|
|
|
|
+ list[i].floorId = data.data[0].buildLayoutVoList[o].floorId;
|
|
|
|
+ list[i].roomType = data.data[0].buildLayoutVoList[o].roomType;
|
|
|
|
+ list[i].roomName = data.data[0].buildLayoutVoList[o].roomName;
|
|
|
|
+ list[i].roomNum = data.data[0].buildLayoutVoList[o].roomNum;
|
|
|
|
+ list[i].subName = data.data[0].buildLayoutVoList[o].subName;
|
|
|
|
+ list[i].subId = data.data[0].buildLayoutVoList[o].subId;
|
|
|
|
+ list[i].online = data.data[0].buildLayoutVoList[o].online;
|
|
|
|
+ list[i].loginAdmin = data.data[0].buildLayoutVoList[o].loginAdmin;
|
|
list[i].policeType = false;
|
|
list[i].policeType = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -224,7 +235,7 @@
|
|
}
|
|
}
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
- } = await getRedisEvacuation(obj)
|
|
|
|
|
|
+ } = await laboratoryExitLineGetRedisEvacuation(obj)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
if (data.data.doorPointNames) {
|
|
if (data.data.doorPointNames) {
|
|
for (let o = 0; o < self.mapList.length; o++) {
|
|
for (let o = 0; o < self.mapList.length; o++) {
|
|
@@ -269,8 +280,7 @@
|
|
} else {
|
|
} else {
|
|
self.openLight(item);
|
|
self.openLight(item);
|
|
}
|
|
}
|
|
- } else if (res.cancel) {
|
|
|
|
- }
|
|
|
|
|
|
+ } else if (res.cancel) {}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -283,7 +293,7 @@
|
|
};
|
|
};
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
- } = await openLight(obj)
|
|
|
|
|
|
+ } = await laboratoryExitRelayOpenLight(obj)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '操作成功',
|
|
title: '操作成功',
|
|
@@ -302,7 +312,7 @@
|
|
};
|
|
};
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
- } = await closeLight(obj)
|
|
|
|
|
|
+ } = await laboratoryExitRelayCloseLight(obj)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '操作成功',
|
|
title: '操作成功',
|
|
@@ -342,64 +352,31 @@
|
|
}
|
|
}
|
|
this.$set(this, 'mapWidth', maxWidth);
|
|
this.$set(this, 'mapWidth', maxWidth);
|
|
this.$set(this, 'mapHeight', maxHeight);
|
|
this.$set(this, 'mapHeight', maxHeight);
|
|
- let zoomNumOne = height / maxHeight;
|
|
|
|
- if(parseInt(this.accMul(zoomNumOne,maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,maxWidth)) <= width){
|
|
|
|
- zoomData = zoomNumOne;
|
|
|
|
- this.$set(this,'zoomData',zoomNumOne);
|
|
|
|
- }
|
|
|
|
- let zoomNumTwo = width / maxWidth;
|
|
|
|
- if(parseInt(this.accMul(zoomNumTwo,maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,maxWidth)) <= width){
|
|
|
|
- zoomData = zoomNumTwo;
|
|
|
|
- this.$set(this,'zoomData',zoomNumTwo);
|
|
|
|
- }
|
|
|
|
- // if (maxWidth > maxHeight) {
|
|
|
|
- // if ((maxWidth / maxHeight) > num) {
|
|
|
|
- // // 以宽度缩放
|
|
|
|
- // zoomType = 1;
|
|
|
|
- // } else {
|
|
|
|
- // // 以高度缩放
|
|
|
|
- // zoomType = 2;
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // if ((maxHeight / maxWidth) > num) {
|
|
|
|
- // // 以高度缩放
|
|
|
|
- // zoomType = 2;
|
|
|
|
- // } else {
|
|
|
|
- // // 以宽度缩放
|
|
|
|
- // zoomType = 1;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (zoomType == 1) {
|
|
|
|
- // if (width > maxWidth) {
|
|
|
|
- // zoomData = maxWidth / width;
|
|
|
|
- // } else {
|
|
|
|
- // zoomData = width / maxWidth;
|
|
|
|
- // }
|
|
|
|
- // if (width > maxWidth) {
|
|
|
|
- // this.$set(this, 'zoomData', maxWidth / width);
|
|
|
|
- // } else {
|
|
|
|
- // this.$set(this, 'zoomData', width / maxWidth);
|
|
|
|
- // }
|
|
|
|
- // } else if (zoomType == 2) {
|
|
|
|
- // if (height > maxHeight) {
|
|
|
|
- // zoomData = maxHeight / height;
|
|
|
|
- // } else {
|
|
|
|
- // zoomData = height / maxHeight;
|
|
|
|
- // }
|
|
|
|
- // if (height > maxHeight) {
|
|
|
|
- // this.$set(this, 'zoomData', maxHeight / height);
|
|
|
|
- // } else {
|
|
|
|
- // this.$set(this, 'zoomData', height / maxHeight);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
|
|
+ let zoomNumOne = height / maxHeight;
|
|
|
|
+ if (parseInt(this.accMul(zoomNumOne, maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,
|
|
|
|
+ maxWidth)) <= width) {
|
|
|
|
+ zoomData = zoomNumOne;
|
|
|
|
+ this.$set(this, 'zoomData', zoomNumOne);
|
|
|
|
+ }
|
|
|
|
+ let zoomNumTwo = width / maxWidth;
|
|
|
|
+ if (parseInt(this.accMul(zoomNumTwo, maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,
|
|
|
|
+ maxWidth)) <= width) {
|
|
|
|
+ zoomData = zoomNumTwo;
|
|
|
|
+ this.$set(this, 'zoomData', zoomNumTwo);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ accMul(arg1, arg2) {
|
|
|
|
+ var m = 0,
|
|
|
|
+ s1 = arg1.toString(),
|
|
|
|
+ s2 = arg2.toString();
|
|
|
|
+ try {
|
|
|
|
+ m += s1.split(".")[1].length
|
|
|
|
+ } catch (e) {}
|
|
|
|
+ try {
|
|
|
|
+ m += s2.split(".")[1].length
|
|
|
|
+ } catch (e) {}
|
|
|
|
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
|
|
},
|
|
},
|
|
- accMul(arg1,arg2){
|
|
|
|
- var m=0,s1=arg1.toString(),s2=arg2.toString();
|
|
|
|
- try{m+=s1.split(".")[1].length}catch(e){}
|
|
|
|
- try{m+=s2.split(".")[1].length}catch(e){}
|
|
|
|
- return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
|
|
|
|
- },
|
|
|
|
/*MQTT*/
|
|
/*MQTT*/
|
|
//订阅
|
|
//订阅
|
|
onMQTT() {
|
|
onMQTT() {
|
|
@@ -410,8 +387,8 @@
|
|
connectTimeout: 600000, // 超时时间
|
|
connectTimeout: 600000, // 超时时间
|
|
reconnectPeriod: 5000, // 重连间隔
|
|
reconnectPeriod: 5000, // 重连间隔
|
|
clientId: uni.getStorageSync('token') + 'lab/function/data',
|
|
clientId: uni.getStorageSync('token') + 'lab/function/data',
|
|
- username: uni.getStorageSync('mqttUser'),
|
|
|
|
- password: uni.getStorageSync('mqttPassword'),
|
|
|
|
|
|
+ username: uni.getStorageSync('mqttUser'),
|
|
|
|
+ password: uni.getStorageSync('mqttPassword'),
|
|
}
|
|
}
|
|
const connectUrl = uni.getStorageSync('mqttUrl');
|
|
const connectUrl = uni.getStorageSync('mqttUrl');
|
|
this.floorClient = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
|
|
this.floorClient = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
|
|
@@ -659,7 +636,8 @@
|
|
border-radius: 18px;
|
|
border-radius: 18px;
|
|
border: none;
|
|
border: none;
|
|
}
|
|
}
|
|
- .position-button-two{
|
|
|
|
|
|
+
|
|
|
|
+ .position-button-two {
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 20px;
|
|
bottom: 20px;
|
|
left: 50%;
|
|
left: 50%;
|