收到日航班计划获取数据刷新界面

This commit is contained in:
zhouyuejun
2019-01-09 20:12:26 +08:00
parent ec59a1dc4c
commit af22ef439a
3 changed files with 24 additions and 2 deletions
+19 -1
View File
@@ -522,6 +522,7 @@ export class MainComponent implements OnInit {
'FLOP-ABTM': this.alertMessageHandle.flopAbtm.bind(this.alertMessageHandle),
'FLOP-CHOT': this.alertMessageHandle.flopChot.bind(this.alertMessageHandle),
'FLOP-TRML': this.alertMessageHandle.flopTrml.bind(this.alertMessageHandle),
'SCHD-DNLD': this.alertMessageHandle.schdDnld.bind(this.alertMessageHandle)
}
dynamicAlertHandle(message) {
let alertType = message.META.TYPE + '-' + message.META.STYP;
@@ -531,8 +532,25 @@ export class MainComponent implements OnInit {
let index = this.raw_data.findIndex(element => element['FLID'] === message.FLOP.FLID);
if (index > -1) {
this.raw_data.splice(index, 1);
this.creatWorkers()
this.creatWorkers();
}
} else if (alertType === 'SCHD-DNLD') {
this.canHandleDynamicMessage = false;
this.canHandleDynamicAlert = false;
this.httpCilent.get('/msgexchangeapi/all/flights').subscribe(
data => {
this.raw_data = data.body;
this.creatWorkers();
this.canHandleDynamicMessage = true;
this.dynamicMessageArray.forEach(message => {
this.dynamicMessageHandle(message);
})
this.canHandleDynamicAlert = true;
this.dynamicAlertArray.forEach(message => {
this.dynamicAlertHandle(message);
})
})
}
let alertText = this.alertMessage[alertType](message, this.airports);
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', alertText, 600000);
@@ -49,6 +49,7 @@ export class MsgAlertWarningComponent implements OnInit {
{"COL_CODE":"FLOP-ABTM", "COL_CN":"登桥撤桥"},
{"COL_CODE":"FLOP-CHOT", "COL_CN":"上下轮档"},
{"COL_CODE":"FLOP-TRML", "COL_CN":"航站楼"},
{"COL_CODE":"SCHD-DNLD", "COL_CN":"日航班计划"}
]
this.queryTable();
}
+3
View File
@@ -156,4 +156,7 @@ export class AlertMessageHandle {
public flopTrml(message,airports,citys) {
return message.FLOP.FFID + '航站楼:' + message.FLOP.TRML;
}
public schdDnld(message,airports,citys){
return '收到日航班计划';
}
}