From 859da91facab9ea2fab06e6cd364c519f9abc983 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 12 Apr 2022 20:36:42 +0800 Subject: [PATCH 1/3] edit --- proxy.conf.js | 2 +- .../vehicle-detail.component.ts | 11 ++- .../verify-result/verify-result.component.ts | 4 +- .../amap-path-simplifier.component.ts | 68 +++++++++++++------ .../shared/components/amap/amap.service.ts | 4 ++ 5 files changed, 64 insertions(+), 25 deletions(-) diff --git a/proxy.conf.js b/proxy.conf.js index e6de13f2..396f43cd 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -20,7 +20,7 @@ module.exports = { // } '//api': { target: { - host: 'tms-api-test.eascs.com', + host: 'tms-api.yunduoxing.com', protocol: 'https:', port: 443 }, diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index 2b7a6718..65e3a2a4 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -77,16 +77,18 @@ export class OrderManagementVehicleDetailComponent implements OnInit { this.i = res; this.pois = [ { - markerLabel: '起', + markerLabel: '装', color: 'blue', position: [res.startingPoint.longitude, res.startingPoint.latitude], - title: res.startingPoint.detailedAddress + title: '发货地:' + res.startingPoint.detailedAddress, + time: '计划出发时间:' +res.loadPlanTime }, { markerLabel: '卸', color: 'red', position: [res.endPoint.longitude, res.endPoint.latitude], - title: res.endPoint.detailedAddress + title: '卸货地地:' + res.endPoint.detailedAddress, + time: '计划卸货时间:' + res.unloadPlanTime } ]; this.billExpenses = this.i?.billExpenseDetails?.filter( @@ -210,6 +212,9 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } } getLocalTime(time: any) { + if (!time) { + return ''; + } return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); } } diff --git a/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts index ee390253..9bb45bcc 100644 --- a/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts +++ b/src/app/routes/tax-management/components/order-reporting/verify-result/verify-result.component.ts @@ -51,7 +51,7 @@ export class TaxManagementOrderVerifyResultComponent implements OnInit { beforeReq = (requestOptions: STRequestOptions) => {let a: string = ''; switch (this.subjectType) { case '0': - a = this.record?.networkTransporter; + a = this.record?.networkTransporterId; break case '1': a = this.record?.shipperId; @@ -60,7 +60,7 @@ export class TaxManagementOrderVerifyResultComponent implements OnInit { a = this.record?.driverId; break case '3': - a = this.record?.billId; + a = this.record?.wayBillId; break } Object.assign(requestOptions.body, { diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts index efa030e9..f4fe1ecc 100644 --- a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts +++ b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts @@ -48,15 +48,18 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy @Output() readonly clcikPointEvent = new EventEmitter(); - constructor(public service: BaseService, private amapService: AmapService) {} + constructor(public service: BaseService, private amapService: AmapService) { + this.mapInit(); + } ngOnChanges(changes: SimpleChanges): void { // 路线图变更: 设置路线图, 指定路线图 if (changes?.pathList?.currentValue && this?.pathSimplifierIns) { this.setData(changes.pathList?.currentValue); this.setPathIndex(this.selectedIndex); } + // 路径信息变更: 更新路线图, 设置路线图, 指定路线图, 获取终点地址信息并标点 - if (changes?.mapList?.currentValue && this?.pathSimplifierIns && changes.mapList?.currentValue.length > 0) { + if (changes?.mapList?.currentValue) { // console.log(this.mapList); this.pathList = [ { @@ -64,22 +67,30 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy points: changes.mapList?.currentValue } ]; - this.setData(this.pathList); - this.setPathIndex(this.selectedIndex); - this.getPoiByPositon(this.mapList[this.mapList?.length - 1]?.lnglat); + if (this?.pathSimplifierIns) { + this.setData(this.pathList); + if (changes.mapList?.currentValue.length > 0) { + this.setPathIndex(this.selectedIndex); + this.getPoiByPositon('起', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); + this.getPoiByPositon( + '终', + this.mapList[this.mapList?.length - 1]?.lnglat, + '时间:' + this.amapService.formatTime(this.mapList[this.mapList?.length - 1]?.time) + ); + } + } } // 标点列表变更: 更新标点数据, 绘画标点 if (changes?.pois?.currentValue) { - // console.log(this.pois); + console.log(changes?.pois?.currentValue); + this._pois = changes?.pois?.currentValue; if (this?.markerList && this._pois.length > 0) { this.markerList.render(this._pois); } } } - ngOnInit(): void { - this.mapInit(); - } + ngOnInit(): void {} ngOnDestroy(): void { // 销毁地图数据 if (this.aMap) { @@ -145,6 +156,12 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy if (this.pathList.length > 0) { this.setPathIndex(this.selectedIndex); + this.getPoiByPositon('起', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); + this.getPoiByPositon( + '终', + this.mapList[this.mapList?.length - 1]?.lnglat, + '时间:' + this.amapService.formatTime(this.mapList[this.mapList?.length - 1]?.time) + ); } this.pathSimplifierIns.on('pointClick', (e: any, info: any) => { @@ -179,12 +196,13 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy //返回数据项对应的Marker getMarker: (dataItem: POI, context: any, recycledMarker: any) => { //存在可回收利用的marker - if (recycledMarker) { - //直接更新内容返回 - recycledMarker.setIconLabel(context.id); - recycledMarker.setIconStyle(dataItem.color); - return recycledMarker; - } + // if (recycledMarker) { + // //直接更新内容返回 + // recycledMarker.setIconLabel(context.id); + // recycledMarker.setIconStyle(dataItem.color); + // return recycledMarker; + // } + this.SimpleMarker = SimpleMarker; //返回一个新的Marker return new SimpleMarker({ @@ -212,6 +230,8 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy }); if (this._pois?.length > 0) { + console.log(this._pois); + //展示该数据 this.markerList.render(this._pois); } @@ -241,7 +261,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy startNav() { this.navigator = this.pathSimplifierIns?.createPathNavigator(this.selectedIndex, { loop: true, //循环播放 - speed: 500000 * this.navSpeed //巡航速度,单位千米/小时 + speed: 50000 * this.navSpeed //巡航速度,单位千米/小时 }); this.navigator?.start(); } @@ -269,11 +289,14 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy } /** 根据标点经纬度获取地址信息 */ - getPoiByPositon(position: string[]) { + getPoiByPositon(label: string, position: string[], time: string) { this.geocoder.getAddress(position, (status: any, result: any) => { if (status === 'complete' && result.info === 'OK') { // result中对应详细地理坐标信息 - this._pois = [...this.pois, { markerLabel: '终', color: 'red', position: position, title: result.regeocode.formattedAddress }]; + this._pois = [ + ...this.pois, + { markerLabel: label, color: 'red', position, title: result.regeocode.formattedAddress, time } + ]; if (this.markerList) { this.markerList.render(this._pois); } @@ -287,7 +310,14 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy * @param infoItem */ selectedPOI(infoItem: InfoItem) { - this.infoWindow.setContent(infoItem.content || `地址:
${infoItem.title}
`); + this.infoWindow.setContent( + infoItem.content || + ` +
+ 东经:${infoItem.position?.[0]}, 北纬:${infoItem.position?.[1]}
+ ${infoItem.time} + ` + ); this.infoWindow.open(this.aMap, infoItem.position); this.infoWindow.setPosition(infoItem.position); // 地图定位居中 diff --git a/src/app/shared/components/amap/amap.service.ts b/src/app/shared/components/amap/amap.service.ts index f23f503d..6916ebdc 100644 --- a/src/app/shared/components/amap/amap.service.ts +++ b/src/app/shared/components/amap/amap.service.ts @@ -114,6 +114,9 @@ export class AmapService { } formatTime(time: string): string { + if (!time) { + return ''; + } return `${time.slice(0, 4)}-${time.slice(4, 6)}-${time.slice(6, 8)} ${time.slice(9, 11)}:${time.slice(11, 13)}:${time.slice(13, 15)}`; } } @@ -128,6 +131,7 @@ export interface POI { export interface InfoItem { title?: string; content?: string; + time?: string; position: string[]; } From f850722613dbe96862a4c294ce6f202b8031533f Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 12 Apr 2022 20:56:58 +0800 Subject: [PATCH 2/3] edit --- .../bulk-detail-change.component.ts | 6 +- .../bulk-detail/bulk-detail.component.ts | 71 ++++++++++--------- .../vehicle-detail-change.component.ts | 6 +- .../vehicle-detail.component.ts | 3 +- .../view-track/view-track.component.ts | 6 +- .../bulk-detail/bulk-detail.component.ts | 6 +- .../vehicle-detail.component.ts | 6 +- .../amap-path-simplifier.component.ts | 18 ++--- 8 files changed, 68 insertions(+), 54 deletions(-) diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts index 450ff038..1810bbca 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.ts @@ -968,7 +968,8 @@ export class OrderManagementBulkDetailChangeComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; @@ -991,7 +992,8 @@ export class OrderManagementBulkDetailChangeComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts index 5bd52254..a03bad84 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts @@ -25,7 +25,7 @@ import format from 'date-fns/format'; styleUrls: ['./bulk-detail.component.less'] }) export class OrderManagementBulkeDetailComponent implements OnInit { - MapList: any[]=[]; + MapList: any[] = []; id = this.route.snapshot.params.id; billExpenses: any[] = []; //运费信息表格信息 pois: any[] = []; @@ -35,11 +35,11 @@ export class OrderManagementBulkeDetailComponent implements OnInit { totalObj: any; attObj: any; modalcontent: any; - modalTitle:string = ''; + modalTitle: string = ''; isVisible = false; logColumns2: STColumn[] = [ { title: '时间', index: 'vinOutTime' }, - { title: '地点', index: 'cityName' }, + { title: '地点', index: 'cityName' } ]; logColumns: STColumn[] = [ { title: '款项', index: 'expenseCodeLabel' }, @@ -62,20 +62,19 @@ export class OrderManagementBulkeDetailComponent implements OnInit { } ]; trajectory = 'car'; - mapList:any[] = []; //地图点位数据组 - addressItems:any[] = []; //打点地址数据组 + mapList: any[] = []; //地图点位数据组 + addressItems: any[] = []; //打点地址数据组 constructor( public route: ActivatedRoute, private msgSrv: NzMessageService, private service: OrderManagementService, private router: Router, private modal: NzModalService - ) { - } + ) {} ngOnInit(): void { console.log(this.route?.snapshot?.queryParams?.sts); - + this.initData(); this.getTrajectory(); } @@ -85,34 +84,36 @@ export class OrderManagementBulkeDetailComponent implements OnInit { if (res) { this.i = res; this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TRA'); - this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE"); + this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE'); this.pois = [ { - markerLabel: '起', + markerLabel: '装', color: 'blue', position: [res.startingPoint.longitude, res.startingPoint.latitude], - title: res.startingPoint.detailedAddress + title: '发货地:' + res.startingPoint.detailedAddress, + time: '计划出发时间:' + res.loadPlanTime }, { markerLabel: '卸', color: 'red', position: [res.endPoint.longitude, res.endPoint.latitude], - title: res.endPoint.detailedAddress + title: '卸货地地:' + res.endPoint.detailedAddress, + time: '计划卸货时间:' + res.unloadPlanTime } ]; } }); this.service.request(this.service.$api_listBillComplianceAbnormalByBillId, { id: this.id }).subscribe(res => { if (res) { - console.log('风险详情') - console.log(res) - this.abnormalList = res + console.log('风险详情'); + console.log(res); + this.abnormalList = res; } }); this.service.request(this.service.$api_getAbnormalWarningByBillId, { id: this.id }).subscribe(res => { if (res) { - console.log('异常预警') - console.log(res) + console.log('异常预警'); + console.log(res); } }); } @@ -125,12 +126,12 @@ export class OrderManagementBulkeDetailComponent implements OnInit { this.router.navigate(['order-management/bulk-detailChange', this.id]); } agreement(value: any) { - if(value ==='1'){ + if (value === '1') { this.modalTitle = '附件信息'; // this.modalcontent = this.i?.contractContent?.contractContent; // this.service.reviewPDF(this.i?.contractContent?.contractFilePath) this.service.openURL(this.i?.contractContent?.contractFilePath); - }else if(value === '2'){ + } else if (value === '2') { this.modalTitle = '补充协议'; this.modalcontent = this.i?.supplementContent?.contractContent; this.isVisible = true; @@ -164,20 +165,21 @@ export class OrderManagementBulkeDetailComponent implements OnInit { } // 获取车辆轨迹 - getTrajectory(){ + getTrajectory() { this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { if (res) { const points = res.trackArray; - let list :any[] = []; + let list: any[] = []; points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; this.addressItems = res.cityArray; - if(this.addressItems && this.addressItems.length > 0){ + if (this.addressItems && this.addressItems.length > 0) { this.addressItems.forEach(item => { item.vinOutTime = this.getLocalTime(item.vinOutTime); }); @@ -186,21 +188,22 @@ export class OrderManagementBulkeDetailComponent implements OnInit { }); } - // 获取司机轨迹 - getDriverTrajectory(){ + // 获取司机轨迹 + getDriverTrajectory() { this.service.request(this.service.$api_get_getAppDriverPosition, { id: this.id }).subscribe(res => { if (res) { const points = res.tracks; - let list :any[] = []; + let list: any[] = []; points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; this.addressItems = [...res.enclosureDataAppTrack]; - if(this.addressItems && this.addressItems.length > 0){ + if (this.addressItems && this.addressItems.length > 0) { this.addressItems.forEach(item => { item.vinOutTime = this.getLocalTime(item.gtm); item.cityName = item.appAdress; @@ -208,14 +211,14 @@ export class OrderManagementBulkeDetailComponent implements OnInit { } } }); - } - trajectoryChange(event:any){ - if(event ==='car'){ - this.getTrajectory() - }else if(event ==='driver'){ + } + trajectoryChange(event: any) { + if (event === 'car') { + this.getTrajectory(); + } else if (event === 'driver') { this.getDriverTrajectory(); } - } + } getLocalTime(time: any) { return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); } diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts index 0bc13d3a..ab686a33 100644 --- a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.ts @@ -923,7 +923,8 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; @@ -946,7 +947,8 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index 65e3a2a4..ed73f379 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -190,7 +190,8 @@ export class OrderManagementVehicleDetailComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts index 64dff652..a4c5b6a2 100644 --- a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts @@ -65,7 +65,8 @@ export class OneCarOrderViewtrackComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; @@ -88,7 +89,8 @@ export class OneCarOrderViewtrackComponent implements OnInit { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts index 375f357c..f6cf87c7 100644 --- a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts @@ -167,7 +167,8 @@ sureArrive(item: any) { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; @@ -190,7 +191,8 @@ sureArrive(item: any) { points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts index 626eadc9..5a266b42 100644 --- a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts @@ -160,7 +160,8 @@ export class WaybillManagementVehicleDetailComponent implements OnInit, OnDestro points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; @@ -183,7 +184,8 @@ export class WaybillManagementVehicleDetailComponent implements OnInit, OnDestro points?.forEach((item: any) => { list.push({ name: item.hgt, - lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] + lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))], + time: item.gtm }); }); this.mapList = list; diff --git a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts index f4fe1ecc..4bf4469b 100644 --- a/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts +++ b/src/app/shared/components/amap/amap-path-simplifier/amap-path-simplifier.component.ts @@ -71,9 +71,10 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy this.setData(this.pathList); if (changes.mapList?.currentValue.length > 0) { this.setPathIndex(this.selectedIndex); - this.getPoiByPositon('起', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); + this.getPoiByPositon('起', 'blue', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); this.getPoiByPositon( '终', + 'red', this.mapList[this.mapList?.length - 1]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[this.mapList?.length - 1]?.time) ); @@ -82,8 +83,6 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy } // 标点列表变更: 更新标点数据, 绘画标点 if (changes?.pois?.currentValue) { - console.log(changes?.pois?.currentValue); - this._pois = changes?.pois?.currentValue; if (this?.markerList && this._pois.length > 0) { this.markerList.render(this._pois); @@ -156,9 +155,10 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy if (this.pathList.length > 0) { this.setPathIndex(this.selectedIndex); - this.getPoiByPositon('起', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); + this.getPoiByPositon('起', 'blue', this.mapList[0]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[0]?.time)); this.getPoiByPositon( '终', + 'red', this.mapList[this.mapList?.length - 1]?.lnglat, '时间:' + this.amapService.formatTime(this.mapList[this.mapList?.length - 1]?.time) ); @@ -176,6 +176,9 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy content: `