Commit 1d37b390 authored by xxx's avatar xxx

1

parent ace0d20b
...@@ -43,6 +43,8 @@ export default { ...@@ -43,6 +43,8 @@ export default {
weilanName:[], weilanName:[],
carNumber:'', carNumber:'',
carPlaySpeed:5, carPlaySpeed:5,
stopPointData:[],
leadTime:false,
} }
}, },
...@@ -85,25 +87,15 @@ export default { ...@@ -85,25 +87,15 @@ export default {
methods: { methods: {
//获取数据 //获取数据
getCoordinate(equipmentName,number,speed,bTime,eTime) { getCoordinate(equipmentName,number,speed,bTime,eTime,stopPointData) {
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;
//获取历史轨迹 //获取历史轨迹
if(number == ''){ if(number == ''){
// this.$nextTick(()=>{ return
// if (this.appendToBody) {
// document.body.appendChild(this.$el)
// }
// if (this.mapKey) {
// this.initMars3d(this.options)
// } else {
// mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
// this.initMars3d(data.map3d)// 构建地图
// })
// }
// })
}else{ }else{
if(that.deviceId == '' || that.deviceId == undefined){ if(that.deviceId == '' || that.deviceId == undefined){
this.$notify({ this.$notify({
...@@ -121,7 +113,6 @@ export default { ...@@ -121,7 +113,6 @@ export default {
duration: 2500 duration: 2500
}); });
}else{ }else{
let obj1 = {}; let obj1 = {};
let array1 = []; let array1 = [];
res.data.line.forEach((item,index)=>{ res.data.line.forEach((item,index)=>{
...@@ -192,6 +183,13 @@ export default { ...@@ -192,6 +183,13 @@ export default {
that.addGraphic_02(graphicLayer2,item.arrays,that.carNumber); that.addGraphic_02(graphicLayer2,item.arrays,that.carNumber);
}) })
that.stopPointData.forEach((item,index)=>{
var graphicLayer2 = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer2);
initGraphicManager(graphicLayer2);
that.addDemoGraphic1(graphicLayer2,item.lon,item.lat,item.alarmTime,item.time);
})
// 抛出事件 // 抛出事件
this.$emit('onload', map) this.$emit('onload', map)
}, },
...@@ -212,10 +210,10 @@ export default { ...@@ -212,10 +210,10 @@ export default {
var graphic = new mars3d.graphic.PathEntity({ var graphic = new mars3d.graphic.PathEntity({
position: property, position: property,
style: { style: {
width: 3, width: 4,
color: "#8a2e3b", color: "rgb(251,84,48)",
opacity: 1.0, opacity: 1.0,
leadTime: 0, // 前方的路线不显示 leadTime: that.leadTime ? 9999 : 0, // 前方的路线不显示
//高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用 //高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight: { highlight: {
type: mars3d.EventType.click, type: mars3d.EventType.click,
...@@ -223,10 +221,9 @@ export default { ...@@ -223,10 +221,9 @@ export default {
}, },
}, },
label: { label: {
text: truckName, //text: truckName,
font_size: 22, font_size: 22,
font_family: "楷体", font_family: "楷体",
color: "#ff0000",
color: Cesium.Color.AZURE, color: Cesium.Color.AZURE,
outline: true, outline: true,
outlineColor: Cesium.Color.BLACK, outlineColor: Cesium.Color.BLACK,
...@@ -237,85 +234,40 @@ export default { ...@@ -237,85 +234,40 @@ export default {
}, },
model: { model: {
url: '//data.mars3d.cn/gltf/mars/car/tufangche.glb', url: '//data.mars3d.cn/gltf/mars/car/tufangche.glb',
scale: 1, scale: 0.1,
minimumPixelSize: 50, minimumPixelSize: 50,
}, },
}); });
graphicLayer2.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer) graphicLayer2.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
}, },
//车辆轨迹2 //停车区域
initPath(graphicLayer2,positions,truckName) { addDemoGraphic1(graphicLayer,x,y,alarmTime,time) {
const property = new Cesium.SampledPositionProperty() const graphic = new mars3d.graphic.CircleEntity({
property.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD position: [x, y, 10000],
let start;
let stop;
for (let i = 0, len = positions.length; i < len; i++) {
const item = positions[i];
const lng = Number(item[0].toFixed(6)) // 经度
const lat = Number(item[1].toFixed(6)) // 纬度
const height = item[2] // 高度
const time = item[3] // 时间
let position = null
if (lng && lat) {
position = Cesium.Cartesian3.fromDegrees(lng, lat, height)
}
let juliaDate = null
if (time) {
juliaDate = Cesium.JulianDate.fromIso8601(time)
}
if (position && juliaDate) {
property.addSample(juliaDate, position)
}
if (i == 0) {
start = juliaDate
} else if (i == len - 1) {
stop = juliaDate
}
}
// 设置时钟属性
map.clock.startTime = start.clone()
map.clock.stopTime = stop.clone()
map.clock.currentTime = start.clone()
map.clock.clockRange = Cesium.ClockRange.LOOP_STOP
map.clock.multiplier = 5
if (map.controls.timeline) {
map.controls.timeline.zoomTo(start, stop)
}
// 创建path对象
pathEntity = new mars3d.graphic.PathEntity({
position: property,
orientation: new Cesium.VelocityOrientationProperty(property),
style: { style: {
width: 3, radius: 5.0,
color: "#ff0000", color: "#00ff00",
opacity: 1.0, opacity: 0.2,
leadTime: 0, // 前方的路线不显示
},
label: {
text: truckName,
font_size: 22,
font_family: "楷体",
color: "#ff0000",
outline: true, outline: true,
outlineColor: Cesium.Color.BLACK, outlineWidth: 3,
outlineWidth: 2, outlineColor: "#ffffff",
horizontalOrigin: Cesium.HorizontalOrigin.CENTER, clampToGround: true,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, label: {
pixelOffset: new Cesium.Cartesian2(10, -25) // 偏移量 text: alarmTime + "\n停车" + time + '分钟',
}, font_size: 16,
model: { color: Cesium.Color.AZURE,
url: '//data.mars3d.cn/gltf/mars/car/tufangche.glb', outline: true,
scale: 1, outlineColor: Cesium.Color.BLACK,
minimumPixelSize: 50, outlineWidth: 2,
pixelOffsetY: 0,
distanceDisplayCondition: true,
distanceDisplayCondition_far: 500000,
distanceDisplayCondition_near: 0
}
}, },
}) })
graphicLayer2.addGraphic(pathEntity) graphicLayer.addGraphic(graphic)
}, },
getSampledPositionProperty(points){ getSampledPositionProperty(points){
let property = new Cesium.SampledPositionProperty(); let property = new Cesium.SampledPositionProperty();
......
This diff is collapsed.
...@@ -8,21 +8,38 @@ ...@@ -8,21 +8,38 @@
<div style="font-size:18px;font-weight:bold;margin-bottom:10px;">车辆历史轨迹查询</div> <div style="font-size:18px;font-weight:bold;margin-bottom:10px;">车辆历史轨迹查询</div>
<el-form-item label="车辆牌号" style="display: inline-block;"> <el-form-item label="*开始时间" style="display: inline-block;">
<el-date-picker v-model="query.bTime" type="datetime" placeholder="选择开始时间"></el-date-picker>
</el-form-item>
<el-form-item label="*结束时间" style="display: inline-block;">
<el-date-picker v-model="query.eTime" type="datetime" placeholder="选择结束时间"></el-date-picker>
</el-form-item>
<el-form-item label="选择矿区" style="display: inline-block;">
<el-select v-model="query.area" placeholder="请选择矿区">
<el-option v-for="(obj,index) in areaInformationData" :label="obj" :value="obj" :key="index"></el-option>
</el-select>
</el-form-item>
<br>
<el-form-item label="*车辆牌号" style="display: inline-block;">
<el-select v-model="query.number" placeholder="请选择车辆牌号"> <el-select v-model="query.number" placeholder="请选择车辆牌号">
<el-option v-for="(obj,index) in carInformationData" :label="obj.number" :value="obj.number" :key="index"></el-option> <el-option v-for="(obj,index) in carInformationData" :label="obj.number" :value="obj.number" :key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="开始时间" style="display: inline-block;"> <el-form-item label="相关挖机" style="display: inline-block;">
<el-date-picker v-model="query.bTime" type="datetime" placeholder="选择开始时间"></el-date-picker> <el-input v-model="query.dig"></el-input>
</el-form-item>
<el-form-item label="结束时间" style="display: inline-block;">
<el-date-picker v-model="query.eTime" type="datetime" placeholder="选择结束时间"></el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" icon="el-icon-search" @click="toSearch" style="display: inline-block;">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="toSearch" style="display: inline-block;">搜索</el-button>
<el-button icon="el-icon-refresh" @click="clearLimit" style="display: inline-block;">重置</el-button> <el-button icon="el-icon-refresh" @click="clearLimit" style="display: inline-block;">清除所有痕迹</el-button>
<!-- <el-form-item label="测量距离" style="display: inline-block;">
<el-button type="primary" @click="measureDistance()" plain>开测距</el-button>
</el-form-item> -->
<br> <br>
...@@ -32,6 +49,7 @@ ...@@ -32,6 +49,7 @@
<el-option label="4倍" value="4"></el-option> <el-option label="4倍" value="4"></el-option>
<el-option label="8倍" value="8"></el-option> <el-option label="8倍" value="8"></el-option>
<el-option label="16倍" value="16"></el-option> <el-option label="16倍" value="16"></el-option>
<el-option label="32倍" value="32"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -39,6 +57,13 @@ ...@@ -39,6 +57,13 @@
<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"/>
</div> </div>
<div class="trajectoryTableView">
<div style="font-size:20px;font-weight: 600;">播放时间</div>
<div v-for="(obj,index) in trajectoryTableData" :key="index" style="display:flex;justify-content: space-between;margin-top: 1vh;">
<div>{{obj.alarmTime}}</div>
<div>停止{{obj.time}}分钟</div>
</div>
</div>
<div class="tishiTextStyle" v-if="tishiTextShow">请选择车辆查看轨迹</div> <div class="tishiTextStyle" v-if="tishiTextShow">请选择车辆查看轨迹</div>
</div> </div>
</div> </div>
...@@ -65,6 +90,8 @@ export default { ...@@ -65,6 +90,8 @@ export default {
number:'', number:'',
bTime:'', bTime:'',
eTime:'', eTime:'',
area:'所有矿区',
dig:'',
playSpeed:'1', playSpeed:'1',
}, },
carInformationData:[], carInformationData:[],
...@@ -72,6 +99,7 @@ export default { ...@@ -72,6 +99,7 @@ export default {
shuaxinTimer:null, shuaxinTimer:null,
playSpeedNum:5, playSpeedNum:5,
tishiTextShow:true, tishiTextShow:true,
trajectoryTableData:[],
} }
}, },
mounted() { mounted() {
...@@ -79,11 +107,35 @@ export default { ...@@ -79,11 +107,35 @@ export default {
this.loadData(); this.loadData();
if(this.$route.query.number){ if(this.$route.query.number){
this.query.number = this.$route.query.number; this.query.number = this.$route.query.number;
if(this.query.number == ''){
this.$notify({
title: '请选择车辆牌号!',
type: 'warning',
duration: 2500
});
return
}
if(this.query.bTime == ''){
this.$notify({
title: '请选择开始时间!',
type: 'warning',
duration: 2500
});
return
}
if(this.query.eTime == ''){
this.$notify({
title: '请选择结束时间!',
type: 'warning',
duration: 2500
});
return
}
HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => { HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => {
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); that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData);
}else{ }else{
this.$notify({ this.$notify({
title: '暂无该车辆轨迹信息!', title: '暂无该车辆轨迹信息!',
...@@ -98,11 +150,42 @@ export default { ...@@ -98,11 +150,42 @@ export default {
// 点击搜索 // 点击搜索
toSearch() { toSearch() {
let that = this; let that = this;
if(this.query.number == ''){
this.$notify({
title: '请选择车辆牌号!',
type: 'warning',
duration: 2500
});
return
}
if(this.query.bTime == ''){
this.$notify({
title: '请选择开始时间!',
type: 'warning',
duration: 2500
});
return
}
if(this.query.eTime == ''){
this.$notify({
title: '请选择结束时间!',
type: 'warning',
duration: 2500
});
return
}
//获取地图
HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => { HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => {
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(); //获取列表
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime); HttpReq.truckDispatching.mineAlarmHistoryCountQuery({number:this.query.number,bTime:this.query.bTime,eTime:this.query.eTime}).then((res1) => {
if(res1.code == 200){
this.trajectoryTableData = res1.data;
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);
}
})
}else{ }else{
this.$notify({ this.$notify({
title: '暂无该车辆轨迹信息!', title: '暂无该车辆轨迹信息!',
...@@ -111,6 +194,7 @@ export default { ...@@ -111,6 +194,7 @@ export default {
}); });
} }
}) })
}, },
// 重置搜索 // 重置搜索
clearLimit(){ clearLimit(){
...@@ -118,17 +202,19 @@ export default { ...@@ -118,17 +202,19 @@ export default {
number:'', number:'',
bTime:'', bTime:'',
eTime:'', eTime:'',
area:'所有矿区',
dig:'',
playSpeed:'1', playSpeed:'1',
}; };
this.playSpeedNum = 5; this.playSpeedNum = 5;
this.trajectoryTableData = [];
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,'','',[]);
}, },
//获取数据 //获取数据
loadData() { loadData() {
this.$nextTick(()=>{ this.$nextTick(()=>{
//获取车辆信息 //获取车辆信息
HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => { HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => {
...@@ -139,9 +225,14 @@ export default { ...@@ -139,9 +225,14 @@ export default {
//获取区域信息 //获取区域信息
HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => { HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.areaInformationData = res.data.content; let arr1 = ['所有矿区'];
res.data.content.forEach((item,index)=>{
arr1.push(item.name)
})
this.areaInformationData = arr1;
} }
}) })
}) })
}, },
...@@ -150,17 +241,21 @@ export default { ...@@ -150,17 +241,21 @@ export default {
let that = this; let that = this;
let numSpeed1 = 5 / parseFloat(this.query.playSpeed); let numSpeed1 = 5 / parseFloat(this.query.playSpeed);
this.playSpeedNum = parseFloat(numSpeed1); this.playSpeedNum = parseFloat(numSpeed1);
if(this.query.number == ''){ if(this.query.number == '' || this.query.bTime == '' || this.query.eTime == ''){
return; return;
}else{ }else{
HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => { HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => {
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); that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,parseFloat(numSpeed1),that.query.bTime,that.query.eTime,this.trajectoryTableData);
} }
}) })
} }
},
//测量距离
measureDistance(){
}, },
// 地图构造完成回调 // 地图构造完成回调
onMapload(map) { onMapload(map) {
...@@ -207,8 +302,8 @@ export default { ...@@ -207,8 +302,8 @@ export default {
.device-manage{ .device-manage{
.mapcontainer2{ .mapcontainer2{
border: 1px blue solid; border: 1px blue solid;
width: 80vw; width: 65vw;
height: 65.5vh; height: 61vh;
overflow: hidden; overflow: hidden;
} }
.tishiTextStyle{ .tishiTextStyle{
...@@ -217,10 +312,21 @@ export default { ...@@ -217,10 +312,21 @@ export default {
font-weight: 600; font-weight: 600;
letter-spacing: 3px; letter-spacing: 3px;
position: absolute; position: absolute;
top: 50%; top: 55%;
left: 50%; left: 45%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.trajectoryTableView{
position: absolute;
right: 1vw;
bottom: 0.1vh;
width: 16vw;
height: 61vh;
padding: 1vh 1vh;
box-sizing: border-box;
border: 1px gainsboro solid;
overflow-y: scroll;
}
} }
......
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