From 4ec908fe447c59811fb5938a33d8705ebb5d24f0 Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Wed, 26 Dec 2018 16:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=88=AA=E7=8F=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A5=E6=9C=9F=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../historical-data.component.html | 3 ++- .../historical-data.component.ts | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/app/pages/historical-data/historical-data.component.html b/src/app/pages/historical-data/historical-data.component.html index e788d26..744951e 100644 --- a/src/app/pages/historical-data/historical-data.component.html +++ b/src/app/pages/historical-data/historical-data.component.html @@ -108,13 +108,14 @@
- +
+
暂无数据
diff --git a/src/app/pages/historical-data/historical-data.component.ts b/src/app/pages/historical-data/historical-data.component.ts index 8e6bc8c..6b0ed17 100644 --- a/src/app/pages/historical-data/historical-data.component.ts +++ b/src/app/pages/historical-data/historical-data.component.ts @@ -58,6 +58,8 @@ export class HistoricalDataComponent implements OnInit { public row_state: any = { renderFlight: {} }; + public filterDate: string = '' + public checkboxGroup = { 'related': false, 'detail': false, @@ -71,12 +73,17 @@ export class HistoricalDataComponent implements OnInit { @ViewChild('tableContainer') tableContainer; ngOnInit() { + let toDate = new Date().getTime(); + let preDate = new Date(toDate - 24 * 60 * 60 * 1000); + this.filterDate = this.dateFormatter(preDate) + laydate.render({ elem: '#selectDate', showBottom: false, - value: new Date(new Date().getTime()), + value: preDate, format: 'yyyy-MM-dd', done: (value) => { + this.filterDate = value; this.operateSpinServiceService.showSpin(); this.httpCilent.post('/adminapi/hitFlightData/list', { hstFLightTime: value }).subscribe( data => { @@ -115,8 +122,9 @@ export class HistoricalDataComponent implements OnInit { }) } ) - //获取航班动态信息 - this.httpCilent.post('/adminapi/hitFlightData/list').subscribe( + + //获取历史航班 + this.httpCilent.post('/adminapi/hitFlightData/list', { hstFLightTime: this.filterDate }).subscribe( data => { this.raw_data = data.body; @@ -251,7 +259,7 @@ export class HistoricalDataComponent implements OnInit { } ) //获取航班动态信息 - this.httpCilent.post('/adminapi/hitFlightData/list').subscribe( + this.httpCilent.post('/adminapi/hitFlightData/list', { hstFLightTime: this.filterDate }).subscribe( data => { this.raw_data = data.body; @@ -567,4 +575,15 @@ export class HistoricalDataComponent implements OnInit { nzClick() { this.changeDetectorRef.detectChanges(); } + + dateFormatter(date) { + var time = new Date(date); + var y = time.getFullYear(); + var m = time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1; + var d = time.getDate() < 10 ? '0' + time.getDate() : time.getDate(); + var h = time.getHours(); + var mm = time.getMinutes(); + var s = time.getSeconds(); + return y + '-' + m + '-' + d; + } }
序号 {{airline_col.COL_CN}}