Commit 7467c1a0 authored by xxx's avatar xxx

完善导航路线方法

parent c0ff2bbf
......@@ -39,3 +39,5 @@ export const getZhuangCheDingDanQuery = '/api/Order/ZC'; //获取装车订单
export const getXieCheDingDanQuery = '/api/Order/XC'; //获取卸车订单
export const getalarmRealQuery = '/api/alarm/real'; //获取车辆设备实时报警
export const dispatchFinishQuery = '/api/Dispatch/finish'; //获取智能调度是否完成
export const apiCpointQuery = '/api/Cpoint'; //获取关键控制点坐标
export const apiPathmapNavigationQuery = '/api/Pathmap/navigation'; //获取关键控制点坐标
......@@ -25,8 +25,6 @@ Vue.prototype.Cesium = mars3d.Cesium
var map;
var graphicLayerZ;
var graphicZ;
var graphicLayerX;
var graphicX;
export default {
name: 'mars3dViewer',
......@@ -302,20 +300,18 @@ export default {
},
// 装车箭头线 graphicLayer.removeGraphic(graphic);
addArrowGraphic3(boo) {
addArrowGraphic3(boo,points) {
if(boo){
graphicLayerZ = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayerZ);
graphicZ = new mars3d.graphic.PolylineEntity({
positions: [
[117.66302, 34.53032, 500],
[117.6636, 34.5295, 500]
],
positions: points,
style: {
width: 20,
color: '#E47E1B',
clampToGround: true,
materialType: mars3d.MaterialType.PolylineArrow,
width: 10,
materialType: mars3d.MaterialType.PolylineOutline,
color: Cesium.Color.ORANGE,
outlineWidth: 2,
outlineColor: Cesium.Color.BLACK,
},
})
graphicLayerZ.addGraphic(graphicZ)
......@@ -323,28 +319,6 @@ export default {
graphicLayerZ.removeGraphic(graphicZ);
}
},
// 卸车箭头线 graphicLayer.removeGraphic(graphic);
addArrowGraphic4(boo) {
if(boo){
graphicLayerX = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayerX);
graphicX = new mars3d.graphic.PolylineEntity({
positions: [
[117.6636, 34.5295, 500]
[117.6631, 34.5277, 500]
],
style: {
width: 20,
color: '#E47E1B',
clampToGround: true,
materialType: mars3d.MaterialType.PolylineArrow,
},
})
graphicLayerX.addGraphic(graphicX)
}else{
graphicLayerX.removeGraphic(graphicX);
}
},
// 在图层绑定Popup弹窗
bindLayerPopup(graphicLayer,number) {
let that = this;
......
......@@ -60,6 +60,9 @@ export default {
},
mounted(){
this.sonTimer1 = setInterval(() => {
if(this.carnumber == ''){
return;
}
//如果zhinengpaidanBoolan为true,获取人工和智能一起的调度
if(this.zhinengpaidanBoolan){
//先查人工调度
......@@ -525,7 +528,7 @@ export default {
}
});
httpDelForJson(dingDanBiaoCaoZuo,[this.dingDanId]).then((res) => {
//this.$parent.zhixinglujing2(false);
this.$parent.zhixinglujing(false,this.carnumber,this.carDestination);
});
this.$nextTick(()=>{
this.oldxy.lat = 0;
......@@ -590,7 +593,7 @@ export default {
}
});
httpDelForJson(dingDanBiaoCaoZuo,[this.dingDanId]).then((res) => {
//this.$parent.zhixinglujing2(false);
this.$parent.zhixinglujing(false,this.carnumber,this.carDestination);
});
this.$nextTick(()=>{
this.oldxy.lat = 0;
......@@ -611,9 +614,7 @@ export default {
},
//导航开启
navigation(){
//删除路径
//this.$parent.zhixinglujing(false);
//this.$parent.zhixinglujing2(true);
this.$parent.zhixinglujing(true,this.carnumber,this.carDestination);
},
//获取当前时间
currentTime(){
......
......@@ -82,6 +82,8 @@ import {
carRealTimeLocationQuery2,
failureDeclarationAdd,
gpsPhoneGpsQuery,
apiCpointQuery,
apiPathmapNavigationQuery,
} from "@/axios/api.js"
import startOrderReceiving from './components/startOrderReceiving/index.vue' //接受派单
import voiceApplication from './components/voiceApplication/index.vue' //语音申请
......@@ -128,8 +130,8 @@ export default {
//电量显示
IsCharge:true,
batteryEnegy:0,
//判断卸车1
boo1:false,
//控制点数据
controlPointData:[],
}
},
mounted(){
......@@ -144,6 +146,9 @@ export default {
}
}, 3000)
this.zongTimer2 = setInterval(() => {
if(this.carnumber == ''){
return
}
//判断车辆类型
if(this.carclass == '铲车'){
this.loadData1();
......@@ -199,7 +204,7 @@ export default {
this.userName1 = href2;
//获取司机人员信息
httpGet(personalCenterInforQuery,{userName:this.userName1}).then((res) => {
if(res.code == 200){
if(res.code == 200 && res.data.totalElements != 0){
this.carnumber = res.data.content[0].car;
this.personalName = res.data.content[0].name;
this.$refs.startOrderReceivingMethod.loadData(this.carnumber);
......@@ -221,8 +226,16 @@ export default {
}
}
});
}else{
this.$refs.voiceApplicationMethod.loadData3(this.carnumber);
}
});
//获取所有关键控制点信息
httpGet(apiCpointQuery,{size:9999}).then((res) => {
if(res.code == 200){
this.controlPointData = res.data.content;
}
})
//展示二维地图
this.$refs.mars3dViewerMapMethod.getCarInforFn();
......@@ -545,15 +558,29 @@ export default {
});
},
//执行路径
zhixinglujing(boo){
//this.$refs.mars3dViewerMapMethod.addArrowGraphic3(boo);
},
//执行路径
zhixinglujing2(boo){
// if(!this.boo1){
// this.boo1 = boo;
// this.$refs.mars3dViewerMapMethod.addArrowGraphic4(boo);
// }
zhixinglujing(boo,carnumber,carDestination){
if(boo){
httpGet(apiPathmapNavigationQuery,{equipmentName:this.equipmentName,point:carDestination}).then((res1) => {
if(res1.code == 200){
let route1 = res1.data.split(';');
let route2 = [];
route1.forEach((item1,index1)=>{
this.controlPointData.forEach((item2,index2)=>{
if(item1 == item2.name){
let obj1 = [];
obj1.push(parseFloat(item2.lon));
obj1.push(parseFloat(item2.lat));
obj1.push(500);
route2.push(obj1);
}
})
})
this.$refs.mars3dViewerMapMethod.addArrowGraphic3(boo,route2);
}
})
}else{
this.$refs.mars3dViewerMapMethod.addArrowGraphic3(boo);
}
},
},
beforeDestroy(){
......
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