This commit is contained in:
wangshiming
2022-04-13 11:28:54 +08:00
parent 5336f93d0a
commit 4ec6d2b7ac
2 changed files with 25 additions and 20 deletions

View File

@ -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 { Chart } from '@antv/g2';
import DataSet from '@antv/data-set'; import DataSet from '@antv/data-set';
import { DataService } from 'src/app/routes/datatable/services/data.service'; 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', templateUrl: './map.component.html',
styleUrls: ['./map.component.less'] styleUrls: ['./map.component.less']
}) })
export class DatatableCustomindexMapComponent implements OnInit, OnChanges { export class DatatableCustomindexMapComponent implements OnInit, OnChanges, AfterViewInit {
el: any; el: any;
@Input() chartData: any; @Input() chartData: any;
chart: any; chart: any;
@ -18,6 +18,10 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
userDv: any; userDv: any;
userData: any = []; userData: any = [];
constructor(private service: DataService, private ngZone: NgZone) {} constructor(private service: DataService, private ngZone: NgZone) {}
ngAfterViewInit(): void {
throw new Error('Method not implemented.');
}
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (this.chartData) { if (this.chartData) {
@ -26,7 +30,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
// }, 1000) // }, 1000)
} }
} }
ngOnInit(): void {} ngOnInit(): void {}
reRender() { reRender() {
console.log('5454545'); console.log('5454545');
@ -84,18 +88,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
stroke: '#ccc', stroke: '#ccc',
lineWidth: 1 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 = [] let value: any = []
this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => { this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => {
if(res) { if(res) {

View File

@ -202,15 +202,28 @@ export class OrderManagementRiskComponent implements OnInit {
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
shipperId: { shipperId: {
title: '托运人',
type: 'string', type: 'string',
title: '托运人',
ui: { ui: {
widget: 'dict-select', widget: 'select',
params: { dictKey: 'BulkFreightUnitPriceType' }, serverSearch: true,
containsAllLabel: true, searchDebounceTime: 300,
searchLoadingText: '搜索中...',
allowClear: true,
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$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 } as SFSelectWidgetSchema
}, },
enterpriseInfoId: { enterpriseInfoId: {