Commit 7467c1a0 authored by xxx's avatar xxx

完善导航路线方法

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