Commit 2782e9a4 authored by xxx's avatar xxx

1

parent 5b9b2c40
......@@ -103,6 +103,8 @@ export default {
playtimeTableData:[],
//暂停继续按钮判断
pauseResumeBoolean:true,
//右侧播放时间列表第一条数据时间
playtimeTableFirstTimeData:'',
}
},
mounted() {
......@@ -213,6 +215,8 @@ export default {
lastData1.push(obj1);
})
this.playtimeTableData = lastData1;
let time1 = lastData1[0].bTime.split(' ')[0];
this.playtimeTableFirstTimeData = time1;
}
})
}else{
......@@ -338,17 +342,29 @@ export default {
},
//轨迹时间点跳转
trajectoryTimePointFn(){
console.log(this.trajectoryTimePoint);
// if(this.query.number == '' || !this.query.bTime || !this.query.eTime){
// return;
// }else{
// if(!this.trajectoryTimePoint){
// return
// }else{
// this.$refs.mars3dViewerMapMethod.changeTime(this.trajectoryTimePoint);
// this.trajectoryTimePoint = '';
// }
// }
let time2 = this.currentTime(this.trajectoryTimePoint);
let time3 = '';
if(this.playtimeTableFirstTimeData){
time3 = this.playtimeTableFirstTimeData + ' ' + time2;
}else{
this.$notify({
title: '请等待右侧列表加载完毕然后选择轨迹时间点!',
type: 'warning',
duration: 2500
});
this.trajectoryTimePoint = '';
return
}
if(this.query.number == '' || !this.query.bTime || !this.query.eTime){
return;
}else{
if(!this.trajectoryTimePoint){
return
}else{
this.$refs.mars3dViewerMapMethod.changeTime(time3);
this.trajectoryTimePoint = '';
}
}
},
// 地图构造完成回调
onMapload(map) {
......@@ -386,6 +402,39 @@ export default {
}
])
},
//转换时间格式
currentTime(time){
var date = new Date(time);
var year = date.getFullYear(); //年 ,从 Date 对象以四位数字返回年份
var month = date.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
var day = date.getDate(); //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
var hours = date.getHours(); //小时 ,返回 Date 对象的小时 (0 ~ 23)
var minutes = date.getMinutes(); //分钟 ,返回 Date 对象的分钟 (0 ~ 59)
var seconds = date.getSeconds(); //秒 ,返回 Date 对象的秒数 (0 ~ 59)
//修改月份格式
if (month >= 1 && month <= 9) {
month = "0" + month;
}
//修改日期格式
if (day >= 0 && day <= 9) {
day = "0" + day;
}
//修改小时格式
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
//修改分钟格式
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
//修改秒格式
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
//获取当前系统时间 格式(yyyy-mm-dd hh:mm:ss)
let currentFormatDate = hours + ":" + minutes + ":" + seconds;
return currentFormatDate;
}
}
}
</script>
......
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