消息处理修改方式及部分消息提示语修改
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<div class="hr-line">资源类 -----------------------------------------</div>
|
<div class="hr-line">资源类 -----------------------------------------</div>
|
||||||
<div class="message-container">
|
<div class="message-container">
|
||||||
<p class="mt-2"><label>停机位:</label>{{showPsst}}</p>
|
<p class="mt-2"><label>停机位:</label>{{showPsst}}</p>
|
||||||
<p><label>登机门:</label>{{singleFlight.GATE}}</p>
|
<p><label>登机门:</label>{{singleFlight.GTDT}}</p>
|
||||||
<p><label>值机柜台:</label>{{singleFlight.CHKC}}</p>
|
<p><label>值机柜台:</label>{{singleFlight.CHKC}}</p>
|
||||||
<p><label>行李传送带:</label>{{singleFlight.CHUT}}</p>
|
<p><label>行李传送带:</label>{{singleFlight.CHUT}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -319,8 +319,6 @@ export class MainComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
calcVisibleCount() {
|
calcVisibleCount() {
|
||||||
this.renderer2.setStyle(this.tableContainer.nativeElement, 'height', this.pageContent.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 35 + 'px');
|
this.renderer2.setStyle(this.tableContainer.nativeElement, 'height', this.pageContent.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 35 + 'px');
|
||||||
// console.log(this.tableContainer.nativeElement.offsetHeight);
|
|
||||||
// console.log(this.tableHead.nativeElement.offsetHeight);
|
|
||||||
this.renderer2.setStyle(this.tableBody.nativeElement, 'height', this.tableContainer.nativeElement.offsetHeight - this.tableHead.nativeElement.offsetHeight + 'px');
|
this.renderer2.setStyle(this.tableBody.nativeElement, 'height', this.tableContainer.nativeElement.offsetHeight - this.tableHead.nativeElement.offsetHeight + 'px');
|
||||||
if (!this.tabClose) {
|
if (!this.tabClose) {
|
||||||
this.renderer2.setStyle(this.tabContainer.nativeElement, 'height', this.pageContent.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 35 + 'px');
|
this.renderer2.setStyle(this.tabContainer.nativeElement, 'height', this.pageContent.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 35 + 'px');
|
||||||
@@ -425,33 +423,18 @@ export class MainComponent implements OnInit {
|
|||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
dynamicMessageHandle(message) {
|
dynamicMessageHandle(message) {
|
||||||
let index = this.raw_data.findIndex(element => element['FLID'] === message.FLID);
|
this.creatWorkers(message);
|
||||||
if (index > -1) {
|
|
||||||
this.raw_data[index] = message;
|
|
||||||
} else {
|
|
||||||
this.raw_data.push(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.airlinesSelections.findIndex(airline => airline.airlineCodeIata === message['ALCD']) === -1) {
|
|
||||||
let index = this.airlines.findIndex(val => val.airlineCodeIata === message['ALCD']);
|
|
||||||
this.airlinesSelections.push(this.airlines[index]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === message['FLTY']) === -1) {
|
|
||||||
let index = this.flightTypes.findIndex(val => val.flightTypeCode === message['FLTY']);
|
|
||||||
this.flightTypeSelections.push(this.flightTypes[index]);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.creatWorkers();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建线程并执行
|
* 创建线程并执行
|
||||||
*/
|
*/
|
||||||
public promise: Worker = new Worker('/adminweb/assets/web-worker-handle.js');
|
public promise: Worker = new Worker('/adminweb/assets/web-worker-handle.js');
|
||||||
creatWorkers() {
|
creatWorkers(message?) {
|
||||||
let dynamicData = {
|
let dynamicData = {
|
||||||
|
message: message,
|
||||||
|
airlinesSelections: this.airlinesSelections,
|
||||||
|
flightTypeSelections: this.flightTypeSelections,
|
||||||
raw_data: this.raw_data,
|
raw_data: this.raw_data,
|
||||||
col_lists: this.col_lists,
|
col_lists: this.col_lists,
|
||||||
airports: this.airports,
|
airports: this.airports,
|
||||||
@@ -462,12 +445,18 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.promise.postMessage(dynamicData);
|
this.promise.postMessage(dynamicData);
|
||||||
this.promise.onmessage = function (e) {
|
this.promise.onmessage = function (e) {
|
||||||
this.combined_data = e.data;
|
this.combined_data = e.data.combined_data;
|
||||||
|
this.raw_data = e.data.raw_data;
|
||||||
|
this.airlinesSelections = e.data.airlinesSelections;
|
||||||
|
this.flightTypeSelections = e.data.flightTypeSelections;
|
||||||
this.selectChange('dynamic');
|
this.selectChange('dynamic');
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
// const promise = this.webWorkerService.run(webWorkerHandle, dynamicData);
|
// const promise = this.webWorkerService.run(webWorkerHandle, dynamicData);
|
||||||
// promise.then(function (response) {
|
// promise.then(function (response) {
|
||||||
// this.combined_data = response;
|
// this.combined_data = response.combined_data;
|
||||||
|
// this.raw_data = response.raw_data;
|
||||||
|
// this.airlinesSelections = response.airlinesSelections;
|
||||||
|
// this.flightTypeSelections = response.flightTypeSelections;
|
||||||
// this.selectChange('dynamic');
|
// this.selectChange('dynamic');
|
||||||
// this.webWorkerService.terminate(promise);
|
// this.webWorkerService.terminate(promise);
|
||||||
// }.bind(this));
|
// }.bind(this));
|
||||||
@@ -603,27 +592,6 @@ export class MainComponent implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (key === 'Start_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['preFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (nowTime - planTime >= +filterItems[key] * 60 * 60 * 1000 || nowTime - planTime < 0) {
|
|
||||||
// is_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// is_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// } else if (key === 'End_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['preFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (planTime - nowTime > +filterItems[key] * 60 * 60 * 1000 || planTime - nowTime < 0) {
|
|
||||||
// is_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// is_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
if (item['preFlight'][key] == filterItems[key]) {
|
if (item['preFlight'][key] == filterItems[key]) {
|
||||||
is_satis = true;
|
is_satis = true;
|
||||||
@@ -649,27 +617,6 @@ export class MainComponent implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (key === 'Start_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['reaFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (nowTime - planTime > +filterItems[key] * 60 * 60 * 1000 || nowTime - planTime < 0) {
|
|
||||||
// is_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// is_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// } else if (key === 'End_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['reaFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (planTime - nowTime > +filterItems[key] * 60 * 60 * 1000 || planTime - nowTime < 0) {
|
|
||||||
// is_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// is_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
if (item['reaFlight'][key] == filterItems[key]) {
|
if (item['reaFlight'][key] == filterItems[key]) {
|
||||||
is_satis = true;
|
is_satis = true;
|
||||||
@@ -696,27 +643,6 @@ export class MainComponent implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (key === 'Start_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['preFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (nowTime - planTime > +filterItems[key] * 60 * 60 * 1000 || nowTime - planTime < 0) {
|
|
||||||
// pre_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// pre_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// } else if (key === 'End_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['preFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (planTime - nowTime > +filterItems[key] * 60 * 60 * 1000 || planTime - nowTime < 0) {
|
|
||||||
// pre_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// pre_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
if (item['preFlight'][key] == filterItems[key]) {
|
if (item['preFlight'][key] == filterItems[key]) {
|
||||||
pre_satis = true;
|
pre_satis = true;
|
||||||
@@ -739,27 +665,6 @@ export class MainComponent implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (key === 'Start_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['reaFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (nowTime - planTime > +filterItems[key] * 60 * 60 * 1000 || nowTime - planTime < 0) {
|
|
||||||
// rea_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// rea_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// } else if (key === 'End_time') {
|
|
||||||
// let planTime = new Date(dateFormatter(item['reaFlight']['SODT'])).getTime();
|
|
||||||
// let nowTime = new Date().getTime();
|
|
||||||
// if (planTime - nowTime > +filterItems[key] * 60 * 60 * 1000 || planTime - nowTime < 0) {
|
|
||||||
// rea_satis = false;
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// rea_satis = true;
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
else {
|
else {
|
||||||
if (item['reaFlight'][key] == filterItems[key]) {
|
if (item['reaFlight'][key] == filterItems[key]) {
|
||||||
rea_satis = true;
|
rea_satis = true;
|
||||||
@@ -1051,9 +956,10 @@ export class MainComponent implements OnInit {
|
|||||||
if (this.orderHandle.isArriFlight(flight)) {
|
if (this.orderHandle.isArriFlight(flight)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
let reaDelay = flight['reaFlight']['DELY'];
|
||||||
try {
|
try {
|
||||||
if (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0) {
|
if (reaDelay && Array.isArray(reaDelay) && reaDelay.length > 0) {
|
||||||
if (parseInt(flight['preFlight']['DELY'][0]['DURA']) - 30 > 0) {
|
if (parseInt(reaDelay[reaDelay.length - 1]['DURA']) - 30 > 0) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ export class RelatedTabComponent implements OnInit {
|
|||||||
let fretIndex = this.lines.preFlight['ABN'].findIndex(ele => ele.TYPE === 'RTN');
|
let fretIndex = this.lines.preFlight['ABN'].findIndex(ele => ele.TYPE === 'RTN');
|
||||||
|
|
||||||
if (delyIndex > -1) {
|
if (delyIndex > -1) {
|
||||||
this.predelay = this.lines.preFlight['ABN'][delyIndex].BODY;
|
let delyMessage = this.lines.preFlight['ABN'][delyIndex].BODY
|
||||||
|
this.predelay = delyMessage[delyMessage.length - 1];
|
||||||
this.predelay['STRT'] = new Date(dateFormatter(this.predelay['STRT'])).getTime();
|
this.predelay['STRT'] = new Date(dateFormatter(this.predelay['STRT'])).getTime();
|
||||||
this.predelay['DURA'] = parseInt(this.predelay['DURA'].substr(0, 2)) * 3600000 + parseInt(this.predelay['DURA'].substr(2, 3)) * 60000 + this.predelay['STRT']
|
this.predelay['DURA'] = parseInt(this.predelay['DURA'].substr(0, 2)) * 3600000 + parseInt(this.predelay['DURA'].substr(2, 3)) * 60000 + this.predelay['STRT']
|
||||||
}
|
}
|
||||||
@@ -86,7 +87,8 @@ export class RelatedTabComponent implements OnInit {
|
|||||||
let fretIndex = this.lines.reaFlight['ABN'].findIndex(ele => ele.TYPE === 'RTN');
|
let fretIndex = this.lines.reaFlight['ABN'].findIndex(ele => ele.TYPE === 'RTN');
|
||||||
|
|
||||||
if (delyIndex > -1) {
|
if (delyIndex > -1) {
|
||||||
this.readelay = this.lines.reaFlight['ABN'][delyIndex].BODY;
|
let delyMessage = this.lines.reaFlight['ABN'][delyIndex].BODY
|
||||||
|
this.readelay = delyMessage[delyMessage.length - 1];
|
||||||
this.readelay['STRT'] = new Date(dateFormatter(this.readelay['STRT'])).getTime();
|
this.readelay['STRT'] = new Date(dateFormatter(this.readelay['STRT'])).getTime();
|
||||||
this.readelay['DURA'] = parseInt(this.readelay['DURA'].substr(0, 2)) * 3600000 + parseInt(this.readelay['DURA'].substr(2, 3)) * 60000 + this.readelay['STRT'];
|
this.readelay['DURA'] = parseInt(this.readelay['DURA'].substr(0, 2)) * 3600000 + parseInt(this.readelay['DURA'].substr(2, 3)) * 60000 + this.readelay['STRT'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,19 +25,19 @@ export class AlertMessageHandle {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public flopCncl(message, airports) {
|
public flopCncl(message, airports) {
|
||||||
if(message.FLOP.CNCL){
|
if (message.FLOP.CNCL) {
|
||||||
return message.FLOP.FFID + '航班取消';
|
return message.FLOP.FFID + '航班取消';
|
||||||
}else{
|
} else {
|
||||||
return message.FLOP.FFID + '航班恢复';
|
return message.FLOP.FFID + '航班恢复';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public flopFret(message, airports) {
|
public flopFret(message, airports) {
|
||||||
if (message.FLOP.FRET.REID === 'G') {
|
if (message.FLOP.FRET.REID === 'G') {
|
||||||
return message.FLOP.FFID + '航班从地面返回,返回原因:' + message.FLOP.FRET.content || message.FLOP.FRET.VALUE;
|
return message.FLOP.FFID + '航班从地面返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
|
||||||
} else if (message.FLOP.FRET.REID === 'A') {
|
} else if (message.FLOP.FRET.REID === 'A') {
|
||||||
return message.FLOP.FFID + '航班从空中返回,返回原因:' + message.FLOP.FRET.content || message.FLOP.FRET.VALUE;
|
return message.FLOP.FFID + '航班从空中返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
|
||||||
} else {
|
} else {
|
||||||
return message.FLOP.FFID + '航班从空中或地面返回,返回原因:' + message.FLOP.FRET.content || message.FLOP.FRET.VALUE;
|
return message.FLOP.FFID + '航班从空中或地面返回,返回原因:' + (message.FLOP.FRET.content || message.FLOP.FRET.VALUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public flopFdiv(message, airports) {
|
public flopFdiv(message, airports) {
|
||||||
@@ -47,24 +47,37 @@ export class AlertMessageHandle {
|
|||||||
airportName = airports[index].airportNameChn;
|
airportName = airports[index].airportNameChn;
|
||||||
}
|
}
|
||||||
if (message.FLOP.FDIV.DDIR === 'FROM') {
|
if (message.FLOP.FDIV.DDIR === 'FROM') {
|
||||||
return message.FLOP.FFID + '航班备降自' + airportName + ',备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
return message.FLOP.FFID + '航班备降自' + airportName + ',备降原因:' + (message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE);
|
||||||
} else if (message.FLOP.FDIV.DDIR === 'TO') {
|
} else if (message.FLOP.FDIV.DDIR === 'TO') {
|
||||||
return message.FLOP.FFID + '航班备降到' + airportName + ',备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
return message.FLOP.FFID + '航班备降到' + airportName + ',备降原因:' + (message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE);
|
||||||
} else {
|
} else {
|
||||||
return message.FLOP.FFID + '航班备降,备降原因:' + message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE;
|
return message.FLOP.FFID + '航班备降,备降原因:' + (message.FLOP.FDIV.content || message.FLOP.FDIV.VALUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public flopFdel(message, airports) {
|
public flopFdel(message, airports) {
|
||||||
return message.FLOP.FFID + '航班被删除了'
|
return message.FLOP.FFID + '航班被删除了'
|
||||||
}
|
}
|
||||||
public flopDely(message, airports) {
|
public flopDely(message, airports) {
|
||||||
return message.FLOP.FFID + '航班延误' + message.FLOP.DELY.DURA + '分钟;延误码:' + message.FLOP.DELY.CODE + ';延误信息:' + message.FLOP.DELY.content || message.FLOP.DELY.VALUE
|
let delyArray = message.FLOP.DELY;
|
||||||
|
let delyMessage = delyArray[delyArray.length - 1];
|
||||||
|
return message.FLOP.FFID + '航班延误' + (parseInt(delyMessage.DURA.substr(0, 2)) * 60 + parseInt(delyMessage.DURA.substr(2, 3))) + '分钟;延误码:' + delyMessage.CODE + '; 延误信息:' + (delyMessage.content || delyMessage.VALUE)
|
||||||
}
|
}
|
||||||
public flopActt(message, airports) {
|
public flopActt(message, airports) {
|
||||||
return message.FLOP.FFID + '航班实际时间:' + dateFormatter(message.FLOP.ACTT);
|
return message.FLOP.FFID + '航班实际时间:' + dateFormatter(message.FLOP.ACTT);
|
||||||
}
|
}
|
||||||
public flopGtdt(message, airports) {
|
public flopGtdt(message, airports) {
|
||||||
return message.FLOP.FFID + '登机门分配为:' + message.FLOP.GTDT.GATE
|
if (Array.isArray(message.FLOP['GTDT']) && message.FLOP['GTDT'].length > 0) {
|
||||||
|
let gate = [];
|
||||||
|
for (let i = 0; i < message.FLOP['GTDT'].length; i++) {
|
||||||
|
gate.push(message.FLOP['GTDT'][i]['GATE']);
|
||||||
|
}
|
||||||
|
let set = new Set(gate);
|
||||||
|
return message.FLOP.FFID + '登机门分配为:' + Array.from(set).join(',');
|
||||||
|
} else if (Object.prototype.toString.call(message.FLOP['GTDT']) === '[object Object]') {
|
||||||
|
return message.FLOP.FFID + '登机门分配为:' + message.FLOP['GTDT']['GATE'];
|
||||||
|
} else {
|
||||||
|
return message.FLOP.FFID + '登机门分配为:';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public flopPsdt(message, airports) {
|
public flopPsdt(message, airports) {
|
||||||
if (Array.isArray(message.FLOP['PSDT']) && message.FLOP['PSDT'].length > 0) {
|
if (Array.isArray(message.FLOP['PSDT']) && message.FLOP['PSDT'].length > 0) {
|
||||||
@@ -140,27 +153,27 @@ export class AlertMessageHandle {
|
|||||||
return message.FLOP.FFID + '航线更改为:' + rout.join(' - ');
|
return message.FLOP.FFID + '航线更改为:' + rout.join(' - ');
|
||||||
}
|
}
|
||||||
public flopVipp(message, airports, citys) {
|
public flopVipp(message, airports, citys) {
|
||||||
return message.FLOP.FFID + 'VIP旅客:' + message.FLOP.VIPP + '人';
|
return message.FLOP.FFID + 'VIP旅客:' + (message.FLOP.VIPP || '');
|
||||||
}
|
}
|
||||||
public flopHnag() {
|
public flopHnag() {
|
||||||
return '航班代理事件';
|
return '航班代理事件';
|
||||||
}
|
}
|
||||||
public flopFlbg(message,airports,citys) {
|
public flopFlbg(message, airports, citys) {
|
||||||
return message.FLOP.FFID + '首末件行李到达时间消息';
|
return message.FLOP.FFID + '首末件行李到达时间消息';
|
||||||
}
|
}
|
||||||
public flopReno(message,airports,citys) {
|
public flopReno(message, airports, citys) {
|
||||||
return message.FLOP.FFID + '更换飞机号:' + message.FLOP.RENO;
|
return message.FLOP.FFID + '更换飞机号:' + message.FLOP.RENO;
|
||||||
}
|
}
|
||||||
public flopAbtm(message,airports,citys) {
|
public flopAbtm(message, airports, citys) {
|
||||||
return message.FLOP.FFID + '靠桥撤桥消息';
|
return message.FLOP.FFID + '靠桥撤桥消息';
|
||||||
}
|
}
|
||||||
public flopChot(message,airports,citys) {
|
public flopChot(message, airports, citys) {
|
||||||
return message.FLOP.FFID + '上下轮档消息';
|
return message.FLOP.FFID + '上下轮档消息';
|
||||||
}
|
}
|
||||||
public flopTrml(message,airports,citys) {
|
public flopTrml(message, airports, citys) {
|
||||||
return message.FLOP.FFID + '航站楼:' + message.FLOP.TRML;
|
return message.FLOP.FFID + '航站楼:' + message.FLOP.TRML;
|
||||||
}
|
}
|
||||||
public schdDnld(message,airports,citys){
|
public schdDnld(message, airports, citys) {
|
||||||
return '收到日航班计划';
|
return '收到日航班计划';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export default function (dynamicData) {
|
export default function (dynamicData?) {
|
||||||
if (typeof Object.assign != 'function') {
|
if (typeof Object.assign != 'function') {
|
||||||
// Must be writable: true, enumerable: false, configurable: true
|
// Must be writable: true, enumerable: false, configurable: true
|
||||||
Object.defineProperty(Object, "assign", {
|
Object.defineProperty(Object, "assign", {
|
||||||
@@ -30,13 +30,38 @@ export default function (dynamicData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let raw_data = dynamicData.raw_data,
|
let messageArray = dynamicData.message,
|
||||||
|
airlinesSelections = dynamicData.airlinesSelections,
|
||||||
|
flightTypeSelections = dynamicData.flightTypeSelections,
|
||||||
|
raw_data = dynamicData.raw_data,
|
||||||
col_lists = dynamicData.col_lists,
|
col_lists = dynamicData.col_lists,
|
||||||
airports = dynamicData.airports,
|
airports = dynamicData.airports,
|
||||||
citys = dynamicData.citys,
|
citys = dynamicData.citys,
|
||||||
airlines = dynamicData.airlines,
|
airlines = dynamicData.airlines,
|
||||||
flightStatus = dynamicData.flightStatus,
|
flightStatus = dynamicData.flightStatus,
|
||||||
flightTypes = dynamicData.flightTypes
|
flightTypes = dynamicData.flightTypes
|
||||||
|
|
||||||
|
|
||||||
|
if (messageArray && Array.isArray(messageArray) && messageArray.length > 0) {
|
||||||
|
messageArray.forEach(message => {
|
||||||
|
let index = raw_data.findIndex(element => element['FLID'] === message.FLID);
|
||||||
|
if (index > -1) {
|
||||||
|
raw_data[index] = message;
|
||||||
|
} else {
|
||||||
|
raw_data.push(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (airlinesSelections.findIndex(airline => airline.airlineCodeIata === message['ALCD']) === -1) {
|
||||||
|
let index = airlines.findIndex(val => val.airlineCodeIata === message['ALCD']);
|
||||||
|
airlinesSelections.push(airlines[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === message['FLTY']) === -1) {
|
||||||
|
let index = flightTypes.findIndex(val => val.flightTypeCode === message['FLTY']);
|
||||||
|
flightTypeSelections.push(flightTypes[index]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 时间转换
|
* 时间转换
|
||||||
* @param dataString
|
* @param dataString
|
||||||
@@ -1101,5 +1126,10 @@ export default function (dynamicData) {
|
|||||||
return (a['ORDER'] - b['ORDER']);
|
return (a['ORDER'] - b['ORDER']);
|
||||||
})
|
})
|
||||||
|
|
||||||
return combined_data;
|
return {
|
||||||
|
"raw_data": raw_data,
|
||||||
|
"airlinesSelections": airlinesSelections,
|
||||||
|
"flightTypeSelections": flightTypeSelections,
|
||||||
|
"combined_data": combined_data,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -30,13 +30,39 @@ onmessage = function (dynamicData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let raw_data = dynamicData.data.raw_data,
|
let messageArray = dynamicData.data.message,
|
||||||
|
airlinesSelections = dynamicData.data.airlinesSelections,
|
||||||
|
flightTypeSelections = dynamicData.data.flightTypeSelections,
|
||||||
|
raw_data = dynamicData.data.raw_data,
|
||||||
col_lists = dynamicData.data.col_lists,
|
col_lists = dynamicData.data.col_lists,
|
||||||
airports = dynamicData.data.airports,
|
airports = dynamicData.data.airports,
|
||||||
citys = dynamicData.data.citys,
|
citys = dynamicData.data.citys,
|
||||||
airlines = dynamicData.data.airlines,
|
airlines = dynamicData.data.airlines,
|
||||||
flightStatus = dynamicData.data.flightStatus,
|
flightStatus = dynamicData.data.flightStatus,
|
||||||
flightTypes = dynamicData.data.flightTypes
|
flightTypes = dynamicData.data.flightTypes
|
||||||
|
|
||||||
|
|
||||||
|
if (messageArray && Array.isArray(messageArray) && messageArray.length > 0) {
|
||||||
|
messageArray.forEach(message => {
|
||||||
|
let index = raw_data.findIndex(element => element['FLID'] === message.FLID);
|
||||||
|
if (index > -1) {
|
||||||
|
raw_data[index] = message;
|
||||||
|
} else {
|
||||||
|
raw_data.push(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (airlinesSelections.findIndex(airline => airline.airlineCodeIata === message['ALCD']) === -1) {
|
||||||
|
let index = airlines.findIndex(val => val.airlineCodeIata === message['ALCD']);
|
||||||
|
airlinesSelections.push(airlines[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === message['FLTY']) === -1) {
|
||||||
|
let index = flightTypes.findIndex(val => val.flightTypeCode === message['FLTY']);
|
||||||
|
flightTypeSelections.push(flightTypes[index]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时间转换
|
* 时间转换
|
||||||
* @param dataString
|
* @param dataString
|
||||||
@@ -1102,5 +1128,12 @@ onmessage = function (dynamicData) {
|
|||||||
return (a['ORDER'] - b['ORDER']);
|
return (a['ORDER'] - b['ORDER']);
|
||||||
})
|
})
|
||||||
|
|
||||||
postMessage(combined_data);
|
postMessage(
|
||||||
|
{
|
||||||
|
"raw_data":raw_data,
|
||||||
|
"airlinesSelections":airlinesSelections,
|
||||||
|
"flightTypeSelections":flightTypeSelections,
|
||||||
|
"combined_data": combined_data,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user