This commit is contained in:
Taric Xin
2022-02-17 09:22:41 +08:00
parent 6c2271c3d2
commit 8d4fa3553d
3 changed files with 49 additions and 36 deletions

View File

@ -20,7 +20,7 @@ module.exports = {
// } // }
'//api': { '//api': {
target: { target: {
host: 'tms-api-test.eascs.com', host: 'tms-api-dev.eascs.com',
protocol: 'https:', protocol: 'https:',
port: 443 port: 443
}, },

View File

@ -1,5 +1,5 @@
/* /*
* @Description : * @Description :
* @Version : 1.0 * @Version : 1.0
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-28 14:42:03 * @Date : 2021-12-28 14:42:03
@ -60,11 +60,12 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
private msgSrv: NzMessageService, private msgSrv: NzMessageService,
private service: OrderManagementService, private service: OrderManagementService,
private router: Router, private router: Router,
private modal: NzModalService, private modal: NzModalService
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.initData(); this.initData();
this.MapInit();
} }
initData() { initData() {
@ -82,21 +83,21 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
} }
}); });
} }
// 取消订单 // 取消订单
cancellation() { cancellation() {
// api_get_cancelAnOrder // api_get_cancelAnOrder
this.modal.confirm({ this.modal.confirm({
nzTitle: '<b>确定取消该订单吗?</b>', nzTitle: '<b>确定取消该订单吗?</b>',
nzContent: `<b>取消后无法恢复,请确认</b>`, nzContent: `<b>取消后无法恢复,请确认</b>`,
nzOnOk: () => nzOnOk: () =>
this.service.request(this.service.$api_get_cancelAnOrder, {id: this.id}).subscribe((res) => { this.service.request(this.service.$api_get_cancelAnOrder, { id: this.id }).subscribe(res => {
if (res === true) { if (res === true) {
this.service.msgSrv.success('操作成功!'); this.service.msgSrv.success('操作成功!');
this.initData(); this.initData();
} }
}), })
}) });
} }
goBack() { goBack() {
window.history.go(-1); window.history.go(-1);
} }
@ -121,7 +122,7 @@ cancellation() {
goDistance(elf: NzCardComponent) { goDistance(elf: NzCardComponent) {
if (elf) { if (elf) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' , }); elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
// elf['elementRef'].nativeElement.className = 'target-fix' // elf['elementRef'].nativeElement.className = 'target-fix'
} }
} }
@ -137,7 +138,7 @@ cancellation() {
}); });
}); });
console.log(list); console.log(list);
this.MapList = list this.MapList = list;
} }
}); });
} }

View File

@ -16,13 +16,14 @@ const CONFIG = amapConf;
export class AmapPathSimplifierComponent implements OnInit, OnChanges { export class AmapPathSimplifierComponent implements OnInit, OnChanges {
aMap: any; aMap: any;
pathSimplifierIns: any; pathSimplifierIns: any;
navigator: any;
@Input() @Input()
pathList: any = []; pathList: any = [];
@Input() @Input()
selectedIndex = 0; selectedIndex = 0;
@Input() @Input()
mapWidth = '800px'; mapWidth = '800px';
@Input('MapList') MapList: any; @Input() MapList: any;
@Input() @Input()
mapHeight = '500px'; mapHeight = '500px';
@ -35,15 +36,19 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges {
this.setData(changes.pathList?.currentValue); this.setData(changes.pathList?.currentValue);
this.setPathIndex(this.selectedIndex); this.setPathIndex(this.selectedIndex);
} }
if (changes?.MapList?.currentValue && this?.pathSimplifierIns) {
this.pathList = [
{
name: '路线1',
points: changes?.MapList?.currentValue
}
];
this.setData(this.pathList);
this.setPathIndex(this.selectedIndex);
}
} }
ngOnInit(): void { ngOnInit(): void {
this.mapInit(); this.mapInit();
this.pathList = [
{
name: '路线1',
points: this.MapList
}
];
// this.DataInit(); // this.DataInit();
} }
ngOnDestroy(): void { ngOnDestroy(): void {
@ -104,26 +109,20 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges {
return pathData.name + ',点数量' + pathData.points?.length; return pathData.name + ',点数量' + pathData.points?.length;
}, },
renderOptions: { renderOptions: {
renderAllPointsIfNumberBelow: 100 //绘制路线节点,如不需要可设置为-1 renderAllPointsIfNumberBelow: 10 //绘制路线节点,如不需要可设置为-1
} }
}); });
(window as any).pathSimplifierIns = this.pathSimplifierIns; (window as any).pathSimplifierIns = this.pathSimplifierIns;
this.setData(this.pathList); this.setData(this.pathList);
if(this.pathList.length>0){ if (this.pathList.length > 0) {
this.setPathIndex(this.selectedIndex); this.setPathIndex(this.selectedIndex);
} }
this.pathSimplifierIns.on('pointClick', (e: any, info: any) => { this.pathSimplifierIns.on('pointClick', (e: any, info: any) => {
this.clcikPointEvent.emit({ e, info }); this.clcikPointEvent.emit({ e, info });
console.log('Click: ' + info.pathData.points[info.pointIndex].name); console.log('Click: ' + info.pathData.points[info.pointIndex].name);
}); });
// navg1.start();
// var navg1 = this.pathSimplifierIns.createPathNavigator(0, {
// loop: true, //循环播放
// speed: 1000000 //巡航速度,单位千米/小时
// });
// navg1.start();
} }
setData(pathList: Array<any>) { setData(pathList: Array<any>) {
@ -132,5 +131,18 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges {
setPathIndex(index: number) { setPathIndex(index: number) {
this.pathSimplifierIns.setSelectedPathIndex(index); this.pathSimplifierIns.setSelectedPathIndex(index);
this.startNav();
}
startNav() {
if (this.navigator) {
this.navigator.start();
} else {
this.navigator = this.pathSimplifierIns?.createPathNavigator(0, {
loop: true, //循环播放
speed: 1000000 //巡航速度,单位千米/小时
});
this.navigator?.start();
}
} }
} }