From e7cd51ae3099c55d2b177700c290a48ed70c8f3b Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 9 Mar 2022 18:01:42 +0800 Subject: [PATCH 1/6] edit --- .../vehicle-detail.component.ts | 4 +- .../amap-path-simplifier.component.ts | 80 ++++++++++++++++--- 2 files changed, 71 insertions(+), 13 deletions(-) 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 53737f03..585e53cf 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 @@ -79,8 +79,6 @@ export class OrderManagementVehicleDetailComponent implements OnInit { initData() { this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => { if (res) { - console.log(res); - this.i = res; this.pois = [ { @@ -90,7 +88,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit { title: res.startingPoint.detailedAddress }, { - markerLabel: '终', + markerLabel: '卸', color: 'red', position: [res.endPoint.longitude, res.endPoint.latitude], title: res.endPoint.detailedAddress 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 fa6af579..ccac8683 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 @@ -16,9 +16,11 @@ const CONFIG = amapConf; export class AmapPathSimplifierComponent implements OnInit, OnChanges { aMap: any; pathSimplifierIns: any; + geocoder: any; navigator: any; infoWindow: any; markerList: any; + SimpleMarker: any; @Input() pathList: any = []; @Input() @@ -34,6 +36,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { @Input() pois: any = []; + private _pois: any = []; constructor(public service: BaseService) {} ngOnChanges(changes: SimpleChanges): void { @@ -42,20 +45,23 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { this.setPathIndex(this.selectedIndex); } if (changes?.MapList?.currentValue && this?.pathSimplifierIns && changes.MapList?.currentValue.length > 0) { - // console.log(this.MapList); + 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); } - if (changes?.pois?.currentValue && this?.markerList && changes.pois?.currentValue.length > 0) { + if (changes?.pois?.currentValue) { // console.log(this.pois); - this.pois = changes?.pois?.currentValue; - this.markerList.render(this.pois); + this._pois = changes?.pois?.currentValue; + if (this?.markerList && this._pois.length > 0) { + this.markerList.render(this._pois); + } } } ngOnInit(): void { @@ -74,7 +80,8 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { plugins: [ // 需要使用的的插件列表,如比例尺'AMap.Scale'等 'AMap.PathSimplifier', - 'AMap.InfoWindow' + 'AMap.InfoWindow', + 'AMap.Geocoder' ], AMapUI: { version: CONFIG.AMapUIVersion, @@ -91,6 +98,9 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -40) }); + this.geocoder = new AMap.Geocoder({ + radius: 1000 //范围,默认:500 + }); // this.service.msgSrv.info('地图加载完成 !'); this.pathInit(); this.setPOIS(); @@ -122,7 +132,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { //point return pathData.name + ',' + pathData.points[pointIndex].name; } - return pathData.name + ',点数量' + pathData.points?.length; + return ''; }, renderOptions: { renderAllPointsIfNumberBelow: 10 //绘制路线节点,如不需要可设置为-1 @@ -159,7 +169,7 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { recycledMarker.setIconStyle(dataItem.iconStyle); return recycledMarker; } - + this.SimpleMarker = SimpleMarker; //返回一个新的Marker return new SimpleMarker({ //普通文本 @@ -185,9 +195,9 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { } }); - if (this.pois?.length > 0) { + if (this._pois?.length > 0) { //展示该数据 - this.markerList.render(this.pois); + this.markerList.render(this._pois); } }); } @@ -213,10 +223,60 @@ export class AmapPathSimplifierComponent implements OnInit, OnChanges { } } + /** 根据经纬度获取地址信息 */ + getPoiByPositon(position: Array) { + 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 }]; + if (this.markerList) { + this.markerList.render(this._pois); + } + // this.setPOI({ markerLabel: '终', color: 'red', position: position }); + } + }); + } + + /** + * 选中标点,设置窗口信息 + * @param location + */ selectedPOI(location: any) { this.infoWindow.setContent(`地址:
${location.title}
`); this.infoWindow.open(this.aMap, location.position); this.infoWindow.setPosition(location.position); this.aMap.setCenter(location.position); } + + /** + * 增加标记点 + * @param poi + */ + setPOI(poi: POI) { + AMapUI.loadUI(['overlay/SimpleMarker'], (SimpleMarker: any) => { + //启动页面 + new SimpleMarker({ + //普通文本 + iconLabel: { + //普通文本 + innerHTML: poi.markerLabel, + //设置样式 + style: { + color: '#fff', + fontSize: '110%', + marginTop: '2px' + } + }, + iconStyle: poi.color, + map: this.aMap, + position: poi.position + }); + }); + } +} + +export interface POI { + markerLabel: string; + color: string; + position: Array; } From a2abb79379013d97c0cdd141380a32a58522591a Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Wed, 9 Mar 2022 18:04:32 +0800 Subject: [PATCH 2/6] edit --- .../components/close-account/close-account.component.html | 2 +- .../push-invoice/push-invoice.component.html | 5 ++--- .../components/invoice-detail/invoice-detail.component.html | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.html b/src/app/routes/sys-setting/components/close-account/close-account.component.html index 6905e05d..0a4dafb0 100644 --- a/src/app/routes/sys-setting/components/close-account/close-account.component.html +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.html @@ -42,7 +42,7 @@ -
diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html index f4ace5d8..fe19627a 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html @@ -51,7 +51,6 @@ + [res]="{ reName: { list: 'data.records', total: 'data.total' } }" [page]="{ }" [loading]="service.http.loading" + class="mt-md"> \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html index fdd1d5bf..bd97cadf 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html @@ -85,7 +85,7 @@
- @@ -103,11 +103,11 @@ - - Date: Thu, 10 Mar 2022 09:11:02 +0800 Subject: [PATCH 3/6] edit --- .../components/payment-record/payment-record.component.html | 5 ++--- .../components/payment-record/payment-record.component.ts | 6 +----- .../network-freight/network-freight.component.html | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.html b/src/app/routes/financial-management/components/payment-record/payment-record.component.html index 5d57d415..9e0d9a94 100644 --- a/src/app/routes/financial-management/components/payment-record/payment-record.component.html +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.html @@ -36,9 +36,8 @@ {{ item.orderPaymentCode }}
{{ item.paymentStatusLabel }}
- {{item.costName}}:{{ item.price | currency }}
- - 附加费: {{ item.surcharge| currency }} + + {{detail.costName}}:{{ detail.surcharge | currency }}
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 39524123..4de1e25f 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 @@ -252,13 +252,9 @@ export class PaymentRecordComponent implements OnInit { render: 'amountDetails', width: 160, format: item => { - let surcharge = 0; (item.amountDetails as Array).forEach(detail => { - surcharge += detail.surcharge || 0; + detail.surcharge = ((detail.price + (detail.surcharge || 0)) as number).toFixed(2); }); - item.surcharge = surcharge.toFixed(2); - item.price = item.amountDetails?.[0]?.price || 0; - item.costName = item.amountDetails?.[0]?.costName; return ''; } }, diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html index 0fd711da..41e4adf1 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.html +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.html @@ -55,7 +55,7 @@ [scroll]="{ x: '2000px' }" [data]="service.$api_networkTransporter_page" [columns]="columns" - [req]="{ params: reqParams }" + [req]="{ params: reqParams }" [page]="{}" [loading]="service.http.loading" (change)="stChange($event)" > From 18fc33ad0091ea3257c6bee1a7667b2a90c47e60 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 10 Mar 2022 09:13:35 +0800 Subject: [PATCH 4/6] edit --- .../payment-record/payment-record.component.html | 2 +- .../payment-record/payment-record.component.ts | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.html b/src/app/routes/financial-management/components/payment-record/payment-record.component.html index 9e0d9a94..854b1278 100644 --- a/src/app/routes/financial-management/components/payment-record/payment-record.component.html +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.html @@ -37,7 +37,7 @@ - {{detail.costName}}:{{ detail.surcharge | currency }}
+ {{detail.costName}}:{{ detail.price | currency }}
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 4de1e25f..4d32ab42 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 @@ -251,12 +251,14 @@ export class PaymentRecordComponent implements OnInit { title: '运费明细', render: 'amountDetails', width: 160, - format: item => { - (item.amountDetails as Array).forEach(detail => { - detail.surcharge = ((detail.price + (detail.surcharge || 0)) as number).toFixed(2); - }); - return ''; - } + // format: item => { + // (item.amountDetails as Array).forEach(detail => { + // detail.surcharge = detail.price + (detail.surcharge || 0); + // }); + // console.log(item.amountDetails); + + // return ''; + // } }, { title: '支付类型', From fcdc765e691b0f51f5a202b5f1ce9b2f939fdaaa Mon Sep 17 00:00:00 2001 From: Lingzi Date: Thu, 10 Mar 2022 10:13:02 +0800 Subject: [PATCH 5/6] fix style --- src/styles/compact.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/compact.less b/src/styles/compact.less index da8f32a7..a23a3c56 100644 --- a/src/styles/compact.less +++ b/src/styles/compact.less @@ -1,5 +1,5 @@ .alain-pro__sider-logo h1{ - font-size: 15px; + font-size: 15px !important; } .page-header__title{ display: none; From fa6fd671573f83ff6070726bf5758bed269454b7 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 10 Mar 2022 10:13:58 +0800 Subject: [PATCH 6/6] edit --- .../payment-order.component.html | 3 +-- .../payment-order/payment-order.component.ts | 27 +++++++++---------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/app/routes/financial-management/components/payment-order/payment-order.component.html b/src/app/routes/financial-management/components/payment-order/payment-order.component.html index 19dea04f..8de592aa 100644 --- a/src/app/routes/financial-management/components/payment-order/payment-order.component.html +++ b/src/app/routes/financial-management/components/payment-order/payment-order.component.html @@ -8,8 +8,7 @@ [ui]="{ '*': { spanLabelFixed: 110,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true" [button]="'none'"> -
+