基础数据类型转换处理
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
<td>{{airport.airportCodeCaa}}</td>
|
||||
<td>{{airport.airportCodeIcao}}</td>
|
||||
<td>{{airport.airportGroupId}}</td>
|
||||
<td>{{airport.cityId}}</td>
|
||||
<td>{{airport.cityNameChn}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -52,14 +52,24 @@ export class AirportComponent implements OnInit {
|
||||
data => {
|
||||
this.airports = data;
|
||||
this.render_data = data;
|
||||
if(this.citys && this.citys.length > 0){//城市数据列表转换处理
|
||||
this.basicDataTransHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
this.basicDataService.city_subject.subscribe(
|
||||
data => this.citys = data
|
||||
data => {
|
||||
this.citys = data;
|
||||
}
|
||||
)
|
||||
this.basicDataService.airportgroup_subject.subscribe(
|
||||
data => this.airportgroups = data
|
||||
)
|
||||
//城市数据转换处理
|
||||
this.render_data.forEach(item => {
|
||||
let citysLinkIndex = this.citys.findIndex(val => val.cityId === item['cityId']);
|
||||
item['cityNameChn'] = this.citys[citysLinkIndex].cityNameChn;
|
||||
})
|
||||
/**
|
||||
* 固定表头
|
||||
*/
|
||||
@@ -71,6 +81,13 @@ export class AirportComponent implements OnInit {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//城市数据转换处理
|
||||
basicDataTransHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let citysLinkIndex = this.citys.findIndex(val => val.cityId === item['cityId']);
|
||||
item['cityNameChn'] = this.citys[citysLinkIndex].cityNameChn;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
|
||||
Reference in New Issue
Block a user