航班信息显示转换

This commit is contained in:
zhouyuejun
2018-11-21 18:55:57 +08:00
parent 526cfe1251
commit 4582b465ee
36 changed files with 862 additions and 401 deletions
+21
View File
@@ -0,0 +1,21 @@
/**
* 登机门显示转换
*/
import timeFormatter from './time-formatter';
export default function (flight) {
if (flight['GTDT']) {
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
let gate = [];
for (let i = 0; i < flight['GTDT'].length; i++) {
gate.push(flight['GTDT'][i]['GATE']);
}
let set = new Set(gate);
return Array.from(set).join(',');
} else {
return flight['GTDT']['GATE'];
}
} else {
return '';
}
}