新增到港离港共享航班字段
This commit is contained in:
@@ -178,6 +178,42 @@ onmessage = function (dynamicData) {
|
||||
* 数据转换处理方法集
|
||||
*/
|
||||
let formatter = {
|
||||
'ARSF': function arsfFormatter(flight) {
|
||||
if (flight['MVIN'] === 'A') {
|
||||
if (Array.isArray(flight['MAFL']) && flight['MAFL'].length > 0) {
|
||||
let arsf = [];
|
||||
for (let i = 0; i < flight['MAFL'].length; i++) {
|
||||
arsf.push(flight['MAFL'][i]['FLNO']);
|
||||
}
|
||||
let set = new Set(arsf);
|
||||
return Array.from(set).join(',');
|
||||
} else if (Object.prototype.toString.call(flight['MAFL']) === '[object Object]') {
|
||||
return flight['MAFL']['FLNO'];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
'DESF': function desfFormatter(flight) {
|
||||
if (flight['MVIN'] === 'D') {
|
||||
if (Array.isArray(flight['MAFL']) && flight['MAFL'].length > 0) {
|
||||
let desf = [];
|
||||
for (let i = 0; i < flight['MAFL'].length; i++) {
|
||||
desf.push(flight['MAFL'][i]['FLNO']);
|
||||
}
|
||||
let set = new Set(desf);
|
||||
return Array.from(set).join(',');
|
||||
} else if (Object.prototype.toString.call(flight['MAFL']) === '[object Object]') {
|
||||
return flight['MAFL']['FLNO'];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
'RENO': function renoFormatter(flight) {
|
||||
if (flight['RENO']) {
|
||||
if (flight['LRENO']) {
|
||||
@@ -1129,11 +1165,11 @@ onmessage = function (dynamicData) {
|
||||
})
|
||||
|
||||
postMessage(
|
||||
{
|
||||
"raw_data":raw_data,
|
||||
"airlinesSelections":airlinesSelections,
|
||||
"flightTypeSelections":flightTypeSelections,
|
||||
{
|
||||
"raw_data": raw_data,
|
||||
"airlinesSelections": airlinesSelections,
|
||||
"flightTypeSelections": flightTypeSelections,
|
||||
"combined_data": combined_data,
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user