From ba15aacf079d1a3fd13e4594f5a94cf25dacb036 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Mon, 26 Mar 2018 14:25:26 +0800 Subject: [PATCH] 报表 优化 --- src/app/routes/report/report.component.ts | 39 +++++++++++++++++++-------------------- 1 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/app/routes/report/report.component.ts b/src/app/routes/report/report.component.ts index 4f85b42..31d5571 100644 --- a/src/app/routes/report/report.component.ts +++ b/src/app/routes/report/report.component.ts @@ -13,22 +13,11 @@ }) export class ReportComponent implements OnInit { - constructor( - public injector: Injector, - public http: HttpClient, - public activeRoute: ActivatedRoute, - public msgSrv: NzMessageService - ) { - for (let index = 0; index < 30; index++) { - this.sensorArr.push(index); - } - } - [x: string]: any; public spinning: boolean = true; - public echartOption = { + private echartOption = { backgroundColor: '', title: { text: '', @@ -72,16 +61,27 @@ series: [] }; - sensorArr: any = []; - items: any = []; - timeType: any = {}; - title: string; - timeArr = ['���', '���', '���', '���', '���']; - ngOnInit() { + public sensorArr: any = []; + public items: any = []; + private timeType: any = {}; + public title: string; + private timeArr = ['���', '���', '���', '���', '���']; + constructor( + public injector: Injector, + public http: HttpClient, + public activeRoute: ActivatedRoute, + public msgSrv: NzMessageService + ) { + for (let index = 0; index < 30; index++) { + this.sensorArr.push(index); + } + } + + ngOnInit() { this.activeRoute.queryParams.subscribe(params => { const items = this.items = JSON.parse(params.items); - const timeType = this.timeType = JSON.parse(params.timeTypes); + const timeType = this.timeType = JSON.parse(params.timeType); this.http.get(environment.SERVER_BASH_URL + 'report/compare', {params: params}).subscribe((res: any) => { if (res.code === 0) { this.msgSrv.error(res.message); @@ -128,7 +128,6 @@ $('#mydiv' + i).remove(); } }); - $('#content').attr({style: "display: inline;"}); this.spinning = false; const title: any[] = this.title.replace(' ', '-').split('-'); this.title = ''; -- Gitblit v1.8.0