diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.ts b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts index 2e32718b..a41bc6e4 100644 --- a/src/app/routes/financial-management/components/payment-record/payment-record.component.ts +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts @@ -82,7 +82,7 @@ export class PaymentRecordComponent implements OnInit { hidden: true } }, - orderSn: { + orderPaymentCode: { type: 'string', title: '支付编号', ui: { diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html index 4a204913..e65eb5c0 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -348,7 +348,7 @@
- +
diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html index 5df8a48e..94efaf7d 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -212,7 +212,7 @@
- +
diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html index bd8aed4e..0554935e 100644 --- a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html @@ -322,7 +322,7 @@
- +
diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html index 5f2cc64f..fd15143d 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html @@ -218,7 +218,7 @@
- +
diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html index c7c4dbbd..1d27458b 100644 --- a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html @@ -16,7 +16,7 @@
- +
diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html index 13710e4c..3c566dc6 100644 --- a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html @@ -236,7 +236,7 @@
- +
diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html index 0395a748..d143b547 100644 --- a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html @@ -216,7 +216,7 @@
- +
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 928a066f..b358e178 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 @@ -3,6 +3,7 @@ import { Component, Input, OnChanges, OnInit, Output, SimpleChanges, EventEmitte import { amapConf } from '@conf/amap.config'; import { throwError } from 'rxjs'; import { BaseService } from 'src/app/shared/services'; +import { InfoItem, MapList, PathList, POI } from '../amap.service'; declare var AMap: any; declare var AMapUI: any; declare var Loca: any; @@ -21,41 +22,49 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy infoWindow: any; markerList: any; SimpleMarker: any; + // 简单路径信息 @Input() - pathList: any = []; + mapList: MapList[] = []; + // 完整路线图信息 + @Input() + pathList: PathList[] = []; + // 当前选中路线图下标 @Input() selectedIndex = 0; + // 标点数组 + @Input() + pois: POI[] = []; + private _pois: any = []; + @Input() mapWidth = '800px'; - @Input() MapList: any; @Input() mapHeight = '500px'; @Output() readonly clcikPointEvent = new EventEmitter(); - @Input() - pois: any = []; - private _pois: any = []; - constructor(public service: BaseService) {} 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) { - // console.log(this.MapList); + // 路径信息变更: 更新路线图, 设置路线图, 指定路线图, 获取终点地址信息并标点 + if (changes?.mapList?.currentValue && this?.pathSimplifierIns && changes.mapList?.currentValue.length > 0) { + // console.log(this.mapList); this.pathList = [ { name: '路线1', - points: changes.MapList?.currentValue + points: changes.mapList?.currentValue } ]; this.setData(this.pathList); this.setPathIndex(this.selectedIndex); - this.getPoiByPositon(this.MapList[this.MapList?.length - 1]?.lnglat); + this.getPoiByPositon(this.mapList[this.mapList?.length - 1]?.lnglat); } + // 标点列表变更: 更新标点数据, 绘画标点 if (changes?.pois?.currentValue) { // console.log(this.pois); this._pois = changes?.pois?.currentValue; @@ -68,11 +77,13 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy this.mapInit(); } ngOnDestroy(): void { + // 销毁地图数据 if (this.aMap) { this.aMap.destroy(); } } + /** 地图初始化 */ mapInit() { AMapLoader.load({ key: CONFIG.key, @@ -94,14 +105,15 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy }); this.aMap.on('complete', () => { + // this.service.msgSrv.info('地图加载完成 !'); // 信息窗口 this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -40) }); + // 初始化定位工具 this.geocoder = new AMap.Geocoder({ - radius: 1000 //范围,默认:500 + radius: 500 //范围,默认:500 }); - // this.service.msgSrv.info('地图加载完成 !'); this.pathInit(); this.setPOIS(); }); @@ -111,34 +123,20 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy }); } + /** 初始化路径工具 */ pathInit() { this.pathSimplifierIns = new AMapUI.PathSimplifier({ zIndex: 100, //autoSetFitView:false, - map: this.aMap, //所属的地图实例 - - getPath: function (pathData: any, pathIndex: any) { - var points = pathData.points, - lnglatList = []; - - for (var i = 0, len = points?.length; i < len; i++) { - lnglatList.push(points[i].lnglat); - } - - return lnglatList; - }, - getHoverTitle: function (pathData: any, pathIndex: any, pointIndex: any) { - if (pointIndex >= 0) { - //point - return `${pathData.name},${pathData.points[pointIndex].name}`; - } - return ''; - }, + map: this.aMap, + // 重组路径数据 + getPath: (pathData: PathList, pathIndex: number) => pathData.points.map(points => points.lnglat), + // 鼠标悬浮事件 + getHoverTitle: (pathData: PathList, pathIndex: number, pointIndex: number) => '', renderOptions: { - renderAllPointsIfNumberBelow: 10 //绘制路线节点,如不需要可设置为-1 + renderAllPointsIfNumberBelow: 20 //绘制路线节点,如不需要可设置为-1 } }); - (window as any).pathSimplifierIns = this.pathSimplifierIns; this.setData(this.pathList); if (this.pathList.length > 0) { @@ -147,26 +145,39 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges, OnDestroy this.pathSimplifierIns.on('pointClick', (e: any, info: any) => { this.clcikPointEvent.emit({ e, info }); - console.log(`Click: ${info.pathData.points[info.pointIndex].name}`); + // 弹出信息窗口 + if (info) { + this.geocoder.getAddress(info.pathData.points[info.pointIndex].lnglat, (status: any, result: any) => { + if (status === 'complete' && result.info === 'OK') { + // result中对应详细地理坐标信息 + this.selectedPOI({ + position: info.pathData.points[info.pointIndex].lnglat, + content: ` +