前站起飞时间显示规则修改

This commit is contained in:
zhouyuejun
2019-01-22 11:00:48 +08:00
parent 1147b3216c
commit 021db995d8
3 changed files with 115 additions and 13 deletions
+43 -9
View File
@@ -1,8 +1,8 @@
import timeFormatter from './time-formatter';
import dateWithNotimeFormatter from './date-with-notime-formatter';
export class TransferRenderHandle {
public arsfFormatter(flight){
if(flight['MVIN'] === 'A'){
public 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++) {
@@ -15,12 +15,12 @@ export class TransferRenderHandle {
} else {
return '';
}
}else{
} else {
return '';
}
}
public desfFormatter(flight){
if(flight['MVIN'] === 'D'){
public 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++) {
@@ -33,7 +33,7 @@ export class TransferRenderHandle {
} else {
return '';
}
}else{
} else {
return '';
}
}
@@ -392,9 +392,43 @@ export class TransferRenderHandle {
}
}
public padtFormatter(flight) {
if (flight['PADT']) {
return timeFormatter(flight['PADT']);
} else {
if (flight['MVIN'] === 'A') {
if (flight['PADT']) {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']){
return timeFormatter(flight['PADT']) + '(' + timeFormatter(lastRout['SCDT']) + ')';
}else{
return timeFormatter(flight['PADT']);
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']){
return timeFormatter(flight['PADT']) + '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
}else{
return timeFormatter(flight['PADT']);
}
}else{
return timeFormatter(flight['PADT']);
}
} else {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']){
return '(' + timeFormatter(lastRout['SCDT']) + ')';
}else{
return '';
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']){
return '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
}else{
return '';
}
}else{
return '';
}
}
}else{
return '';
}
}
+36 -2
View File
@@ -568,8 +568,42 @@ export default function (dynamicData?) {
}
},
'PADT': function padtFormatter(flight) {
if (flight['PADT']) {
return timeFormatter(flight['PADT']);
if (flight['MVIN'] === 'A') {
if (flight['PADT']) {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']) {
return timeFormatter(flight['PADT']) + '(' + timeFormatter(lastRout['SCDT']) + ')';
} else {
return timeFormatter(flight['PADT']);
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']) {
return timeFormatter(flight['PADT']) + '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
} else {
return timeFormatter(flight['PADT']);
}
} else {
return timeFormatter(flight['PADT']);
}
} else {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']) {
return '(' + timeFormatter(lastRout['SCDT']) + ')';
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']) {
return '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
} else {
return '';
}
} else {
return '';
}
}
} else {
return '';
}
+36 -2
View File
@@ -569,8 +569,42 @@ onmessage = function (dynamicData) {
}
},
'PADT': function padtFormatter(flight) {
if (flight['PADT']) {
return timeFormatter(flight['PADT']);
if (flight['MVIN'] === 'A') {
if (flight['PADT']) {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']) {
return timeFormatter(flight['PADT']) + '(' + timeFormatter(lastRout['SCDT']) + ')';
} else {
return timeFormatter(flight['PADT']);
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']) {
return timeFormatter(flight['PADT']) + '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
} else {
return timeFormatter(flight['PADT']);
}
} else {
return timeFormatter(flight['PADT']);
}
} else {
if (Array.isArray(flight['ROUT']) && flight['ROUT'].length > 0) {
let lastRout = flight['ROUT'][flight['ROUT'].length - 1];
if (lastRout['SCDT']) {
return '(' + timeFormatter(lastRout['SCDT']) + ')';
} else {
return '';
}
} else if (Object.prototype.toString.call(flight['ROUT']) === '[object Object]') {
if (flight['ROUT']['SCDT']) {
return '(' + timeFormatter(flight['ROUT']['SCDT']) + ')';
} else {
return '';
}
} else {
return '';
}
}
} else {
return '';
}