|
@@ -48,8 +48,11 @@
|
|
|
<view class="evacuation-max-box">
|
|
|
<!-- 头部 -->
|
|
|
<view class="evacuation-title-box">
|
|
|
- <view class="evacuation-title-name-box">{{subName}}</view>
|
|
|
- <view class="site"><img src="@/images/icon_14.png">{{address}}</view>
|
|
|
+ <view class="evacuation-title-left">
|
|
|
+ <view class="evacuation-title-name-box">{{checkSubName}}</view>
|
|
|
+ <view class="site"><img src="@/images/icon_14.png">{{address}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="evacuation-title-right" @click="backButton()">选择房间</view>
|
|
|
</view>
|
|
|
<!-- 地图部分 -->
|
|
|
<view class="roadmap">
|
|
@@ -224,7 +227,8 @@
|
|
|
openLight,
|
|
|
closeLight,
|
|
|
executeEvacuation,
|
|
|
- endEvacuation
|
|
|
+ endEvacuation,
|
|
|
+ selectTriggerInfo
|
|
|
} from '@/api/index.js'
|
|
|
export default {
|
|
|
data() {
|
|
@@ -308,6 +312,8 @@
|
|
|
name: '',
|
|
|
},
|
|
|
broadcastType: false,
|
|
|
+ //选中楼栋
|
|
|
+ checkSubName:"",
|
|
|
address: "",
|
|
|
videoHardwareNUM: [], //实验室和楼道摄像头编码
|
|
|
|
|
@@ -343,24 +349,53 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- this.treeselectByUser();
|
|
|
+ console.log('option',option)
|
|
|
+ // if(option.item){
|
|
|
+ // let obj = JSON.parse(decodeURIComponent(option.item));
|
|
|
+ // this.$set(this,'buildingId',obj.buildId);
|
|
|
+ // this.$set(this,'deptId',obj.buildId);
|
|
|
+ // this.$set(this,'floorId',obj.floorId);
|
|
|
+ // this.$set(this,'subId',obj.subId);
|
|
|
+ // this.$set(this,'pageType',2);
|
|
|
+ // this.getBuildingData();
|
|
|
+ // this.confirmBtn();
|
|
|
+ // }else{
|
|
|
+ // this.treeselectByUser();
|
|
|
+ // }
|
|
|
//一键灭火正式使用需要注销
|
|
|
// this.itemData.subjectId=85
|
|
|
// this.firedeviceStatus();
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
|
-
|
|
|
+ console.log('asd')
|
|
|
+ this.treeselectByUser();
|
|
|
+ if(this.floorId&&this.subId){
|
|
|
+ this.getBuildingData();
|
|
|
+ }
|
|
|
},
|
|
|
onUnload() {
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
+ //返回按钮
|
|
|
+ backButton(){
|
|
|
+ this.offMQTT();
|
|
|
+ this.$set(this,'buildingName',null);
|
|
|
+ this.$set(this,'buildingId',null);
|
|
|
+ this.$set(this,'deptId',null);
|
|
|
+ this.$set(this,'floorName',null);
|
|
|
+ this.$set(this,'floorId',null);
|
|
|
+ this.$set(this,'subId',null);
|
|
|
+ this.$set(this,'subName',null);
|
|
|
+ this.$set(this,'pageType',1);
|
|
|
+ this.treeselectByUser();
|
|
|
+ },
|
|
|
//全屏疏散页面
|
|
|
goAllPage() {
|
|
|
let obj = {
|
|
|
buildingId:this.buildingId,
|
|
|
- floorId:this.floorId
|
|
|
+ floorId:this.floorId,
|
|
|
+ type:1,
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/emergencyEvacuationBigFullScreen?item='+encodeURIComponent(JSON.stringify(obj)),
|
|
@@ -525,6 +560,7 @@
|
|
|
this.$set(this, 'fjListArray', []);
|
|
|
this.$set(this, 'subName', "");
|
|
|
this.$set(this, 'subId', "");
|
|
|
+ this.selectTriggerInfo(1);
|
|
|
},
|
|
|
//获取楼层数据
|
|
|
async getBuilding(buildingId) {
|
|
@@ -535,18 +571,30 @@
|
|
|
this.$set(this, 'fjListArray', []);
|
|
|
this.$set(this, 'subName', "");
|
|
|
this.$set(this, 'subId', "");
|
|
|
+ this.selectTriggerInfo(2);
|
|
|
},
|
|
|
//楼栋选中
|
|
|
buildingChange(e) {
|
|
|
this.$set(this, 'buildingName', this.buildingList[e.detail.value].name);
|
|
|
this.$set(this, 'buildingId', this.buildingList[e.detail.value].id);
|
|
|
this.$set(this, 'deptId', this.buildingList[e.detail.value].id);
|
|
|
+ this.$set(this, 'floorId', null);
|
|
|
+ this.$set(this, 'floorName', null);
|
|
|
+ this.$set(this, 'subId', null);
|
|
|
+ this.$set(this, 'subName', null);
|
|
|
+ this.$set(this.itemData, 'subjectId', null);
|
|
|
+ this.$set(this, 'floorList', []);
|
|
|
+ this.$set(this, 'fjListArray', []);
|
|
|
this.getBuilding(this.buildingList[e.detail.value].id);
|
|
|
},
|
|
|
//楼层选中
|
|
|
floorChange(e) {
|
|
|
this.$set(this, 'floorName', this.floorList[e.detail.value].name);
|
|
|
this.$set(this, 'floorId', this.floorList[e.detail.value].id);
|
|
|
+ this.$set(this, 'subId', null);
|
|
|
+ this.$set(this, 'subName', null);
|
|
|
+ this.$set(this.itemData, 'subjectId', null);
|
|
|
+ this.$set(this, 'fjListArray', []);
|
|
|
this.getBuildingData();
|
|
|
},
|
|
|
//实验室选择
|
|
@@ -555,6 +603,44 @@
|
|
|
this.$set(this, 'subId', this.fjListArray[e.detail.value].subId);
|
|
|
this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
|
|
|
},
|
|
|
+ //获取预案数据
|
|
|
+ async selectTriggerInfo(type){
|
|
|
+ let self = this;
|
|
|
+ const {data} = await selectTriggerInfo();
|
|
|
+ if(data.code == 200){
|
|
|
+ if(type == 1){
|
|
|
+ //标记楼栋
|
|
|
+ for(let o=0;o<self.buildingList.length;o++){
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
+ if(data.data[i].buildId == self.buildingList[o].id){
|
|
|
+ self.buildingList[o].name = '(预案发生) '+self.buildingList[o].name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(type == 2){
|
|
|
+ //标记楼层
|
|
|
+ for(let o=0;o<self.floorList.length;o++){
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
+ if(data.data[i].floorId == self.floorList[o].id){
|
|
|
+ self.floorList[o].name = '(预案发生) '+self.floorList[o].name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(type == 3){
|
|
|
+ //标记实验室
|
|
|
+ for(let o=0;o<self.fjListArray.length;o++){
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
+ if(data.data[i].subId == self.fjListArray[o].subId){
|
|
|
+ self.fjListArray[o].subName = '(预案发生) '+self.fjListArray[o].subName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('data.data',data.data);
|
|
|
+ },
|
|
|
getAppExitLine() {
|
|
|
let list = [{
|
|
|
type: "lab/exit/line"
|
|
@@ -865,7 +951,8 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- this.$set(this,'address',this.buildingName + '' + this.floorName);
|
|
|
+ this.$set(this,'checkSubName',this.subName.replace('(预案发生) ',""));
|
|
|
+ this.$set(this,'address',this.buildingName.replace('(预案发生) ',"") + '' + this.floorName.replace('(预案发生) ',""));
|
|
|
this.$set(this,'pageType',2);
|
|
|
this.getDeviceList();
|
|
|
this.laboratoryInfo();
|
|
@@ -874,34 +961,14 @@
|
|
|
},
|
|
|
//执行疏散
|
|
|
async lineEvacuate() {
|
|
|
- if (!this.subId) {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择实验室',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.buttonArrayIndex) {
|
|
|
- uni.showToast({
|
|
|
- title: '请选择疏散路线',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- const {
|
|
|
- data
|
|
|
- } = await lineEvacuate(this.subId, this.buttonArray[this.buttonArrayIndex].id)
|
|
|
-
|
|
|
- if (data.code == 200) {
|
|
|
- if (data.data) {
|
|
|
- console.log('执行疏散')
|
|
|
- this.initialization(data.data);
|
|
|
- }
|
|
|
+ let obj = {
|
|
|
+ buildingId:this.buildingId,
|
|
|
+ floorId:this.floorId,
|
|
|
+ type:2,
|
|
|
}
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/emergencyEvacuationBigFullScreen?item='+encodeURIComponent(JSON.stringify(obj)),
|
|
|
+ });
|
|
|
},
|
|
|
//获取喇叭列表
|
|
|
async getDeviceList() {
|
|
@@ -976,6 +1043,7 @@
|
|
|
setTimeout(function() {
|
|
|
self.getRedisEvacuation();
|
|
|
}, 500);
|
|
|
+ this.selectTriggerInfo(3);
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -1017,7 +1085,10 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ this.$set(this,'isEvacuate',false)
|
|
|
this.$forceUpdate();
|
|
|
+ }else{
|
|
|
+ this.$set(this,'isEvacuate',true)
|
|
|
}
|
|
|
};
|
|
|
},
|
|
@@ -1071,23 +1142,35 @@
|
|
|
//结束疏散
|
|
|
evacuationButton() {
|
|
|
let self = this;
|
|
|
- uni.showModal({
|
|
|
- content: '确认'+(this.isEvacuate?'执行':'结束')+'疏散吗?',
|
|
|
- cancelColor: "#999",
|
|
|
- confirmColor: "#0183FA",
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- if(self.isEvacuate){
|
|
|
- self.executeEvacuation();
|
|
|
- }else{
|
|
|
- self.endEvacuation();
|
|
|
+ if(this.isEvacuate){
|
|
|
+ let obj = {
|
|
|
+ buildingId:this.buildingId,
|
|
|
+ floorId:this.floorId,
|
|
|
+ subId:this.subId,
|
|
|
+ type:2,
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/emergencyEvacuationBigFullScreen?item='+encodeURIComponent(JSON.stringify(obj)),
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ uni.showModal({
|
|
|
+ content: '确认'+(this.isEvacuate?'执行':'结束')+'疏散吗?',
|
|
|
+ cancelColor: "#999",
|
|
|
+ confirmColor: "#0183FA",
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ if(self.isEvacuate){
|
|
|
+ self.executeEvacuation();
|
|
|
+ }else{
|
|
|
+ self.endEvacuation();
|
|
|
+ }
|
|
|
+ console.log('用户点击确定');
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
}
|
|
|
- console.log('用户点击确定');
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//开始疏散
|
|
|
async executeEvacuation(){
|
|
@@ -1371,31 +1454,39 @@
|
|
|
border-radius: 20rpx;
|
|
|
padding: 34rpx 22rpx;
|
|
|
box-sizing: border-box;
|
|
|
-
|
|
|
- .evacuation-title-name-box {
|
|
|
- font-size: 30rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #333333;
|
|
|
- line-height: 30rpx;
|
|
|
+ display: flex;
|
|
|
+ .evacuation-title-left{
|
|
|
+ flex:1;
|
|
|
+ .evacuation-title-name-box {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .site {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #999999;
|
|
|
+ line-height: 30rpx;
|
|
|
+ margin-top: 32rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ >img {
|
|
|
+ width: 28rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ margin-right: 18rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- .site {
|
|
|
+ .evacuation-title-right{
|
|
|
+ color:#0183FA;
|
|
|
font-size: 28rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #999999;
|
|
|
- line-height: 30rpx;
|
|
|
- margin-top: 32rpx;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- >img {
|
|
|
- width: 28rpx;
|
|
|
- height: 30rpx;
|
|
|
- margin-right: 18rpx;
|
|
|
- }
|
|
|
+ line-height: 100rpx;
|
|
|
}
|
|
|
}
|
|
|
|