动态消息更新优化及请求错误处理
This commit is contained in:
@@ -250,6 +250,25 @@ export class MainComponent implements OnInit {
|
||||
this.raw_data.push(message);
|
||||
}
|
||||
|
||||
//查找链接航班并将其组合成一条数据
|
||||
let combined_linked_data = this.dataHandle.findLinkFlights(this.raw_data);
|
||||
let combined_data = [];
|
||||
this.combined_data = [];
|
||||
combined_linked_data.forEach(element => {
|
||||
let flights_item = this.dataHandle.flightsRenderTransfer(element, this.col_lists);
|
||||
this.combined_data.push(flights_item);
|
||||
});
|
||||
this.combined_data.forEach(item => {
|
||||
combined_data.push(this.dataHandle.basicDataTransHandle(item, this.airports, this.citys, this.airlines, this.flightStatus, this.flightTypes));
|
||||
})
|
||||
this.combined_data = combined_data;
|
||||
this.combined_data.forEach(element => {
|
||||
element['ORDER'] = this.orderHandle.sequence(element);
|
||||
})
|
||||
this.combined_data = this.combined_data.sort(function (a, b) {
|
||||
return (a['ORDER'] - b['ORDER']);
|
||||
})
|
||||
|
||||
if (this.airlinesSelections.findIndex(airline => airline.airlineCodeIata === message['ALCD']) === -1) {
|
||||
let index = this.airlines.findIndex(val => val.airlineCodeIata === message['ALCD']);
|
||||
this.airlinesSelections.push(this.airlines[index]);
|
||||
@@ -262,7 +281,6 @@ export class MainComponent implements OnInit {
|
||||
|
||||
let dynamicHandleData = this.dataHandle.dynamicMessageHandle(
|
||||
message,
|
||||
this.combined_data,
|
||||
this.render_data,
|
||||
this.col_lists,
|
||||
this.filterItems,
|
||||
@@ -274,17 +292,8 @@ export class MainComponent implements OnInit {
|
||||
this.flightStatus,
|
||||
this.flightTypes
|
||||
)
|
||||
|
||||
this.combined_data = dynamicHandleData.combined_data;
|
||||
this.render_data = dynamicHandleData.render_data;
|
||||
|
||||
this.combined_data.forEach(element => {
|
||||
element['ORDER'] = this.orderHandle.sequence(element);
|
||||
})
|
||||
this.combined_data = this.combined_data.sort(function (a, b) {
|
||||
return (a['ORDER'] - b['ORDER']);
|
||||
})
|
||||
|
||||
this.render_data.forEach(element => {
|
||||
element['ORDER'] = this.orderHandle.sequence(element);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user