diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.ts b/src/app/routes/datatable/components/dataindex/dataindex.component.ts index 12562a13..e8a6ee5f 100644 --- a/src/app/routes/datatable/components/dataindex/dataindex.component.ts +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.ts @@ -53,7 +53,9 @@ export class DatatableDataindexComponent implements OnInit, AfterViewInit { this.service.request(this.service.$api_total_advance_deposit).subscribe((res: DataTotalVO) => { if (res) { this.totalAdvanceDeposit = this.formatMiniAreaData(res); - this.initAreaMap(this.AdvanceDeposit['el'].nativeElement as any, []); + setTimeout(() => { + this.initAreaMap(this.AdvanceDeposit['el'].nativeElement as any, []); + }, 400); } }); // 业绩量总额 @@ -82,8 +84,9 @@ export class DatatableDataindexComponent implements OnInit, AfterViewInit { if (res) { const billTypeDatas2 = this.formatCoordinateData(res); console.log(billTypeDatas2); - - this.initBillChart(this.g2custom['el'].nativeElement as any, billTypeDatas2); + setTimeout(() => { + this.initBillChart(this.g2custom['el'].nativeElement as any, billTypeDatas2); + }, 100); } }); // 大区业绩完成情况 @@ -92,30 +95,35 @@ export class DatatableDataindexComponent implements OnInit, AfterViewInit { // this.regionalPerformanceCompletion = res.map(item => ({ ...item, time: new Date(item.time)?.getTime() })); // this.initRegionalPerformanceChart(this.RegionalPerforman['el'].nativeElement as any, this.regionalPerformanceCompletion); this.regionalPerformanceCompletion = this.formatBarData(res); - this.initBiaxialChart(this.RegionalPerforman['el'].nativeElement as any, this.regionalPerformanceCompletion, { - y1Title: '业绩量(万)', - y2Title: '业绩完成率', - y3Title: '同期业绩完成率' - }); + setTimeout(() => { + this.initBiaxialChart(this.RegionalPerforman['el'].nativeElement as any, this.regionalPerformanceCompletion, { + y1Title: '业绩量(万)', + y2Title: '业绩完成率', + y3Title: '同期业绩完成率' + }); + }, 100); } }); // 订单类型比例 this.service.request(this.service.$api_getWayBillDirectProportion).subscribe(res => { if (res) { const billTypeDatas = this.formatCoordinateData(res.map((item: any) => ({ ...item, billType: item.wayBillType }))); - console.log(billTypeDatas); - this.initBillChart(this.BillDirectProportion['el'].nativeElement as any, billTypeDatas); + setTimeout(() => { + this.initBillChart(this.BillDirectProportion['el'].nativeElement as any, billTypeDatas); + }, 100); } }); // 统计订单结算金额-趋势 this.service.request(this.service.$api_get_bill_payment_amount).subscribe(res => { if (res) { this.salesData = this.formatBarData(res); - this.initBiaxialChart(this.SaleProportion['el'].nativeElement as any, this.salesData, { - y1Title: '业绩量(万)', - y2Title: '业绩完成率', - y3Title: '同期业绩完成率' - }); + setTimeout(() => { + this.initBiaxialChart(this.SaleProportion['el'].nativeElement as any, this.salesData, { + y1Title: '业绩量(万)', + y2Title: '业绩完成率', + y3Title: '同期业绩完成率' + }); + }, 100); } }); }