新增到港离港共享航班字段
This commit is contained in:
@@ -79,6 +79,8 @@ export class PersonalSettingsComponent implements OnInit {
|
||||
{ "COL_CODE": "CSFT", "COL_CN": "共享航班号", "COL_ORDER": "30", "COL_WIDTH": "85px" },
|
||||
{ "COL_CODE": "STND", "COL_CN": "当前机位", "COL_ORDER": "31", "COL_WIDTH": "85px" },
|
||||
{ "COL_CODE": "FLDT", "COL_CN": "航班日期", "COL_ORDER": "32", "COL_WIDTH": "85px" },
|
||||
{ "COL_CODE": "ARSF", "COL_CN": "到港共享航班", "COL_ORDER": "33", "COL_WIDTH": "120px" },
|
||||
{ "COL_CODE": "DESF", "COL_CN": "离港共享航班", "COL_ORDER": "34", "COL_WIDTH": "120px" },
|
||||
]
|
||||
/*
|
||||
备注:实际数据中,把原始数据录入到临时变量中,方便取消按钮,重置数据
|
||||
|
||||
@@ -5,6 +5,8 @@ export class FlightsDataHandle {
|
||||
public transferHandle = new TransferRenderHandle();
|
||||
|
||||
public formatter = {
|
||||
'ARSF': this.transferHandle.arsfFormatter.bind(this.transferHandle),
|
||||
'DESF': this.transferHandle.desfFormatter.bind(this.transferHandle),
|
||||
'RENO': this.transferHandle.renoFormatter.bind(this.transferHandle),
|
||||
'GCTM': this.transferHandle.gctmFormatter.bind(this.transferHandle),
|
||||
'BOTM': this.transferHandle.botmFormatter.bind(this.transferHandle),
|
||||
|
||||
@@ -1,6 +1,42 @@
|
||||
import timeFormatter from './time-formatter';
|
||||
import dateWithNotimeFormatter from './date-with-notime-formatter';
|
||||
export class TransferRenderHandle {
|
||||
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++) {
|
||||
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 '';
|
||||
}
|
||||
}
|
||||
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++) {
|
||||
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 '';
|
||||
}
|
||||
}
|
||||
public renoFormatter(flight) {
|
||||
if (flight['RENO']) {
|
||||
if (flight['LRENO']) {
|
||||
|
||||
@@ -177,6 +177,42 @@ export default 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']) {
|
||||
|
||||
@@ -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']) {
|
||||
@@ -1130,9 +1166,9 @@ 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