历史航班添加日期查询参数
This commit is contained in:
@@ -108,13 +108,14 @@
|
||||
</div>
|
||||
<div class="airline-table">
|
||||
<div #tableContainer id="table-container" class="table-container" [ngClass]="{'table-c': !tabClose,'table-o': tabClose}">
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<table id="table" class="table table-bordered table-striped" style="position:relative">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th *ngFor="let airline_col of render_col_lists">{{airline_col.COL_CN}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div *ngIf="render_data.length<=0" style="position: absolute;top: 75px;left: 25px;">暂无数据</div>
|
||||
<tbody>
|
||||
<tr *ngFor="let airline_row of render_data;let i = index;last as isLast" (click)="selectRow(airline_row)"
|
||||
[ngClass]="{'selected':row_state['renderFlight']['FLNO']===airline_row['renderFlight']['FLNO']}">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user