fix bug
This commit is contained in:
@ -3,6 +3,8 @@ import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { DatePipe, _HttpClient } from '@delon/theme';
|
||||
import { DataService } from '../../services/data.service';
|
||||
import { differenceInCalendarDays } from 'date-fns';
|
||||
import { OperationCurveComponent } from './curve/curve.component';
|
||||
import { OperationPillarComponent } from './pillar/pillar.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-datatable-operationtable',
|
||||
@ -12,6 +14,8 @@ import { differenceInCalendarDays } from 'date-fns';
|
||||
|
||||
})
|
||||
export class DatatableOperationtableComponent implements OnInit {
|
||||
@ViewChild('curve') private readonly curve!: OperationCurveComponent;
|
||||
@ViewChild('pillar') private readonly pillar!: OperationPillarComponent;
|
||||
@ViewChild('st') private readonly st!: STComponent;
|
||||
type = 1;
|
||||
mode = 'year';
|
||||
@ -24,8 +28,10 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
timeNext: any = ['2022-01-01 00:00:00']
|
||||
today = new Date();
|
||||
enterpriseInfoId = ''
|
||||
enterpriseInfoIdPie = ''
|
||||
|
||||
interManlist: any = []
|
||||
chartData: any = {}
|
||||
flag = false;
|
||||
columns: STColumn[] = [
|
||||
{ title: '运营主体', index: 'networkTransporterName', className: 'text-center' },
|
||||
{ title: '订单数', index: 'zsl', className: 'text-center' },
|
||||
@ -64,12 +70,36 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
constructor(public service: DataService, private datePipe: DatePipe) { }
|
||||
ngOnInit(): void {
|
||||
this.initData()
|
||||
this.initPillarData()
|
||||
}
|
||||
initPillarData(){
|
||||
let type = 1
|
||||
if(this.mode === 'year') {
|
||||
type = 1
|
||||
} else if(this.mode === 'month') {
|
||||
type = 2
|
||||
}
|
||||
const params: any = {
|
||||
time: this.timeNext,
|
||||
type,
|
||||
enterpriseInfoId: this.enterpriseInfoId
|
||||
};
|
||||
this.flag = true
|
||||
this.service.request(this.service.$api_operationalReportHistogram, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.chartData = res
|
||||
if(this.flag) {
|
||||
this.pillar.reRender()
|
||||
this.curve.reRender()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
initData() {
|
||||
|
||||
this.service.getNetworkFreightForwarder().subscribe(res => {
|
||||
this.interManlist = res
|
||||
this.enterpriseInfoId = res[0].value
|
||||
this.enterpriseInfoIdPie = res[0].value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user