路由复用优化

This commit is contained in:
zhouyuejun
2018-12-19 13:40:46 +08:00
parent 1e735059f8
commit cdb09eefa2
15 changed files with 155 additions and 116 deletions
@@ -7,7 +7,7 @@ const historicalDataRoutes: Routes = [
{
path: '',
component: HistoricalDataComponent,
data: { preload: true, reuse: false }
data: { preload: true, reuse: true }
}
]
@@ -52,31 +52,28 @@
<select [(ngModel)]="filterItems.MVIN" (ngModelChange)="selectChange()" class="form-control">
<option value=""></option>
<option value="A">到达</option>
<option value="D">离港</option>
<option value="D">出发</option>
</select>
</div>
<div class="input-container mr-4">
<label for="">机坪代理:&nbsp;&nbsp;</label>
<select [(ngModel)]="filterItems.FHAG" class="form-control">
<select [(ngModel)]="filterItems.FHAG" (ngModelChange)="selectChange()" class="form-control">
<option value=""></option>
<option value="GH">国航代理</option>
<option value="CH">川航代理</option>
<option *ngFor="let anget of flightAgents" [value]="anget.oGId">{{anget.flightAgentName}}</option>
</select>
</div>
<div class="input-container mr-4">
<label for="">旅客代理:&nbsp;&nbsp;</label>
<select [(ngModel)]="filterItems.PHAG" class="form-control">
<select [(ngModel)]="filterItems.PHAG" (ngModelChange)="selectChange()" class="form-control">
<option value=""></option>
<option value="GH">国航代理</option>
<option value="CH">川航代理</option>
<option *ngFor="let anget of flightAgents" [value]="anget.oGId">{{anget.flightAgentName}}</option>
</select>
</div>
<div class="input-container mr-4">
<label for="">维护代理:&nbsp;&nbsp;</label>
<select [(ngModel)]="filterItems.MHAG" class="form-control">
<select [(ngModel)]="filterItems.MHAG" (ngModelChange)="selectChange()" class="form-control">
<option value=""></option>
<option value="GH">国航代理</option>
<option value="CH">川航代理</option>
<option *ngFor="let anget of flightAgents" [value]="anget.oGId">{{anget.flightAgentName}}</option>
</select>
</div>
</div>
@@ -36,6 +36,7 @@ export class HistoricalDataComponent implements OnInit {
public tabClose: boolean = true;
//各项基础数据
public flightAgents: Array<any>;
public flightTypes: Array<any>;
public terminals: Array<any>;
public flightStatus: Array<any>;
@@ -77,7 +78,7 @@ export class HistoricalDataComponent implements OnInit {
}
)
//获取航班动态信息
this.httpCilent.post('/adminapi/hitFlightData/list', { searchDate: new Date().getTime() }).subscribe(
this.httpCilent.post('/adminapi/hitFlightData/list', { hstFLightTime: "2018-11-22" }).subscribe(
data => {
this.raw_data = data.body;
@@ -89,6 +90,7 @@ export class HistoricalDataComponent implements OnInit {
});
//从基础数据服务中拿出部分基础数据
this.flightAgents = this.basicDataService.flightAgents;
this.flightTypes = this.basicDataService.flightTypes;
this.terminals = this.basicDataService.terminal;
this.flightStatus = this.basicDataService.flightStatus;
@@ -104,6 +106,9 @@ export class HistoricalDataComponent implements OnInit {
this.combined_data = combined_data;
this.doSequence(this.combined_data);
} else {
this.basicDataService.flightAgents_subject.subscribe(
val => this.flightAgents = val
)
this.basicDataService.flightTypes_subject.subscribe(
val => this.flightTypes = val
)