fix bug
This commit is contained in:
@ -93,7 +93,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<nz-card>
|
<nz-card>
|
||||||
<nz-row [nzGutter]="24">
|
<nz-row [nzGutter]="24">
|
||||||
<g2-bar #bar height="350" [delay]="200" repaint="true" [title]="'本月发货量排名'" [data]="salesData2" (ready)="genData()"></g2-bar>
|
<g2-bar #bar height="350" [delay]="300" repaint="true" [title]="'本月发货量排名'" [data]="salesData2" (ready)="genData()"></g2-bar>
|
||||||
</nz-row>
|
</nz-row>
|
||||||
</nz-card>
|
</nz-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { map } from 'rxjs/operators';
|
|||||||
* @Author : Shiming
|
* @Author : Shiming
|
||||||
* @Date : 2022-04-06 10:57:56
|
* @Date : 2022-04-06 10:57:56
|
||||||
* @LastEditors : Shiming
|
* @LastEditors : Shiming
|
||||||
* @LastEditTime : 2022-04-14 14:05:01
|
* @LastEditTime : 2022-04-14 16:19:06
|
||||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts
|
||||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
*/
|
*/
|
||||||
@ -44,7 +44,7 @@ export class DatatableDatascreenComponent implements OnInit {
|
|||||||
|
|
||||||
monthData: G2TimelineData[] = [];
|
monthData: G2TimelineData[] = [];
|
||||||
monthData2:G2TimelineData[] =[];
|
monthData2:G2TimelineData[] =[];
|
||||||
salesData2: Array<any> = this.genData();
|
salesData2: Array<any> = [];
|
||||||
constructor(public service: DataService) {}
|
constructor(public service: DataService) {}
|
||||||
ngOnChanges(changes: any): void {
|
ngOnChanges(changes: any): void {
|
||||||
console.log(changes);
|
console.log(changes);
|
||||||
@ -81,6 +81,7 @@ export class DatatableDatascreenComponent implements OnInit {
|
|||||||
this.service.request(this.service.$api_getAnnualTransactions).subscribe((res: any) => {
|
this.service.request(this.service.$api_getAnnualTransactions).subscribe((res: any) => {
|
||||||
this.allDeal = res;
|
this.allDeal = res;
|
||||||
});
|
});
|
||||||
|
this.initPillarData()
|
||||||
this.service.request(this.service.$api_getTransactionAmount).subscribe((res: any) => {
|
this.service.request(this.service.$api_getTransactionAmount).subscribe((res: any) => {
|
||||||
this.headDeal = res;
|
this.headDeal = res;
|
||||||
});
|
});
|
||||||
@ -105,8 +106,12 @@ export class DatatableDatascreenComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public genData(): G2MiniAreaData[] {
|
genData(): any{
|
||||||
let value: any = [];
|
let value: any = [];
|
||||||
|
console.log('9999999');
|
||||||
|
|
||||||
|
// let value: any = [{city: '深圳市', weight: 5070.4}
|
||||||
|
// ,{city: '济宁市', weight: 338}];
|
||||||
this.service.request(this.service.$api_getShipmentRanking).subscribe((res: any) => {
|
this.service.request(this.service.$api_getShipmentRanking).subscribe((res: any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
res.forEach((element: any) => {
|
res.forEach((element: any) => {
|
||||||
@ -115,12 +120,13 @@ export class DatatableDatascreenComponent implements OnInit {
|
|||||||
y: element.weight
|
y: element.weight
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
this.salesData2 = value
|
||||||
});
|
});
|
||||||
console.log(value);
|
console.log(value);
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
initPillarData(){
|
initPillarData(){
|
||||||
this.curve.reRender()
|
// this.curve.reRender()
|
||||||
|
this.genData();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 初始化数据列表
|
* 初始化数据列表
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges, Afte
|
|||||||
constructor(private service: DataService, private ngZone: NgZone) {}
|
constructor(private service: DataService, private ngZone: NgZone) {}
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.map.el.nativeElement.style.height = this.map.el.nativeElement.clientWidth + 'px'
|
this.map.el.nativeElement.style.height = this.map.el.nativeElement.clientWidth + 'px'
|
||||||
this.chart.render();
|
this.chart?.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@ -35,7 +35,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges, Afte
|
|||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
reRender() {
|
reRender() {
|
||||||
console.log('5454545');
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.chart.render();
|
this.chart.render();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@ -75,7 +74,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges, Afte
|
|||||||
this.chart.legend('trend', {
|
this.chart.legend('trend', {
|
||||||
position: 'left'
|
position: 'left'
|
||||||
});
|
});
|
||||||
console.log('8888');
|
|
||||||
|
|
||||||
// 绘制世界地图背景
|
// 绘制世界地图背景
|
||||||
this.ds = new DataSet();
|
this.ds = new DataSet();
|
||||||
@ -99,7 +97,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges, Afte
|
|||||||
'订单数': element.weight,
|
'订单数': element.weight,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log(value);
|
|
||||||
this.userData = value
|
this.userData = value
|
||||||
|
|
||||||
if (!(this.userData instanceof Array) || this.userData.length === 0) {
|
if (!(this.userData instanceof Array) || this.userData.length === 0) {
|
||||||
@ -113,7 +110,6 @@ if (!(this.userData instanceof Array) || this.userData.length === 0) {
|
|||||||
}).transform({
|
}).transform({
|
||||||
type: 'map',
|
type: 'map',
|
||||||
callback: (obj: { trend: string; 订单数: number }) => {
|
callback: (obj: { trend: string; 订单数: number }) => {
|
||||||
console.log(obj);
|
|
||||||
|
|
||||||
if(obj.订单数 < 500) {
|
if(obj.订单数 < 500) {
|
||||||
obj.trend = '500以下';
|
obj.trend = '500以下';
|
||||||
@ -132,9 +128,6 @@ if (!(this.userData instanceof Array) || this.userData.length === 0) {
|
|||||||
alias: '订单交易数量'
|
alias: '订单交易数量'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(this.userView);
|
|
||||||
console.log('45545');
|
|
||||||
|
|
||||||
this.userView.polygon().position('longitude*latitude').color('trend', ['#0a3f80', '#1b6aca', '#5d93d4']).tooltip('省份*订单数').style({fillOpacity: 0.85 })
|
this.userView.polygon().position('longitude*latitude').color('trend', ['#0a3f80', '#1b6aca', '#5d93d4']).tooltip('省份*订单数').style({fillOpacity: 0.85 })
|
||||||
.animate({
|
.animate({
|
||||||
leave: {
|
leave: {
|
||||||
@ -147,10 +140,6 @@ if (!(this.userData instanceof Array) || this.userData.length === 0) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('9999');
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user