From 4ec6d2b7ac8389630ce17c44170956e734eae1b2 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 13 Apr 2022 11:28:54 +0800 Subject: [PATCH] fix bug --- .../datascreen/map/map.component.ts | 22 ++++++------------ .../components/risk/risk.component.ts | 23 +++++++++++++++---- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/app/routes/datatable/components/datascreen/map/map.component.ts b/src/app/routes/datatable/components/datascreen/map/map.component.ts index 4df67fe2..a8e5354e 100644 --- a/src/app/routes/datatable/components/datascreen/map/map.component.ts +++ b/src/app/routes/datatable/components/datascreen/map/map.component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild, AfterViewInit } from '@angular/core'; import { Chart } from '@antv/g2'; import DataSet from '@antv/data-set'; import { DataService } from 'src/app/routes/datatable/services/data.service'; @@ -7,7 +7,7 @@ import { DataService } from 'src/app/routes/datatable/services/data.service'; templateUrl: './map.component.html', styleUrls: ['./map.component.less'] }) -export class DatatableCustomindexMapComponent implements OnInit, OnChanges { +export class DatatableCustomindexMapComponent implements OnInit, OnChanges, AfterViewInit { el: any; @Input() chartData: any; chart: any; @@ -18,6 +18,10 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { userDv: any; userData: any = []; constructor(private service: DataService, private ngZone: NgZone) {} + ngAfterViewInit(): void { + throw new Error('Method not implemented.'); + + } ngOnChanges(changes: SimpleChanges): void { if (this.chartData) { @@ -26,7 +30,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { // }, 1000) } } - + ngOnInit(): void {} reRender() { console.log('5454545'); @@ -84,18 +88,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { stroke: '#ccc', lineWidth: 1 }); - - // 可视化用户数据 - // this.userData = [ - // { name: '山东', value: 21 }, - // { name: '山东', value: 22}, - // { name: '广东', value: 20, }, - // { name: '广东', value: 20 }, - // { name: '四川', value: 120 }, - // { name: '湖南', value: 200 }, - // { name: '河北', value: 30 }, - - // ]; let value: any = [] this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => { if(res) { diff --git a/src/app/routes/order-management/components/risk/risk.component.ts b/src/app/routes/order-management/components/risk/risk.component.ts index dabb3c30..96aca287 100644 --- a/src/app/routes/order-management/components/risk/risk.component.ts +++ b/src/app/routes/order-management/components/risk/risk.component.ts @@ -202,15 +202,28 @@ export class OrderManagementRiskComponent implements OnInit { } as SFSelectWidgetSchema }, shipperId: { - title: '托运人', type: 'string', + title: '托运人', ui: { - widget: 'dict-select', - params: { dictKey: 'BulkFreightUnitPriceType' }, - containsAllLabel: true, + widget: 'select', + serverSearch: true, + searchDebounceTime: 300, + searchLoadingText: '搜索中...', + allowClear: true, visibleIf: { _$expand: (value: boolean) => value - } + }, + onSearch: (q: any) => { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + return this.service + .request(this.service.$api_enterpriceList, { enterpriseName: str }) + .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) + .toPromise(); + } else { + return of([]); + } + }, } as SFSelectWidgetSchema }, enterpriseInfoId: {