菜单折叠,tab栏折叠

This commit is contained in:
zhouyuejun
2018-11-27 18:16:25 +08:00
parent 5470628d7f
commit bb2779e6e8
10 changed files with 219 additions and 85 deletions
+59 -14
View File
@@ -49,9 +49,12 @@ export class MainComponent implements OnInit {
private toastService: ToastService,
) {
console.log(new Date().getTime())
}
}
public tabClose: boolean = true;
public isSpinning:boolean = true;
//各项基础数据
public terminals: Array<any>;
public flightStatus: Array<any>;
public airports: Array<any>;
public citys: Array<any>;;
@@ -65,6 +68,16 @@ export class MainComponent implements OnInit {
public airline_color: Array<object> = [];
public row_state: any = { renderFlight: {} };
public checkboxGroup = {
'related': false,
'detail': false,
'vip': false,
'special': false,
'guarantee': false
}
public formatter = {
'GCTM': gctmFormatter,
'BOTM': botmFormatter,
@@ -207,6 +220,7 @@ export class MainComponent implements OnInit {
})
//从基础数据服务中拿出部分基础数据
this.terminals = this.basicDataService.terminal;
this.flightStatus = this.basicDataService.flightStatus;
this.airlines = this.basicDataService.airline;
this.citys = this.basicDataService.city;
@@ -224,6 +238,9 @@ export class MainComponent implements OnInit {
this.doSequence(this.combined_data);
}
}, 5000);
this.basicDataService.terminal_subject.subscribe(
val => this.terminals = val
)
this.basicDataService.flightStatus_subject.subscribe(
val => this.flightStatus = val
);
@@ -255,13 +272,9 @@ export class MainComponent implements OnInit {
tableCont.addEventListener('scroll', scrollHandle)
}
getLast(isLast){
if(isLast){
console.log('666666');
}
}
/**
* 基础数据转换
*/
basicDataTransHandle() {
this.combined_data.forEach(item => {
if (this.isArriFlight(item) || this.isDeptFlight(item)) {
@@ -284,7 +297,9 @@ export class MainComponent implements OnInit {
let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - ');
let erutLinkChnArray = []
for (let i = 0; i < erutLinkCodeArray.length; i++) {
console.log(erutLinkCodeArray[i]);
let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]);
console.log(airportIndex);
let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId);
erutLinkChnArray.push(this.citys[cityIndex].cityNameChn);
}
@@ -349,16 +364,47 @@ export class MainComponent implements OnInit {
this.render_data = sequenceData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
console.log(new Date().getTime() +'---');
console.log(new Date().getTime() + '---');
this.changeDetectorRef.detectChanges();
console.log(new Date().getTime() +'---');
console.log(new Date().getTime() + '---');
}
nzClick(){
/**
* 复选框勾选事件
*/
checkboxChange() {
for (const key in this.checkboxGroup) {
if (this.checkboxGroup.hasOwnProperty(key)) {
if (this.checkboxGroup[key]) {
this.tabClose = false;
break;
} else {
this.tabClose = true;
continue;
}
}
}
this.changeDetectorRef.detectChanges()
}
/**
* tab项切换事件
*/
nzClick() {
this.changeDetectorRef.detectChanges();
}
/**
* 刷新
*/
refresh() {
this.render_data.reverse();
console.log('=====');
this.changeDetectorRef.detectChanges();
console.log('-----');
}
/**
* 过滤及定位
@@ -373,6 +419,7 @@ export class MainComponent implements OnInit {
FLIN: '', //航线类别
FLTY: '', //航班类别
MVIN: '', //到达/出发
FTSS: '',
TRML: '', //航站楼
FHAG: '', //机坪代理
MHAG: '', //维护代理
@@ -395,7 +442,6 @@ export class MainComponent implements OnInit {
* 下拉框选择筛选
*/
selectChange() {
console.log(new Date().getTime() + '-----');
let filter_data = [];
let filterItems = this.filterItems;
this.combined_data.forEach(item => {
@@ -538,7 +584,6 @@ export class MainComponent implements OnInit {
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
this.changeDetectorRef.detectChanges();
console.log(new Date().getTime() + '=====');
}
/**