季度计划补充不完整字段及计划机位、飞机号变更显示修改
This commit is contained in:
@@ -5,6 +5,7 @@ export class FlightsDataHandle {
|
||||
public transferHandle = new TransferRenderHandle();
|
||||
|
||||
public formatter = {
|
||||
'RENO':this.transferHandle.renoFormatter.bind(this.transferHandle),
|
||||
'GCTM': this.transferHandle.gctmFormatter.bind(this.transferHandle),
|
||||
'BOTM': this.transferHandle.botmFormatter.bind(this.transferHandle),
|
||||
'ABDG': this.transferHandle.abdgFormatter.bind(this.transferHandle),
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
import timeFormatter from './time-formatter';
|
||||
import dateWithNotimeFormatter from './date-with-notime-formatter';
|
||||
export class TransferRenderHandle {
|
||||
public renoFormatter(flight){
|
||||
if(flight['RENO']){
|
||||
if(flight['LRENO']){
|
||||
return flight['RENO'] + '(' + flight['LRENO'] + ')';
|
||||
}else{
|
||||
return flight['RENO'];
|
||||
}
|
||||
}else{
|
||||
if(flight['LRENO']){
|
||||
return '(' + flight['LRENO'] + ')';
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
public gctmFormatter(flight) {
|
||||
if (flight['GTDT']) {
|
||||
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
|
||||
@@ -227,14 +242,30 @@ export class TransferRenderHandle {
|
||||
psst.push(flight['PSDT'][i]['PSST']);
|
||||
}
|
||||
let set = new Set(psst);
|
||||
return Array.from(set).join(',');
|
||||
if(flight['LPSDT']){
|
||||
return Array.from(set).join(',') + '(' + flight['LPSDT'] + ')';
|
||||
}else{
|
||||
return Array.from(set).join(',');
|
||||
}
|
||||
} else if (Object.prototype.toString.call(flight['PSDT']) === '[object Object]') {
|
||||
return flight['PSDT']['PSST'];
|
||||
if(flight['LPSDT']){
|
||||
return flight['PSDT']['PSST'] + '(' + flight['LPSDT'] + ')';
|
||||
}else{
|
||||
return flight['PSDT']['PSST'];
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
if(flight['LPSDT']){
|
||||
return '(' + flight['LPSDT'] + ')';
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
if(flight['LPSDT']){
|
||||
return '(' + flight['LPSDT'] + ')';
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
public esttFormatter(flight) {
|
||||
|
||||
@@ -152,6 +152,21 @@ export default function (dynamicData) {
|
||||
* 数据转换处理方法集
|
||||
*/
|
||||
let formatter = {
|
||||
'RENO': function renoFormatter(flight) {
|
||||
if (flight['RENO']) {
|
||||
if (flight['LRENO']) {
|
||||
return flight['RENO'] + '(' + flight['LRENO'] + ')';
|
||||
} else {
|
||||
return flight['RENO'];
|
||||
}
|
||||
} else {
|
||||
if (flight['LRENO']) {
|
||||
return '(' + flight['LRENO'] + ')';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
'GCTM': function gctmFormatter(flight) {
|
||||
if (flight['GTDT']) {
|
||||
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
|
||||
@@ -378,14 +393,30 @@ export default function (dynamicData) {
|
||||
psst.push(flight['PSDT'][i]['PSST']);
|
||||
}
|
||||
let set = new Set(psst);
|
||||
return Array.from(set).join(',');
|
||||
if (flight['LPSDT']) {
|
||||
return Array.from(set).join(',') + '(' + flight['LPSDT'] + ')';
|
||||
} else {
|
||||
return Array.from(set).join(',');
|
||||
}
|
||||
} else if (Object.prototype.toString.call(flight['PSDT']) === '[object Object]') {
|
||||
return flight['PSDT']['PSST'];
|
||||
if (flight['LPSDT']) {
|
||||
return flight['PSDT']['PSST'] + '(' + flight['LPSDT'] + ')';
|
||||
} else {
|
||||
return flight['PSDT']['PSST'];
|
||||
}
|
||||
} else {
|
||||
if (flight['LPSDT']) {
|
||||
return '(' + flight['LPSDT'] + ')';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (flight['LPSDT']) {
|
||||
return '(' + flight['LPSDT'] + ')';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
'ESTT': function esttFormatter(flight) {
|
||||
@@ -921,13 +952,13 @@ export default function (dynamicData) {
|
||||
for (let i = 0; i < erutCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutCodeArray[i]);
|
||||
if(airportIndex>-1){
|
||||
if(airports[airportIndex].briefNameChn){
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
erutChnArray.push(airports[airportIndex].briefNameChn);
|
||||
}else{
|
||||
erutChnArray.push(airports[airportIndex].airportNameChn);
|
||||
} else {
|
||||
erutChnArray.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
erutChnArray.push(erutCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -949,13 +980,13 @@ export default function (dynamicData) {
|
||||
for (let i = 0; i < erutLinkCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]);
|
||||
if(airportIndex>-1){
|
||||
if(airports[airportIndex].briefNameChn){
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
erutLinkChnArray.push(airports[airportIndex].briefNameChn);
|
||||
}else{
|
||||
erutLinkChnArray.push(airports[airportIndex].airportNameChn);
|
||||
} else {
|
||||
erutLinkChnArray.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
erutLinkChnArray.push(erutLinkCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -988,13 +1019,13 @@ export default function (dynamicData) {
|
||||
for (let i = 0; i < erutPreCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutPreCodeArray[i]);
|
||||
if(airportIndex>-1){
|
||||
if(airports[airportIndex].briefNameChn){
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
erutPreChnArray.push(airports[airportIndex].briefNameChn);
|
||||
}else{
|
||||
erutPreChnArray.push(airports[airportIndex].airportNameChn);
|
||||
} else {
|
||||
erutPreChnArray.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
erutPreChnArray.push(erutPreCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -1017,13 +1048,13 @@ export default function (dynamicData) {
|
||||
for (let i = 0; i < erutReaCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutReaCodeArray[i]);
|
||||
if(airportIndex>-1){
|
||||
if(airports[airportIndex].briefNameChn){
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
erutReaChnArray.push(airports[airportIndex].briefNameChn);
|
||||
}else{
|
||||
erutReaChnArray.push(airports[airportIndex].airportNameChn);
|
||||
} else {
|
||||
erutReaChnArray.push(airports[airportIndex].airportNameChn);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
erutReaChnArray.push(erutReaCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user