机型组数据转换处理

This commit is contained in:
714943302@qq.com
2018-12-11 10:25:01 +08:00
parent 2ce48cc757
commit 7d04e9a4c7
2 changed files with 33 additions and 14 deletions
@@ -21,10 +21,10 @@
<div class="second-condition mb-3 row">
<div class="input-container mr-4">
<label for="aircrafttypegroupId">机型组:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.aircrafttypegroupId" (ngModelChange)="selectChange()" id="jgroup">
<label for="aircraftTypeGroupId">机型组:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.aircraftTypeGroupId" (ngModelChange)="selectChange()" id="jgroup">
<option value=""></option>
<option *ngFor="let item of aircraftTypesGroups" [value]="item.aircrafttypegroupId">{{item.aircraftTypeGroupName}}</option>
<option *ngFor="let item of aircraftTypesGroups" [value]="item.aircraftTypeGroupId">{{item.aircraftTypeGroupName}}</option>
</select>
</div>
</div>
@@ -64,7 +64,7 @@
<td>{{aircraftType.maxFreightWeight}}</td>
<td>{{aircraftType.maxTakeoffWeight}}</td>
<td>{{aircraftType.maxAirbridges}}</td>
<td>{{aircraftType.aircrafttypegroupId}}</td>
<td>{{aircraftType.aircraftTypeGroupName}}</td>
<td>{{aircraftType.aircraftTypeCodeCaa}}</td>
<td>{{aircraftType.aircraftTypeCodeIata}}</td>
<td>{{aircraftType.aircraftTypeCodeIcao}}</td>
@@ -18,15 +18,15 @@ export class AircraftTypeComponent implements OnInit {
{ col_code: 'aircraftTypeName', col_chn: '机型名称' },
{ col_code: 'aircraftLength', col_chn: '飞机长度' },
{ col_code: 'aircraftWidth', col_chn: '翼展' },
{ col_code: 'aircraftHeight ', col_chn: '机身高度' },
{ col_code: 'maxPassengers ', col_chn: '最大乘客数' },
{ col_code: 'maxFreightWeight ', col_chn: '最大货物重量' },
{ col_code: 'maxTakeoffWeight ', col_chn: '最大起飞重量' },
{ col_code: 'maxAirbridges ', col_chn: '最大廊桥数' },
{ col_code: 'aircrafttypegroupId ', col_chn: '机型组' },
{ col_code: 'aircraftTypeCodeCaa ', col_chn: 'CAA码' },
{ col_code: 'aircraftTypeCodeIata ', col_chn: 'IATA码' },
{ col_code: 'aircraftTypeCodeIcao ', col_chn: 'ICAO码' },
{ col_code: 'aircraftHeight', col_chn: '机身高度' },
{ col_code: 'maxPassengers', col_chn: '最大乘客数' },
{ col_code: 'maxFreightWeight', col_chn: '最大货物重量' },
{ col_code: 'maxTakeoffWeight', col_chn: '最大起飞重量' },
{ col_code: 'maxAirbridges', col_chn: '最大廊桥数' },
{ col_code: 'aircraftTypeGroupName', col_chn: '机型组' },
{ col_code: 'aircraftTypeCodeCaa', col_chn: 'CAA码' },
{ col_code: 'aircraftTypeCodeIata', col_chn: 'IATA码' },
{ col_code: 'aircraftTypeCodeIcao', col_chn: 'ICAO码' },
]
// 搜索条件
@@ -56,8 +56,17 @@ export class AircraftTypeComponent implements OnInit {
)
//机型组
this.basicDataService.aircraft_type_group_subject.subscribe(
data => this.aircraftTypesGroups = data
data => {
this.aircraftTypesGroups = data;
if(this.aircraftTypesGroups && this.aircraftTypesGroups.length > 0){ //机型组转换处理
this.aircraftTypesGroupsHandle();
}
}
)
//机型组转换处理
if(this.render_data){
this.aircraftTypesGroupsHandle();
}
/**
* 固定表头
*/
@@ -69,6 +78,16 @@ export class AircraftTypeComponent implements OnInit {
tableCont.addEventListener('scroll', scrollHandle);
}
//机型组转换处理
aircraftTypesGroupsHandle() {
this.render_data.forEach(item => {
let aircraftTypesGroupsLinkIndex = this.aircraftTypesGroups.findIndex(val => val.aircraftTypeGroupId === item['aircraftTypeGroupId']);
if(this.aircraftTypesGroups[aircraftTypesGroupsLinkIndex]){
item['aircraftTypeGroupName'] = this.aircraftTypesGroups[aircraftTypesGroupsLinkIndex].aircraftTypeGroupName;
}
})
}
/**
* 选中某行
* @param i