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 @@
-
+
| 序号 |
{{airline_col.COL_CN}} |
+ 暂无数据
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;
+ }
}