航线变更通知内容修改

This commit is contained in:
zhouyuejun
2019-01-21 12:04:21 +08:00
parent 81b360d52b
commit 40892850f3
4 changed files with 45 additions and 16 deletions
+17 -7
View File
@@ -134,21 +134,31 @@ export class AlertMessageHandle {
let mvin = message.FLOP.FFID.split('-')[2];
let rout = [];
if (Array.isArray(message.FLOP['ROUT']) && message.FLOP['ROUT'] > 0) {
if (Array.isArray(message.FLOP['ROUT']) && message.FLOP['ROUT'].length > 0) {
for (let i = 0; i < message.FLOP['ROUT'].length; i++) {
let airportIndex = airports.findIndex(val => val.airportCodeIata === message.FLOP['ROUT'][i]['APCD']);
let cityIndex = citys.findIndex(val => airports[airportIndex].cityId === val.cityId);
rout.push(citys[cityIndex].cityNameChn);
if(airportIndex>-1){
if (airports[airportIndex].briefNameChn) {
rout.push(airports[airportIndex].briefNameChn);
} else {
rout.push(airports[airportIndex].airportNameChn);
}
}
}
} else if (Object.prototype.toString.call(message.FLOP['ROUT']) === '[object Object]') {
let airportIndex = airports.findIndex(val => val.airportCodeIata === message.FLOP['ROUT']['APCD']);
let cityIndex = citys.findIndex(val => airports[airportIndex].cityId === val.cityId);
rout.push(citys[cityIndex].cityNameChn);
if(airportIndex>-1){
if (airports[airportIndex].briefNameChn) {
rout.push(airports[airportIndex].briefNameChn);
} else {
rout.push(airports[airportIndex].airportNameChn);
}
}
}
if (mvin === 'A') {
rout.push('成都');
rout.push('');
} else if (mvin === 'D') {
rout.unshift('成都');
rout.unshift('');
}
return message.FLOP.FFID + '航线更改为:' + rout.join(' - ');
}