Commit f7e46e64 authored by xxx's avatar xxx

1

parent fd5b0fc0
...@@ -89,12 +89,13 @@ export default { ...@@ -89,12 +89,13 @@ export default {
methods: { methods: {
//获取数据 //获取数据
getCoordinate(equipmentName,number,speed,bTime,eTime,stopPointData) { getCoordinate(equipmentName,number,speed,bTime,eTime,stopPointData,leadTimeShow) {
let that = this; let that = this;
that.deviceId = equipmentName; that.deviceId = equipmentName;
that.carNumber = number; that.carNumber = number;
that.carPlaySpeed = speed; that.carPlaySpeed = speed;
that.stopPointData = stopPointData; that.stopPointData = stopPointData;
that.leadTime = leadTimeShow;
//获取历史轨迹 //获取历史轨迹
if(number == ''){ if(number == ''){
return return
...@@ -155,7 +156,6 @@ export default { ...@@ -155,7 +156,6 @@ export default {
//创建地图电子围栏 //创建地图电子围栏
initMars3d(options) { initMars3d(options) {
let that = this; let that = this;
//if (this[`map${this.mapKey}`]) return
const mapOptions = { const mapOptions = {
...options, ...options,
...@@ -222,6 +222,7 @@ export default { ...@@ -222,6 +222,7 @@ export default {
color: "rgb(251,84,48)", color: "rgb(251,84,48)",
opacity: 1.0, opacity: 1.0,
leadTime: that.leadTime ? 9999 : 0, // 前方的路线不显示 leadTime: that.leadTime ? 9999 : 0, // 前方的路线不显示
trailTime: that.leadTime ? 9999 : 0,
//高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用 //高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight: { highlight: {
type: mars3d.EventType.click, type: mars3d.EventType.click,
...@@ -402,15 +403,16 @@ export default { ...@@ -402,15 +403,16 @@ export default {
} }
}, },
callback: (e) => { callback: (e) => {
const graphic = e.graphic // const graphic = e.graphic
if (!graphic) { // if (!graphic) {
return // return
} // }
const parent = graphic.parent // 右击是编辑点时 // const parent = graphic.parent // 右击是编辑点时
graphicLayer.removeGraphic(graphic) // graphicLayer.removeGraphic(graphic)
if (parent) { // if (parent) {
graphicLayer.removeGraphic(parent) // graphicLayer.removeGraphic(parent)
} // }
// map.removeLayer(graphicLayer);
} }
}, },
// { // {
......
...@@ -54,6 +54,11 @@ ...@@ -54,6 +54,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" style="display: inline-block;">
<el-button type="primary" @click="trajectoryShow(true)" plain>显示所有轨迹</el-button>
<el-button type="primary" @click="trajectoryShow(false)" plain>关闭所有轨迹</el-button>
</el-form-item>
</el-form> </el-form>
<div id="centerDiv" class="mapcontainer2"> <div id="centerDiv" class="mapcontainer2">
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod" :key="shuaxinTimer"/> <mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod" :key="shuaxinTimer"/>
...@@ -102,6 +107,7 @@ export default { ...@@ -102,6 +107,7 @@ export default {
tishiTextShow:true, tishiTextShow:true,
trajectoryTableData:[], trajectoryTableData:[],
measureDistanceDis:true, measureDistanceDis:true,
leadTime:false,
} }
}, },
mounted() { mounted() {
...@@ -137,7 +143,7 @@ export default { ...@@ -137,7 +143,7 @@ export default {
if(res.code == 200 && res.data.totalElements != 0){ if(res.code == 200 && res.data.totalElements != 0){
this.tishiTextShow = false; this.tishiTextShow = false;
this.shuaxinTimer = new Date().getTime(); this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData); that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData,this.leadTime);
}else{ }else{
this.$notify({ this.$notify({
title: '暂无该车辆轨迹信息!', title: '暂无该车辆轨迹信息!',
...@@ -186,7 +192,7 @@ export default { ...@@ -186,7 +192,7 @@ export default {
this.measureDistanceDis = false; this.measureDistanceDis = false;
this.trajectoryTableData = res1.data; this.trajectoryTableData = res1.data;
this.shuaxinTimer = new Date().getTime(); this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData); that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData,this.leadTime);
} }
}) })
}else{ }else{
...@@ -214,7 +220,7 @@ export default { ...@@ -214,7 +220,7 @@ export default {
this.loadData(); this.loadData();
this.tishiTextShow = true; this.tishiTextShow = true;
this.shuaxinTimer = new Date().getTime(); this.shuaxinTimer = new Date().getTime();
this.$refs.mars3dViewerMapMethod.getCoordinate('','',5,'','',[]); this.$refs.mars3dViewerMapMethod.getCoordinate('','',5,'','',[],this.leadTime);
this.measureDistanceDis = true; this.measureDistanceDis = true;
}, },
//获取数据 //获取数据
...@@ -252,7 +258,7 @@ export default { ...@@ -252,7 +258,7 @@ export default {
if(res.code == 200){ if(res.code == 200){
this.tishiTextShow = false; this.tishiTextShow = false;
this.shuaxinTimer = new Date().getTime(); this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,parseFloat(numSpeed1),that.query.bTime,that.query.eTime,this.trajectoryTableData); that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,parseFloat(numSpeed1),that.query.bTime,that.query.eTime,that.trajectoryTableData,that.leadTime);
} }
}) })
} }
...@@ -265,6 +271,22 @@ export default { ...@@ -265,6 +271,22 @@ export default {
measureDistanceClose(){ measureDistanceClose(){
this.$refs.mars3dViewerMapMethod.startDrawGraphic(false); this.$refs.mars3dViewerMapMethod.startDrawGraphic(false);
}, },
//轨迹显示与否
trajectoryShow(boo){
let that = this;
this.leadTime = boo;
if(this.query.number == '' || this.query.bTime == '' || this.query.eTime == ''){
return;
}else{
HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => {
if(res.code == 200){
this.tishiTextShow = false;
this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,that.trajectoryTableData,that.leadTime);
}
})
}
},
// 地图构造完成回调 // 地图构造完成回调
onMapload(map) { onMapload(map) {
// 以下为演示代码 // 以下为演示代码
......
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