This commit is contained in:
wangshiming
2022-02-22 10:16:19 +08:00
parent 478739e51a
commit 67bb8b3ccf
3 changed files with 80 additions and 50 deletions

View File

@ -55,8 +55,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
}
}
];
trajectory = "car"
addressItems:any[] = []; //打点地址数据组
trajectory = 'car';
addressItems: any[] = []; //打点地址数据组
constructor(
private route: ActivatedRoute,
@ -145,9 +145,9 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
// }
// });
// }
// 获取轨迹
MapInit(){
MapInit() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
@ -158,7 +158,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
});
});
this.addressItems = res.parkArray;
if(this.addressItems && this.addressItems.length > 0){
if (this.addressItems && this.addressItems.length > 0) {
this.addressItems.forEach(item => {
item.parkBte = this.getLocalTime(item.parkBte);
item.parkEte = this.getLocalTime(item.parkEte);
@ -167,9 +167,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
}
});
}
getLocalTime(time:any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
}