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