This commit is contained in:
zhouyuejun
2019-01-02 14:20:45 +08:00
parent e178eb6ee1
commit abbe9cfc22
2 changed files with 18 additions and 3 deletions
+13
View File
@@ -112,6 +112,12 @@ export class MainComponent implements OnInit {
@ViewChild('searchFilter') searchFilter;
@ViewChild('tableContainer') tableContainer;
trItemHeight: number = 42;
start: number = 0;
end: number = 0;
visibleCount: number = 0;
scrollTop: number = 0;
ngOnInit() {
this.renderer2.setStyle(this.tableContainer.nativeElement, 'height', this.mainPage.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 55 + 'px');
@@ -362,6 +368,13 @@ export class MainComponent implements OnInit {
combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
// this.visibleCount = Math.ceil(this.tableContainer.nativeElement.clientHeight / this.trItemHeight);
// this.start = 0;
// this.end = this.start + this.visibleCount;
// this.render_data = this.combined_data.slice(this.start,this.end);
this.render_data = combined_data;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
this.selectChange();
+5 -3
View File
@@ -143,7 +143,8 @@ export class FlightsDataHandle {
flights_item['renderFlight'] = Object.assign({}, render_flight);
}
} catch (error) {
alert('数据有误,处理失败,请检查数据');
console.log('数据有误,处理失败,请检查数据');
console.log(item);
throw error;
} finally {
return flights_item;
@@ -250,7 +251,8 @@ export class FlightsDataHandle {
item['renderReaFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderReaFlight']['FLTY']).flightTypeNameCn;
}
} catch (error) {
alert('数据有误,处理失败,请检查数据');
console.log('基础数据转换有误,处理失败,请检查数据');
console.log(item);
throw error;
} finally {
return item;
@@ -633,7 +635,7 @@ export class FlightsDataHandle {
}
}
} catch (error) {
alert('航班号为:' + message.FLNO + ' - 消息有误,处理失败,请检查消息数据');
console.log('航班号为:' + message.FLNO + ' - 消息有误,处理失败,请检查消息数据');
throw error;
} finally {
return {