This commit is contained in:
Lingzi
2022-04-06 10:57:58 +08:00
parent a2becf2105
commit 5a2a668168
8 changed files with 13 additions and 20 deletions

View File

@ -25,10 +25,9 @@ export class DatatableBusiindexComponent implements OnInit {
dateNext: any = null;
modeNext = 'year';
timeNext: any = ['2022-01-01 00:00:00']
dateFormat = 'yyyy-MM-dd';
dateFormat = 'yyyy';
today = new Date();
chartData: any = {}
flag = false;
columns: STColumn[] = [
{ title: '运营主体', index: 'networkTransporterName', className: 'text-center' },
@ -67,7 +66,7 @@ export class DatatableBusiindexComponent implements OnInit {
ngOnInit(): void {
this.initData()
}
initData(){
initData(flag?: boolean){
let type = 1
if(this.mode === 'year') {
type = 1
@ -81,7 +80,7 @@ export class DatatableBusiindexComponent implements OnInit {
this.service.request(this.service.$api_performanceReportHistogram, params).subscribe(res => {
if (res) {
this.chartData = res
if(this.flag) {
if(flag) {
this.pillar.reRender()
this.curve.reRender()
}
@ -126,10 +125,7 @@ export class DatatableBusiindexComponent implements OnInit {
} else if(this.mode === 'month') {
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00']
}
this.flag = true
this.initData()
this.initData(true)
}
disabledDate = (current: Date): boolean =>
// Can not select days before today and today