|
@@ -248,28 +248,41 @@
|
|
groupId: null,
|
|
groupId: null,
|
|
planStatus: false,
|
|
planStatus: false,
|
|
warnData: null,
|
|
warnData: null,
|
|
|
|
+ pageData:null,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
- console.log('option', option);
|
|
|
|
if (option.item) {
|
|
if (option.item) {
|
|
let obj = JSON.parse(decodeURIComponent(option.item));
|
|
let obj = JSON.parse(decodeURIComponent(option.item));
|
|
- this.$set(this, 'warnData', obj);
|
|
|
|
- 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.itemData, 'subjectId', obj.subId);
|
|
|
|
- this.$set(this, 'groupId', obj.groupId);
|
|
|
|
- this.$set(this, 'pageType', 2);
|
|
|
|
|
|
+ // console.log('obj',obj)
|
|
|
|
+ if(obj.type == 'skip'){
|
|
|
|
+ // 新实验室列表跳转进入逻辑
|
|
|
|
+ this.$set(this, 'pageData', obj);
|
|
|
|
+ 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.itemData, 'subjectId', obj.subId);
|
|
|
|
+ this.$set(this, 'pageType', 2);
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this, 'warnData', obj);
|
|
|
|
+ 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.itemData, 'subjectId', obj.subId);
|
|
|
|
+ this.$set(this, 'groupId', obj.groupId);
|
|
|
|
+ this.$set(this, 'pageType', 2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- if (this.warnData) {
|
|
|
|
- this.getDataA();
|
|
|
|
- } else {
|
|
|
|
- this.laboratoryBigViewGetBuildByBigView();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.warnData) {
|
|
|
|
+ // this.getDataA();
|
|
|
|
+ // } else {
|
|
|
|
+ // this.laboratoryBigViewGetBuildByBigView();
|
|
|
|
+ // }
|
|
|
|
+ this.getDataA();
|
|
this.getRedisEvacuation();
|
|
this.getRedisEvacuation();
|
|
},
|
|
},
|
|
onUnload() {},
|
|
onUnload() {},
|
|
@@ -313,9 +326,16 @@
|
|
},
|
|
},
|
|
//返回按钮
|
|
//返回按钮
|
|
backButton() {
|
|
backButton() {
|
|
- let self = this;
|
|
|
|
- this.$set(this, 'pageType', 1);
|
|
|
|
- this.laboratoryBigViewGetBuildByBigView();
|
|
|
|
|
|
+ // let self = this;
|
|
|
|
+ // this.$set(this, 'pageType', 1);
|
|
|
|
+ // this.laboratoryBigViewGetBuildByBigView();
|
|
|
|
+ if(this.pageData){
|
|
|
|
+ uni.navigateBack();
|
|
|
|
+ }else{
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: "/pages_manage/views/emergencyEvacuationSubList",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//结束预案
|
|
//结束预案
|
|
closePlan() {
|
|
closePlan() {
|
|
@@ -361,7 +381,7 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
async closeRiskPlan() {
|
|
async closeRiskPlan() {
|
|
- console.log('this.groupId',this.groupId);
|
|
|
|
|
|
+ // console.log('this.groupId',this.groupId);
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
} = await laboratoryPlanCloseRiskPlan({
|
|
} = await laboratoryPlanCloseRiskPlan({
|
|
@@ -552,7 +572,7 @@
|
|
},
|
|
},
|
|
//录制
|
|
//录制
|
|
recordButton(e) {
|
|
recordButton(e) {
|
|
- console.log("按下")
|
|
|
|
|
|
+ // console.log("按下")
|
|
let self = this;
|
|
let self = this;
|
|
let num = 0;
|
|
let num = 0;
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
@@ -570,7 +590,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.liveType = true;
|
|
this.liveType = true;
|
|
- console.log('录制', e)
|
|
|
|
|
|
+ // console.log('录制', e)
|
|
this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
|
|
this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
|
|
const options = {
|
|
const options = {
|
|
duration: 10000,
|
|
duration: 10000,
|
|
@@ -582,10 +602,10 @@
|
|
}
|
|
}
|
|
this.recorderManager.start(options); //开始录音
|
|
this.recorderManager.start(options); //开始录音
|
|
this.recorderManager.onStart(() => {
|
|
this.recorderManager.onStart(() => {
|
|
- console.log('recorder start')
|
|
|
|
|
|
+ // console.log('recorder start')
|
|
})
|
|
})
|
|
this.recorderManager.onError((res) => {
|
|
this.recorderManager.onError((res) => {
|
|
- console.log(res);
|
|
|
|
|
|
+ // console.log(res);
|
|
})
|
|
})
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: "正在录音,上划取消发送",
|
|
title: "正在录音,上划取消发送",
|
|
@@ -596,7 +616,7 @@
|
|
},
|
|
},
|
|
//取消
|
|
//取消
|
|
cancelButton(e) {
|
|
cancelButton(e) {
|
|
- console.log("移动")
|
|
|
|
|
|
+ // console.log("移动")
|
|
let self = this;
|
|
let self = this;
|
|
let num = 0;
|
|
let num = 0;
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
@@ -608,7 +628,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.liveType = false;
|
|
this.liveType = false;
|
|
- console.log('取消', e)
|
|
|
|
|
|
+ // console.log('取消', e)
|
|
let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
|
|
let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
|
|
if (Math.abs(moveLenght) > 50) {
|
|
if (Math.abs(moveLenght) > 50) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
@@ -628,7 +648,7 @@
|
|
},
|
|
},
|
|
//发送
|
|
//发送
|
|
sendButton(e) {
|
|
sendButton(e) {
|
|
- console.log("松开")
|
|
|
|
|
|
+ // console.log("松开")
|
|
let self = this;
|
|
let self = this;
|
|
let num = 0;
|
|
let num = 0;
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
for (let i = 0; i < self.trumpetList.length; i++) {
|
|
@@ -641,16 +661,16 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.liveType = false;
|
|
this.liveType = false;
|
|
- console.log('发送', e)
|
|
|
|
|
|
+ // console.log('发送', e)
|
|
wx.hideToast(); //结束录音、隐藏Toast提示框
|
|
wx.hideToast(); //结束录音、隐藏Toast提示框
|
|
this.recorderManager.stop(); //结束录音
|
|
this.recorderManager.stop(); //结束录音
|
|
this.recorderManager.onStop((res) => {
|
|
this.recorderManager.onStop((res) => {
|
|
if (!this.sendLock) {
|
|
if (!this.sendLock) {
|
|
- console.log('1', this.recorderManager)
|
|
|
|
|
|
+ // console.log('1', this.recorderManager)
|
|
this.uploadImg(res.tempFilePath);
|
|
this.uploadImg(res.tempFilePath);
|
|
}
|
|
}
|
|
- console.log('停止录音', res.tempFilePath)
|
|
|
|
- console.log("sendLock", this.sendLock);
|
|
|
|
|
|
+ // console.log('停止录音', res.tempFilePath)
|
|
|
|
+ // console.log("sendLock", this.sendLock);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//上传MP3
|
|
//上传MP3
|
|
@@ -669,7 +689,7 @@
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- console.log("上传成功", res)
|
|
|
|
|
|
+ // console.log("上传成功", res)
|
|
let url = 'http://'+uni.getStorageSync('mqttIntranetUrl').split(':')[0]+'/'+res.data.url
|
|
let url = 'http://'+uni.getStorageSync('mqttIntranetUrl').split(':')[0]+'/'+res.data.url
|
|
self.iotAppSpeakerPlayVoice(url);
|
|
self.iotAppSpeakerPlayVoice(url);
|
|
} else {
|
|
} else {
|
|
@@ -716,13 +736,13 @@
|
|
},
|
|
},
|
|
//监听应急疏散数据变更
|
|
//监听应急疏散数据变更
|
|
getMqttLineData(val) {
|
|
getMqttLineData(val) {
|
|
- console.log('收到疏散MQTT')
|
|
|
|
|
|
+ // console.log('收到疏散MQTT')
|
|
let self = this;
|
|
let self = this;
|
|
if (val.EXIT_LINE_MESSAGE) {
|
|
if (val.EXIT_LINE_MESSAGE) {
|
|
- console.log('数据改变')
|
|
|
|
|
|
+ // console.log('数据改变')
|
|
this.evacuate();
|
|
this.evacuate();
|
|
} else {
|
|
} else {
|
|
- console.log('应急疏散已结束')
|
|
|
|
|
|
+ // console.log('应急疏散已结束')
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '应急疏散已结束',
|
|
title: '应急疏散已结束',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -800,7 +820,7 @@
|
|
];
|
|
];
|
|
return "rgba(" + rgba.toString() + ")";
|
|
return "rgba(" + rgba.toString() + ")";
|
|
};
|
|
};
|
|
- console.log('data', data)
|
|
|
|
|
|
+ // console.log('data', data)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
if (data.data[0].buildLayoutVoList[0]) {
|
|
if (data.data[0].buildLayoutVoList[0]) {
|
|
let list = JSON.parse(data.data[0].labExitLineVo.layoutJoinData)
|
|
let list = JSON.parse(data.data[0].labExitLineVo.layoutJoinData)
|
|
@@ -993,9 +1013,9 @@
|
|
} else {
|
|
} else {
|
|
self.endEvacuation();
|
|
self.endEvacuation();
|
|
}
|
|
}
|
|
- console.log('用户点击确定');
|
|
|
|
|
|
+ // console.log('用户点击确定');
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
- console.log('用户点击取消');
|
|
|
|
|
|
+ // console.log('用户点击取消');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -1020,7 +1040,7 @@
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
} = await laboratoryExitLineExecuteEvacuation(obj)
|
|
} = await laboratoryExitLineExecuteEvacuation(obj)
|
|
- console.log('data', data)
|
|
|
|
|
|
+ // console.log('data', data)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$set(this, 'isEvacuate', false);
|
|
this.$set(this, 'isEvacuate', false);
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -1041,7 +1061,7 @@
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
} = await laboratoryexitLineEndEvacuation(obj)
|
|
} = await laboratoryexitLineEndEvacuation(obj)
|
|
- console.log('data', data)
|
|
|
|
|
|
+ // console.log('data', data)
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$set(this, 'isEvacuate', true);
|
|
this.$set(this, 'isEvacuate', true);
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -1089,22 +1109,22 @@
|
|
this.client.on("connect", e => {
|
|
this.client.on("connect", e => {
|
|
this.client.subscribe(this.mtopic, (err) => {
|
|
this.client.subscribe(this.mtopic, (err) => {
|
|
if (!err) {
|
|
if (!err) {
|
|
- console.log("预案订阅成功:" + this.mtopic);
|
|
|
|
|
|
+ // console.log("预案订阅成功:" + this.mtopic);
|
|
} else {
|
|
} else {
|
|
// console.log("连接错误:" + err);
|
|
// console.log("连接错误:" + err);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.client.subscribe(this.mtopicOne, (err) => {
|
|
this.client.subscribe(this.mtopicOne, (err) => {
|
|
if (!err) {
|
|
if (!err) {
|
|
- console.log("疏散订阅成功:" + this.mtopicOne);
|
|
|
|
|
|
+ // console.log("疏散订阅成功:" + this.mtopicOne);
|
|
} else {
|
|
} else {
|
|
// console.log("连接错误:" + err);
|
|
// console.log("连接错误:" + err);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
this.client.on("message", (topic, message) => {
|
|
this.client.on("message", (topic, message) => {
|
|
- console.log('message', message);
|
|
|
|
- console.log('topic,', topic);
|
|
|
|
|
|
+ // console.log('message', message);
|
|
|
|
+ // console.log('topic,', topic);
|
|
if (message) {
|
|
if (message) {
|
|
if (topic == this.mtopic) {
|
|
if (topic == this.mtopic) {
|
|
//预案触发
|
|
//预案触发
|