机场集团数据转换处理
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
<td>{{airport.airportCodeIata}}</td>
|
||||
<td>{{airport.airportCodeCaa}}</td>
|
||||
<td>{{airport.airportCodeIcao}}</td>
|
||||
<td>{{airport.airportGroupId}}</td>
|
||||
<td>{{airport.airportGroupName}}</td>
|
||||
<td>{{airport.cityNameChn}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -22,7 +22,7 @@ export class AirportComponent implements OnInit {
|
||||
{ col_code: 'airportCodeIata', col_chn: 'IATA码' },
|
||||
{ col_code: 'airportCodeCaa', col_chn: 'CAA码' },
|
||||
{ col_code: 'airportCodeIcao', col_chn: 'ICAO码' },
|
||||
{ col_code: 'airportGroupId', col_chn: '机场集团' },
|
||||
{ col_code: 'airportGroupName', col_chn: '机场集团' },
|
||||
{ col_code: 'cityNameChn', col_chn: '所在城市' },
|
||||
]
|
||||
|
||||
@@ -55,6 +55,7 @@ export class AirportComponent implements OnInit {
|
||||
if(this.citys && this.citys.length > 0){//城市数据列表转换处理
|
||||
this.basicDataTransHandle();
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
this.basicDataService.city_subject.subscribe(
|
||||
@@ -63,11 +64,18 @@ export class AirportComponent implements OnInit {
|
||||
}
|
||||
)
|
||||
this.basicDataService.airportgroup_subject.subscribe(
|
||||
data => this.airportgroups = data
|
||||
data => {
|
||||
this.airportgroups = data
|
||||
if(this.airportgroups && this.airportgroups.length > 0){//机场集团数据列表转换处理
|
||||
this.airportgroupsHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
//城市数据转换处理
|
||||
if(this.render_data){
|
||||
//城市数据转换处理
|
||||
this.basicDataTransHandle();
|
||||
//机场集团数据转换处理
|
||||
this.airportgroupsHandle();
|
||||
}
|
||||
/**
|
||||
* 固定表头
|
||||
@@ -80,6 +88,16 @@ export class AirportComponent implements OnInit {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//机场集团数据转换处理
|
||||
airportgroupsHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let airportgroupsLinkIndex = this.airportgroups.findIndex(val => val.airportGroupId === item['airportGroupId']);
|
||||
if(this.airportgroups[airportgroupsLinkIndex]){
|
||||
item['airportGroupName'] = this.airportgroups[airportgroupsLinkIndex].airportGroupName;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//城市数据转换处理
|
||||
basicDataTransHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
|
||||
Reference in New Issue
Block a user