Commit 9a74bf10 authored by xxx's avatar xxx

接受语音排序以及定位方法修改

parent 7eafe20a
......@@ -306,9 +306,25 @@ export default {
}else{
let arr2 = JSON.parse(str1);
arr2.unshift(str2);
that.videoContentAllArray = arr2;
that.$parent.audioDataFn(arr2);
localStorage.setItem(this.userName1 + 'voiceData',JSON.stringify(arr2));
let jinjitongzhi = [];
let guangbo = [];
let tonghua = [];
let qitache = [];
arr2.forEach((item2,indedx2)=>{
if(item2.fromUserId == '紧急通知'){
jinjitongzhi.push(item2);
}else if(item2.fromUserId == '广播'){
guangbo.push(item2);
}else if(item2.fromUserId == '通话'){
tonghua.push(item2);
}else{
qitache.push(item2);
}
})
let lastAudioData = [...jinjitongzhi,...guangbo,...tonghua,...qitache];
that.videoContentAllArray = lastAudioData;
that.$parent.audioDataFn(lastAudioData);
localStorage.setItem(this.userName1 + 'voiceData',JSON.stringify(lastAudioData));
}
}
},
......
......@@ -179,11 +179,11 @@ export default {
this.zongTimer1 = setInterval(() => {
this.setNowTimes();
}, 1000)
this.zongTimer3 = setInterval(() => {
if(this.equipmentName){
this.getCarLoaction();
}
}, 2000)
// this.zongTimer3 = setInterval(() => {
// if(this.equipmentName){
// this.getCarLoaction();
// }
// }, 2000)
this.zongTimer2 = setInterval(() => {
if(this.carnumber == ''){
return
......@@ -192,7 +192,7 @@ export default {
if(this.carclass == '铲车'){
this.loadData1();
}
//获取报警记录以及摄像头报警数据
//获取报警记录
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
if(res.data.totalElements == 0){
......@@ -222,38 +222,6 @@ export default {
});
}
});
//获取摄像头报警数据
// if(that.devices != ''){
// axios.get('/jiankong/StandardApiAction_vehicleAlarm.action', {
// params: {
// jsession:that.jsession,
// DevIDNO:that.devices
// }
// }).then(function (response) {
// if(response.data.alarmlist.length != 0){
// that.$nextTick(()=>{
// that.$notify({
// title:
// response.data.alarmlist[0].type == 620 ? "接打电话报警" :
// response.data.alarmlist[0].type == 621 ? '接打电话报警' :
// response.data.alarmlist[0].type == 624 ? '分神驾驶报警' :
// response.data.alarmlist[0].type == 625 ? '分神驾驶报警' :
// response.data.alarmlist[0].type == 600 ? '前向碰撞报警' :
// response.data.alarmlist[0].type == 601 ? '前向碰撞报警' :
// response.data.alarmlist[0].type == 172 ? '疲劳驾驶报警' :
// response.data.alarmlist[0].type == 190 ? '疲劳驾驶报警' :
// response.data.alarmlist[0].type == 430 ? '接近报警' :
// response.data.alarmlist[0].type == 431 ? '接近报警' :
// response.data.alarmlist[0].type == 432 ? '接近报警' :
// response.data.alarmlist[0].type == 433 ? '接近报警' : '',
// type: 'warning',
// duration: 5000,
// dangerouslyUseHTMLString: true,
// });
// })
// }
// })
// }
}
}
});
......@@ -274,28 +242,6 @@ export default {
this.personalName = res.data.content[0].name;
this.$refs.startOrderReceivingMethod.loadData(this.carnumber);
this.$refs.voiceApplicationMethod.loadData3(this.carnumber);
//获取摄像头会话号
// axios.get('/jiankong/StandardApiAction_login.action', {
// params: {
// account:'admin',
// password:'admin'
// }
// }).then(function (response1) {
// that.jsession = response1.data.jsession;
// if(that.jsession != '' && that.carnumber != ''){
// //获取摄像头车辆设备号
// axios.get('/jiankong/StandardApiAction_getDeviceByVehicle.action', {
// params: {
// jsession:that.jsession,
// vehiIdno:that.carnumber
// }
// }).then(function (response2) {
// if(response2.data.result == 0 && response2.data.devices.length != 0){
// that.devices = response2.data.devices[0].did;
// }
// })
// }
// })
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res1) => {
if(res1.code == 200){
if(res1.data.totalElements == 0){
......@@ -309,6 +255,10 @@ export default {
this.systemTitle = '卡车调度系统铲车终端';
}
this.equipmentName = res1.data.content[0].equipmentName;
//执行获取位置
if(this.equipmentName){
this.getCarLoaction1();
}
}
}
});
......@@ -366,13 +316,13 @@ export default {
let LoaObj1xy = {};
//判断该车是否在行驶状态
let drivingDistance = that.getDistanceIndex(that.navigatorXY.y,that.navigatorXY.x,position.coords.latitude,position.coords.longitude);
console.log(drivingDistance);
//console.log(drivingDistance);
if(drivingDistance <= 1){
that.leftBtnDisable = true;
}else{
that.leftBtnDisable = false;
}
if(drivingDistance > 300 && drivingDistance < 10000){
if(drivingDistance > 1000 && drivingDistance < 10000){
LoaObj1xy.x = that.navigatorXY.x;
LoaObj1xy.y = that.navigatorXY.y;
LoaObj1.gndRate = '';
......@@ -408,6 +358,48 @@ export default {
enableHighAccuracy: true,
}
);
}
},
//获取该车位置并上传到后端
getCarLoaction1(){
let that = this;
if(navigator.geolocation) {
navigator.geolocation.watchPosition(
//locationSuccess 获取成功的话
function(position) {
let LoaObj1 = {};
let LoaObj1xy = {};
//判断该车是否在行驶状态
let drivingDistance = that.getDistanceIndex(that.navigatorXY.y,that.navigatorXY.x,position.coords.latitude,position.coords.longitude);
console.log(drivingDistance);
if(drivingDistance <= 50 || drivingDistance >= 10000){
that.leftBtnDisable = true;
}else{
that.leftBtnDisable = false;
}
LoaObj1xy.x = position.coords.longitude;
LoaObj1xy.y = position.coords.latitude;
that.navigatorXY.x = position.coords.longitude;
that.navigatorXY.y = position.coords.latitude;
LoaObj1.gndRate = '';
LoaObj1.location = LoaObj1xy;
LoaObj1.name = that.equipmentName;
LoaObj1.time = new Date().getTime();
let zuizhong1 = {};
zuizhong1.name = that.equipmentName;
zuizhong1.jsonObject = JSON.stringify(LoaObj1);
httpPostForJson(gpsPhoneGpsQuery,zuizhong1).then((res1) => {})
httpPostForJson(carRealTimeLocationQuery2,JSON.stringify(LoaObj1)).then((res2) => {})
},
//locationError 获取失败的话
function(error) {
var errorType = ['您拒绝共享位置信息', '获取不到位置信息', '获取位置信息超时'];
console.log(errorType[error.code - 1]);
},{
enableHighAccuracy: true,
maximumAge:2000,
}
);
}
},
//接受派单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment