diff --git a/src/app/pages/main/main.component.html b/src/app/pages/main/main.component.html index 9540874..528ce45 100644 --- a/src/app/pages/main/main.component.html +++ b/src/app/pages/main/main.component.html @@ -27,7 +27,7 @@
@@ -74,8 +74,12 @@
- + + + +
@@ -113,7 +117,7 @@ 详细信息 -
@@ -141,7 +145,16 @@ {{i+1}} - {{isLast}} + + + + + + + + + + {{airline_row['renderFlight'][airline_col.COL_CODE]}} diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index 8379ee8..de404ac 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -12,6 +12,8 @@ import { WebsocketService } from '../../services/websocket.service'; import { DynamicFlightOrder } from './utils/dynamic-flight-order'; import { FlightsDataHandle } from './utils/flights-data-handle'; +import dateFormatter from '../../utils/data-formatter'; + import * as $ from 'jquery'; @Component({ selector: 'app-main', @@ -19,7 +21,6 @@ import * as $ from 'jquery'; styleUrls: ['./main.component.scss'] }) export class MainComponent implements OnInit { - constructor( private basicDataService: BasicDataService, private operateSpinServiceService: OperateSpinServiceService, @@ -35,7 +36,9 @@ export class MainComponent implements OnInit { public dataHandle = new FlightsDataHandle(); public tabClose: boolean = true; - public isSpinning: boolean = true; + + public canHandleDynamicMessage: boolean = false; + public dynamicMessageArray: Array = []; //各项基础数据 public terminals: Array; @@ -44,7 +47,10 @@ export class MainComponent implements OnInit { public citys: Array; public airlines: Array; - public raw_data: Array = []; //原始数据,即航班计划 + public airlinesSelections: Array = []; + public flightTypeSelections: Array = []; + + public raw_data: Array = []; //原始数据,未经过任何转换和组合 public combined_data: Array = []; //组合数据,即链接航班,显示信息等组合好之后的数据 public render_data: Array = []; //显示数据,即需要显示的数据 @@ -66,478 +72,14 @@ export class MainComponent implements OnInit { event => { let data = JSON.parse(event as string); if (data.topic === 'schd') { - console.log('========') let message = JSON.parse(data.message); - let index = this.raw_data.findIndex(element => element['FLID'] === message.FLID); - if (index > -1) { - this.raw_data[index] = message; + //是否可以开始处理动态消息 + if (this.canHandleDynamicMessage) { + this.dynamicMessageHandle(message) } else { - this.raw_data.push(message); + this.dynamicMessageArray.push(message); } - // let testss = [] - // let combined_linked_data = this.dataHandle.findLinkFlights(this.raw_data); - // combined_linked_data.forEach(element => { - // let flights_item = this.dataHandle.flightsRenderTransfer(element, this.col_lists); - // testss.push(flights_item); - // }); - - // let combined_data = []; - // testss.forEach(item => { - // combined_data.push(this.dataHandle.basicDataTransHandle(item, this.airports, this.citys, this.airlines, this.flightStatus)); - // }) - // this.combined_data = combined_data; - // this.doSequence(this.combined_data); - - - if (message.MVIN === 'A') { - //针对combined_data的处理 - let index = this.combined_data.findIndex(element => { - if (this.orderHandle.isArriFlight(element) || this.orderHandle.isLinked(element)) { - if (element['preFlight']['FLID'] === message.FLID) { - return true; - } else { - return false; - } - } else { - return false; - } - }); - if (index > -1) { - this.combined_data[index]['preFlight'] = message; - this.combined_data[index] = this.dataHandle.flightsRenderTransfer(this.combined_data[index], this.col_lists); - this.combined_data[index] = this.dataHandle.basicDataTransHandle(this.combined_data[index], this.airports, this.citys, this.airlines, this.flightStatus); - - if (message.UPTP === 'FLOP-AOTP') { - if (this.orderHandle.isArriFlight(this.combined_data[index])) { - if (message.TAID) { - this.combined_data.splice(index, 1); - - let i = this.combined_data.findIndex(element => { - if (this.orderHandle.isDeptFlight(element)) { - if (message.TAID === element['reaFlight']['FLID']) { - return true; - } else { - return false; - } - } else { - return false; - } - }) - this.combined_data[i]['reaFlight']['TAID'] = message.FLID; - let newFlight = {}; - newFlight['preFlight'] = message; - newFlight['reaFlight'] = this.combined_data[i]['reaFlight']; - - this.combined_data.splice(i, 1); - - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.combined_data.push(newFlight) - } - } else if (this.orderHandle.isLinked(this.combined_data[index])) { - if (!message.TAID) { - let newPreFlight = {}, - newReaFlight = {}; - - newPreFlight['preFlight'] = this.combined_data[index]['preFlight']; - newPreFlight['renderFlight'] = this.combined_data[index]['renderPreFlight']; - this.combined_data.push(newPreFlight); - - delete this.combined_data[index]['reaFlight']['TAID']; - newPreFlight['reaFlight'] = this.combined_data[index]['reaFlight']; - newPreFlight['renderFlight'] = this.combined_data[index]['renderReaFlight']; - this.combined_data.push(newReaFlight); - - this.combined_data.splice(index, 1); - } - } - } - } else { - let newFlight = {}; - newFlight['preFlight'] = message; - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.combined_data.push(newFlight); - } - - //针对render_data的处理 - let index1 = this.render_data.findIndex(element => { - if (this.orderHandle.isArriFlight(element) || this.orderHandle.isLinked(element)) { - if (element['preFlight']['FLID'] === message.FLID) { - return true; - } else { - return false; - } - } else { - return false; - } - }) - if (index1 > -1) { - this.render_data[index1]['preFlight'] = message; - this.render_data[index1] = this.dataHandle.flightsRenderTransfer(this.render_data[index1], this.col_lists); - this.render_data[index1] = this.dataHandle.basicDataTransHandle(this.render_data[index1], this.airports, this.citys, this.airlines, this.flightStatus); - - let is_satis = true; - for (const key in this.filterItems) { - if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { - if (this.render_data[index1]['preFlight'][key] === this.filterItems[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - } - } - let search_satis = true; - if (this.LASTSEARCH) { - if (this.LAST_SEL_COL) { - if (this.render_data[index1]['preFlight'][this.LAST_SEL_COL]) { - if (this.render_data[index1]['preFlight'][this.LAST_SEL_COL].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - } else { - search_satis = false; - } - } else { - search_satis = false; - } - } else { - let cols = this.col_lists; - for (let i = 0; i < cols.length; i++) { - if (this.render_data[index1]['renderFlight'][cols[i]['COL_CODE']]) { - if (this.render_data[index1]['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - break; - } else { - search_satis = false; - continue; - } - } else { - search_satis = false; - continue; - } - } - } - } - - if (is_satis && search_satis) { - if (message.UPTP === 'FLOP-TAOP') { - if (this.orderHandle.isArriFlight(this.render_data[index1])) { - if (message.TAID) { - let i = this.render_data.findIndex(element => { - if (this.orderHandle.isDeptFlight(element)) { - if (message.TAID === element['reaFlight']['FLID']) { - return true; - } else { - return false; - } - } else { - return false; - } - }) - - if (i > -1) { - this.render_data.splice(index1, 1); - this.render_data[i]['reaFlight']['TAID'] = message.FLID; - let newFlight = {}; - newFlight['preFlight'] = message; - newFlight['reaFlight'] = this.render_data[i]['reaFlight']; - this.render_data.splice(i, 1); - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.render_data.push(newFlight) - } - } - } else if (this.orderHandle.isLinked(this.render_data[index1])) { - if (!message.TAID) { - let newPreFlight = {}, - newReaFlight = {}; - delete this.render_data[index1]['preFlight']['TAID']; - newPreFlight['preFlight'] = this.render_data[index1]['preFlight']; - newPreFlight['renderFlight'] = this.render_data[index1]['renderPreFlight']; - delete this.render_data[index1]['reaFlight']['TAID']; - newPreFlight['reaFlight'] = this.render_data[index1]['reaFlight']; - newPreFlight['renderFlight'] = this.render_data[index1]['renderReaFlight']; - this.render_data.splice(index1, 1); - this.render_data.push(newPreFlight); - this.render_data.push(newReaFlight); - } - } - } - } else { - if (this.orderHandle.isArriFlight(this.render_data[index1])) { - this.render_data.splice(index1, 1); - } else if (this.orderHandle.isLinked(this.render_data[index1])) { - delete this.render_data[index1]['preFlight']; - delete this.render_data[index1]['renderPreFlight']; - this.render_data[index1] = this.dataHandle.flightsRenderTransfer(this.render_data[index1], this.col_lists); - this.render_data[index1] = this.dataHandle.basicDataTransHandle(this.render_data[index1], this.airports, this.citys, this.airlines, this.flightStatus); - } - } - } else { - let newFlight = {}; - newFlight['preFlight'] = message; - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - - let is_satis = true; - for (const key in this.filterItems) { - if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { - if (newFlight['preFlight'][key] === this.filterItems[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - } - } - - let search_satis = true; - if (this.LASTSEARCH) { - if (this.LAST_SEL_COL) { - if (newFlight['preFlight'][this.LAST_SEL_COL]) { - if (newFlight['preFlight'][this.LAST_SEL_COL].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - } else { - search_satis = false; - } - } else { - search_satis = false; - } - } else { - let cols = this.col_lists; - for (let i = 0; i < cols.length; i++) { - if (newFlight['renderFlight'][cols[i]['COL_CODE']]) { - if (newFlight['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - break; - } else { - search_satis = false; - continue; - } - } else { - search_satis = false; - continue; - } - } - } - } - if (is_satis && search_satis) { - let i = this.render_data.findIndex(element => { - if (this.orderHandle.isDeptFlight(element)) { - if (message.TAID === element['reaFlight']['FLID']) { - return true; - } else { - return false; - } - } else { - return false; - } - }) - - if (i > -1) { - let newFlight = {}; - newFlight['preFlight'] = message; - newFlight['reaFlight'] = Object.assign({}, this.render_data[i]['reaFlight']); - this.render_data.splice(i, 1); - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.render_data.push(newFlight); - } else { - this.render_data.push(newFlight); - } - } - } - } else { - //针对combined_data的处理 - let index = this.combined_data.findIndex(element => { - if (this.orderHandle.isDeptFlight(element) || this.orderHandle.isLinked(element)) { - if (element['reaFlight']['FLID'] === message.FLID) { - return true; - } else { - return false; - } - } else { - return false; - } - }); - if (index > -1) { - this.combined_data[index]['reaFlight'] = message; - this.combined_data[index] = this.dataHandle.flightsRenderTransfer(this.combined_data[index], this.col_lists); - this.combined_data[index] = this.dataHandle.basicDataTransHandle(this.combined_data[index], this.airports, this.citys, this.airlines, this.flightStatus); - } else { - let newFlight = {}; - newFlight['reaFlight'] = message; - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.combined_data.push(newFlight); - } - - //针对render_data的处理 - let index1 = this.render_data.findIndex(element => { - if (this.orderHandle.isDeptFlight(element) || this.orderHandle.isLinked(element)) { - if (element['reaFlight']['FLID'] === message.FLID) { - return true; - } else { - return false; - } - } else { - return false; - } - }); - if (index1 > -1) { - this.render_data[index1]['reaFlight'] = message; - this.render_data[index1] = this.dataHandle.flightsRenderTransfer(this.render_data[index1], this.col_lists); - this.render_data[index1] = this.dataHandle.basicDataTransHandle(this.render_data[index1], this.airports, this.citys, this.airlines, this.flightStatus); - - let is_satis = true; - for (const key in this.filterItems) { - if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { - if (this.render_data[index1]['reaFlight'][key] === this.filterItems[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - } - } - let search_satis = true; - if (this.LASTSEARCH) { - if (this.LAST_SEL_COL) { - if (this.render_data[index1]['reaFlight'][this.LAST_SEL_COL]) { - if (this.render_data[index1]['reaFlight'][this.LAST_SEL_COL].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - } else { - search_satis = false; - } - } else { - search_satis = false; - } - } else { - let cols = this.col_lists; - for (let i = 0; i < cols.length; i++) { - if (this.render_data[index1]['renderFlight'][cols[i]['COL_CODE']]) { - if (this.render_data[index1]['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - break; - } else { - search_satis = false; - continue; - } - } else { - search_satis = false; - continue; - } - } - } - } - if (!is_satis || !search_satis) { - if (this.orderHandle.isDeptFlight(this.render_data[index1])) { - this.render_data.splice(index1, 1); - } else if (this.orderHandle.isLinked(this.render_data[index1])) { - delete this.render_data[index1]['reaFlight']; - delete this.render_data[index1]['renderReaFlight']; - - this.render_data[index1] = this.dataHandle.flightsRenderTransfer(this.render_data[index1], this.col_lists); - this.render_data[index1] = this.dataHandle.basicDataTransHandle(this.render_data[index1], this.airports, this.citys, this.airlines, this.flightStatus); - } - } - } else { - let newFlight = {}; - newFlight['reaFlight'] = message; - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - - let is_satis = true; - for (const key in this.filterItems) { - if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { - if (newFlight['reaFlight'][key] === this.filterItems[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - } - } - let search_satis = true; - if (this.LASTSEARCH) { - if (this.LAST_SEL_COL) { - if (newFlight['reaFlight'][this.LAST_SEL_COL]) { - if (newFlight['reaFlight'][this.LAST_SEL_COL].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - } else { - search_satis = false; - } - } else { - search_satis = false; - } - } else { - let cols = this.col_lists; - for (let i = 0; i < cols.length; i++) { - if (newFlight['renderFlight'][cols[i]['COL_CODE']]) { - if (newFlight['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(this.LASTSEARCH, 'i'))) { - search_satis = true; - break; - } else { - search_satis = false; - continue; - } - } else { - search_satis = false; - continue; - } - } - } - } - if (is_satis && search_satis) { - let i = this.render_data.findIndex(element => { - if (this.orderHandle.isArriFlight(element)) { - if (message.TAID === element['preFlight']['FLID']) { - return true; - } else { - return false; - } - } else { - return false; - } - }) - - if (i > -1) { - let newFlight = {}; - newFlight['reaFlight'] = message; - newFlight['preFlight'] = Object.assign({}, this.render_data[i]['preFlight']); - this.render_data.splice(i, 1); - newFlight = this.dataHandle.flightsRenderTransfer(newFlight, this.col_lists); - newFlight = this.dataHandle.basicDataTransHandle(newFlight, this.airports, this.citys, this.airlines, this.flightStatus); - this.render_data.push(newFlight); - } else { - this.render_data.push(newFlight); - } - } - } - } - - this.combined_data.forEach(element => { - element['ORDER'] = this.orderHandle.sequence(element); - }) - this.combined_data = this.combined_data.sort(function (a, b) { - return (a['ORDER'] - b['ORDER']); - }) - - this.render_data.forEach(element => { - element['ORDER'] = this.orderHandle.sequence(element); - }) - this.render_data = this.render_data.sort(function (a, b) { - return (a['ORDER'] - b['ORDER']); - }) - this.changeDetectorRef.detectChanges(); - - // this.doSequence(this.combined_data); - } else if (data.topic === 'msg') { let message = JSON.parse(data.message); console.log(message); @@ -554,7 +96,7 @@ export class MainComponent implements OnInit { this.col_lists = data; } ) - /* 获取航班动态信息 */ + //获取航班动态信息 this.httpCilent.get('/msgexchangeapi/all/flights').subscribe( data => { this.raw_data = data.body; @@ -608,9 +150,7 @@ export class MainComponent implements OnInit { } ) - /** - * 固定表头 - */ + //固定表头 var tableCont = document.querySelector('#table-container') function scrollHandle() { var scrollTop = this.scrollTop; @@ -620,9 +160,74 @@ export class MainComponent implements OnInit { } /** - * 执行排序并渲染 + * 动态消息处理方法 + * @param message + */ + dynamicMessageHandle(message) { + let index = this.raw_data.findIndex(element => element['FLID'] === message.FLID); + if (index > -1) { + this.raw_data[index] = message; + } else { + this.raw_data.push(message); + } + + // let testss = [] + // let combined_linked_data = this.dataHandle.findLinkFlights(this.raw_data); + // combined_linked_data.forEach(element => { + // let flights_item = this.dataHandle.flightsRenderTransfer(element, this.col_lists); + // testss.push(flights_item); + // }); + + // let combined_data = []; + // testss.forEach(item => { + // combined_data.push(this.dataHandle.basicDataTransHandle(item, this.airports, this.citys, this.airlines, this.flightStatus)); + // }) + // this.combined_data = combined_data; + // this.doSequence(this.combined_data); + + let dynamicHandleData = this.dataHandle.dynamicMessageHandle( + message, + this.combined_data, + this.render_data, + this.col_lists, + this.filterItems, + this.LASTSEARCH, + this.LAST_SEL_COL, + this.airports, + this.citys, + this.airlines, this.flightStatus + ) + + this.combined_data = dynamicHandleData.combined_data; + this.render_data = dynamicHandleData.render_data; + + this.combined_data.forEach(element => { + element['ORDER'] = this.orderHandle.sequence(element); + }) + this.combined_data = this.combined_data.sort(function (a, b) { + return (a['ORDER'] - b['ORDER']); + }) + + this.render_data.forEach(element => { + element['ORDER'] = this.orderHandle.sequence(element); + }) + this.render_data = this.render_data.sort(function (a, b) { + return (a['ORDER'] - b['ORDER']); + }) + this.changeDetectorRef.detectChanges(); + } + + /** + * 数据组合完毕,执行排序、渲染以及动态信息处理 + * @param combined_data */ doSequence(combined_data) { + this.raw_data.forEach(element => { + if (this.airlinesSelections.findIndex(airline => airline.airlineCodeIata === element['ALCD']) === -1) { + let index = this.airlines.findIndex(val => val.airlineCodeIata === element['ALCD']); + this.airlinesSelections.push(this.airlines[index]); + } + }) combined_data.forEach(element => { element['ORDER'] = this.orderHandle.sequence(element); @@ -631,10 +236,15 @@ export class MainComponent implements OnInit { return (a['ORDER'] - b['ORDER']); }) this.render_data = combined_data; - console.log(new Date().getTime()); this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; this.changeDetectorRef.detectChanges(); this.operateSpinServiceService.hideSpin() + + //开始处理动态消息 + this.canHandleDynamicMessage = true; + this.dynamicMessageArray.forEach(message => { + this.dynamicMessageHandle(message); + }) } /** @@ -667,8 +277,9 @@ export class MainComponent implements OnInit { FLIN: '', //航线类别 FLTY: '', //航班类别 MVIN: '', //到达/出发 - FTSS: '', + FTSS: '', //运营状态 TRML: '', //航站楼 + Abnormal_state: '', //异常状态 FHAG: '', //机坪代理 MHAG: '', //维护代理 PHAG: '', //旅客代理 @@ -681,7 +292,6 @@ export class MainComponent implements OnInit { if (this.FLT_POS === 1) { this.selectChange() } else { - // this.selectChange() this.inputPosition(this.render_data) } } @@ -703,12 +313,22 @@ export class MainComponent implements OnInit { let is_satis = true; for (const key in filterItems) { if (filterItems.hasOwnProperty(key) && filterItems[key]) { - if (item['preFlight'][key] === filterItems[key]) { - is_satis = true; - continue; + if (key === 'Abnormal_state') { + if (item['preFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } } else { - is_satis = false; - break; + if (item['preFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } } } } @@ -717,12 +337,22 @@ export class MainComponent implements OnInit { let is_satis = true; for (const key in filterItems) { if (filterItems.hasOwnProperty(key) && filterItems[key]) { - if (item['reaFlight'][key] === filterItems[key]) { - is_satis = true; - continue; + if (key === 'Abnormal_state') { + if (item['reaFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } } else { - is_satis = false; - break; + if (item['reaFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } } } } @@ -732,23 +362,43 @@ export class MainComponent implements OnInit { let rea_satis = true; for (const key in filterItems) { if (filterItems.hasOwnProperty(key) && filterItems[key]) { - if (item['preFlight'][key] === filterItems[key]) { - pre_satis = true; - continue; + if (key === 'Abnormal_state') { + if (item['preFlight'][filterItems[key]]) { + pre_satis = true; + continue; + } else { + pre_satis = false; + break; + } } else { - pre_satis = false; - break; + if (item['preFlight'][key] === filterItems[key]) { + pre_satis = true; + continue; + } else { + pre_satis = false; + break; + } } } } for (const key in filterItems) { if (filterItems.hasOwnProperty(key) && filterItems[key]) { - if (item['reaFlight'][key] === filterItems[key]) { - rea_satis = true; - continue; + if (key === 'Abnormal_state') { + if (item['reaFlight'][filterItems[key]]) { + rea_satis = true; + continue; + } else { + rea_satis = false; + break; + } } else { - rea_satis = false; - break; + if (item['reaFlight'][key] === filterItems[key]) { + rea_satis = true; + continue; + } else { + rea_satis = false; + break; + } } } } @@ -996,6 +646,202 @@ export class MainComponent implements OnInit { } + getVipNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['VIPP'] && flight['preFlight']['VIPP'] > 0) { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['VIPP'] && flight['reaFlight']['VIPP'] > 0) { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['VIPP'] && flight['preFlight']['VIPP'] > 0) || (flight['reaFlight']['VIPP'] && flight['reaFlight']['VIPP'] > 0)) { + return true; + } else { + return false; + } + } + } + + getOutplanNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['UPTP'] && flight['preFlight']['UPTP'] === 'SCHD-ADFT') { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['UPTP'] && flight['reaFlight']['UPTP'] === 'SCHD-ADFT') { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['UPTP'] && flight['preFlight']['UPTP'] === 'SCHD-ADFT') || (flight['reaFlight']['UPTP'] && flight['reaFlight']['UPTP'] === 'SCHD-ADFT')) { + return true; + } else { + return false; + } + } + } + + getAlternateNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['FDIV']) { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['FDIV']) { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['FDIV']) || (flight['reaFlight']['FDIV'])) { + return true; + } else { + return false; + } + } + } + + getDelay30Notes(flight) { + // return false; + if (this.orderHandle.isArriFlight(flight)) { + return false; + } else { + if (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0) { + if (parseInt(flight['preFlight']['DELY'][0]['DURA']) - 30 > 0) { + return true; + } else { + return false; + } + } else { + return false; + } + } + + } + + getDelayNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['DELY'] && Array.isArray(flight['preFlight']['DELY']) && flight['preFlight']['DELY'].length > 0) { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0) { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['DELY'] && Array.isArray(flight['preFlight']['DELY']) && flight['preFlight']['DELY'].length > 0) || (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0)) { + return true; + } else { + return false; + } + } + } + + getReturnNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['FRET']) { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['FRET']) { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['FRET']) || (flight['reaFlight']['FRET'])) { + return true; + } else { + return false; + } + } + } + + getCancleNotes(flight) { + if (this.orderHandle.isArriFlight(flight)) { + if (flight['preFlight']['CNCL']) { + return true; + } else { + return false; + } + } else if (this.orderHandle.isDeptFlight(flight)) { + if (flight['reaFlight']['CNCL']) { + return true; + } else { + return false; + } + } else { + if ((flight['preFlight']['CNCL']) || (flight['reaFlight']['CNCL'])) { + return true; + } else { + return false; + } + } + } + + getStopoverNotes(flight) { + if (this.orderHandle.isLinked(flight)) { + if (flight['preFlight']['ACTT'] && flight['reaFlight']['ESTT']) { + if (new Date(dateFormatter(flight['reaFlight']['ESTT'])).getTime() - new Date(dateFormatter(flight['preFlight']['ACTT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else if (flight['preFlight']['ACTT'] && flight['reaFlight']['SODT']) { + if (new Date(dateFormatter(flight['reaFlight']['SODT'])).getTime() - new Date(dateFormatter(flight['preFlight']['ACTT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else if (flight['preFlight']['ESTT'] && flight['reaFlight']['ESTT']) { + if (new Date(dateFormatter(flight['reaFlight']['ESTT'])).getTime() - new Date(dateFormatter(flight['preFlight']['ESTT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else if (flight['preFlight']['ESTT'] && flight['reaFlight']['SODT']) { + if (new Date(dateFormatter(flight['reaFlight']['SODT'])).getTime() - new Date(dateFormatter(flight['preFlight']['ESTT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else if (flight['preFlight']['SODT'] && flight['reaFlight']['ESTT']) { + if (new Date(dateFormatter(flight['reaFlight']['ESTT'])).getTime() - new Date(dateFormatter(flight['preFlight']['SODT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else if (flight['preFlight']['SODT'] && flight['reaFlight']['SODT']) { + if (new Date(dateFormatter(flight['reaFlight']['SODT'])).getTime() - new Date(dateFormatter(flight['preFlight']['SODT'])).getTime() > 3600000) { + return false; + } else { + return true; + } + } else { + return false; + } + } else { + return false; + } + } + /** * 复选框勾选事件 */ diff --git a/src/app/pages/main/utils/flights-data-handle.ts b/src/app/pages/main/utils/flights-data-handle.ts index f7c4b5c..918748e 100644 --- a/src/app/pages/main/utils/flights-data-handle.ts +++ b/src/app/pages/main/utils/flights-data-handle.ts @@ -152,7 +152,6 @@ export class FlightsDataHandle { render_pre_flight[key] = preHasValue; render_rea_flight[key] = reaHasValue; } - flights_item['renderCombinedFlight'] = render_flight; flights_item['renderPreFlight'] = render_pre_flight; flights_item['renderReaFlight'] = render_rea_flight; flights_item['renderFlight'] = Object.assign({}, render_flight); @@ -161,10 +160,7 @@ export class FlightsDataHandle { return flights_item; } - /** - * 基础数据转换 - */ - basicDataTransHandle(item, airports, citys, airlines, flightStatus) { + public basicDataTransHandle(item, airports, citys, airlines, flightStatus) { if (this.orderHandle.isArriFlight(item) || this.orderHandle.isDeptFlight(item)) { //航线处理 let erutCodeArray = item['renderFlight']['ERUT'].split(' - '); @@ -246,32 +242,486 @@ export class FlightsDataHandle { item['renderReaFlight']['ALCD'] = airlines[airlineReaIndex].airlineName; //运营状态处理 item['renderReaFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderReaFlight']['FTSS']).stdc - - // //航线处理 - // let erutCombinedCodeArray = item['renderCombinedFlight']['ERUT'].split(' - '); - // let erutCombinedChnArray = [] - // for (let i = 0; i < erutCombinedCodeArray.length; i++) { - // try { - // let airportIndex = airports.findIndex(val => val.airportCodeIata === erutCombinedCodeArray[i]); - // let cityIndex = citys.findIndex(val => airports[airportIndex].cityId === val.cityId); - // erutCombinedChnArray.push(citys[cityIndex].cityNameChn); - // } catch (error) { - // erutCombinedChnArray.push(erutCombinedCodeArray[i]); - // } - // } - // item['renderCombinedFlight']['ERUT'] = erutCombinedChnArray.join(' - '); - // //航空公司处理 - // let airlineCombinedIndex = airlines.findIndex(val => val.airlineCode === item['renderCombinedFlight']['ALCD']); - // item['renderCombinedFlight']['ALCD'] = airlines[airlineCombinedIndex].airlineName; - // //运营状态处理 - // let ftssCombinedCodeArray = item['renderCombinedFlight']['FTSS'].split(' / '); - // let ftssCombinedChnArray = []; - // for (let i = 0; i < ftssCombinedCodeArray.length; i++) { - // ftssCombinedChnArray.push(flightStatus.find(val => val.sttc === ftssCombinedCodeArray[i]).stdc) - // } - // item['renderCombinedFlight']['FTSS'] = ftssCombinedChnArray.join(' / '); } return item; } + + public dynamicMessageHandle(message, combined_data, render_data, col_lists, filterItems, LASTSEARCH, LAST_SEL_COL, airports, citys, airlines, flightStatus) { + if (message.MVIN === 'A') { + //针对combined_data的处理 + let index = combined_data.findIndex(element => { + if (this.orderHandle.isArriFlight(element) || this.orderHandle.isLinked(element)) { + if (element['preFlight']['FLID'] === message.FLID) { + return true; + } else { + return false; + } + } else { + return false; + } + }); + if (index > -1) { + combined_data[index]['preFlight'] = message; + combined_data[index] = this.flightsRenderTransfer(combined_data[index], col_lists); + combined_data[index] = this.basicDataTransHandle(combined_data[index], airports, citys, airlines, flightStatus); + + if (message.UPTP === 'FLOP-AOTP') { + if (this.orderHandle.isArriFlight(combined_data[index])) { + if (message.TAID) { + combined_data.splice(index, 1); + + let i = combined_data.findIndex(element => { + if (this.orderHandle.isDeptFlight(element)) { + if (message.TAID === element['reaFlight']['FLID']) { + return true; + } else { + return false; + } + } else { + return false; + } + }) + combined_data[i]['reaFlight']['TAID'] = message.FLID; + let newFlight = {}; + newFlight['preFlight'] = message; + newFlight['reaFlight'] = combined_data[i]['reaFlight']; + + combined_data.splice(i, 1); + + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + combined_data.push(newFlight) + } + } else if (this.orderHandle.isLinked(combined_data[index])) { + if (!message.TAID) { + let newPreFlight = {}, + newReaFlight = {}; + + newPreFlight['preFlight'] = combined_data[index]['preFlight']; + newPreFlight['renderFlight'] = combined_data[index]['renderPreFlight']; + combined_data.push(newPreFlight); + + delete combined_data[index]['reaFlight']['TAID']; + newPreFlight['reaFlight'] = combined_data[index]['reaFlight']; + newPreFlight['renderFlight'] = combined_data[index]['renderReaFlight']; + combined_data.push(newReaFlight); + + combined_data.splice(index, 1); + } + } + } + } else { + let newFlight = {}; + newFlight['preFlight'] = message; + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + combined_data.push(newFlight); + } + + //针对render_data的处理 + let index1 = render_data.findIndex(element => { + if (this.orderHandle.isArriFlight(element) || this.orderHandle.isLinked(element)) { + if (element['preFlight']['FLID'] === message.FLID) { + return true; + } else { + return false; + } + } else { + return false; + } + }) + if (index1 > -1) { + render_data[index1]['preFlight'] = message; + render_data[index1] = this.flightsRenderTransfer(render_data[index1], col_lists); + render_data[index1] = this.basicDataTransHandle(render_data[index1], airports, citys, airlines, flightStatus); + + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (key === 'Abnormal_state') { + if (render_data[index1]['preFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } else { + if (render_data[index1]['preFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } + } + } + let search_satis = true; + if (LASTSEARCH) { + if (LAST_SEL_COL) { + if (render_data[index1]['preFlight'][LAST_SEL_COL]) { + if (render_data[index1]['preFlight'][LAST_SEL_COL].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + } else { + search_satis = false; + } + } else { + search_satis = false; + } + } else { + let cols = col_lists; + for (let i = 0; i < cols.length; i++) { + if (render_data[index1]['renderFlight'][cols[i]['COL_CODE']]) { + if (render_data[index1]['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + break; + } else { + search_satis = false; + continue; + } + } else { + search_satis = false; + continue; + } + } + } + } + + if (is_satis && search_satis) { + if (message.UPTP === 'FLOP-TAOP') { + if (this.orderHandle.isArriFlight(render_data[index1])) { + if (message.TAID) { + let i = render_data.findIndex(element => { + if (this.orderHandle.isDeptFlight(element)) { + if (message.TAID === element['reaFlight']['FLID']) { + return true; + } else { + return false; + } + } else { + return false; + } + }) + + if (i > -1) { + render_data.splice(index1, 1); + render_data[i]['reaFlight']['TAID'] = message.FLID; + let newFlight = {}; + newFlight['preFlight'] = message; + newFlight['reaFlight'] = render_data[i]['reaFlight']; + render_data.splice(i, 1); + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + render_data.push(newFlight) + } + } + } else if (this.orderHandle.isLinked(render_data[index1])) { + if (!message.TAID) { + let newPreFlight = {}, + newReaFlight = {}; + delete render_data[index1]['preFlight']['TAID']; + newPreFlight['preFlight'] = render_data[index1]['preFlight']; + newPreFlight['renderFlight'] = render_data[index1]['renderPreFlight']; + delete render_data[index1]['reaFlight']['TAID']; + newPreFlight['reaFlight'] = render_data[index1]['reaFlight']; + newPreFlight['renderFlight'] = render_data[index1]['renderReaFlight']; + render_data.splice(index1, 1); + render_data.push(newPreFlight); + render_data.push(newReaFlight); + } + } + } + } else { + if (this.orderHandle.isArriFlight(render_data[index1])) { + render_data.splice(index1, 1); + } else if (this.orderHandle.isLinked(render_data[index1])) { + delete render_data[index1]['preFlight']; + delete render_data[index1]['renderPreFlight']; + render_data[index1] = this.flightsRenderTransfer(render_data[index1], col_lists); + render_data[index1] = this.basicDataTransHandle(render_data[index1], airports, citys, airlines, flightStatus); + } + } + } else { + let newFlight = {}; + newFlight['preFlight'] = message; + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (key === 'Abnormal_state') { + if (newFlight['preFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } else { + if (newFlight['preFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } + } + } + + let search_satis = true; + if (LASTSEARCH) { + if (LAST_SEL_COL) { + if (newFlight['preFlight'][LAST_SEL_COL]) { + if (newFlight['preFlight'][LAST_SEL_COL].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + } else { + search_satis = false; + } + } else { + search_satis = false; + } + } else { + let cols = col_lists; + for (let i = 0; i < cols.length; i++) { + if (newFlight['renderFlight'][cols[i]['COL_CODE']]) { + if (newFlight['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + break; + } else { + search_satis = false; + continue; + } + } else { + search_satis = false; + continue; + } + } + } + } + if (is_satis && search_satis) { + let i = render_data.findIndex(element => { + if (this.orderHandle.isDeptFlight(element)) { + if (message.TAID === element['reaFlight']['FLID']) { + return true; + } else { + return false; + } + } else { + return false; + } + }) + + if (i > -1) { + let newFlight = {}; + newFlight['preFlight'] = message; + newFlight['reaFlight'] = Object.assign({}, render_data[i]['reaFlight']); + render_data.splice(i, 1); + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + render_data.push(newFlight); + } else { + render_data.push(newFlight); + } + } + } + } else { + //针对combined_data的处理 + let index = combined_data.findIndex(element => { + if (this.orderHandle.isDeptFlight(element) || this.orderHandle.isLinked(element)) { + if (element['reaFlight']['FLID'] === message.FLID) { + return true; + } else { + return false; + } + } else { + return false; + } + }); + if (index > -1) { + combined_data[index]['reaFlight'] = message; + combined_data[index] = this.flightsRenderTransfer(combined_data[index], col_lists); + combined_data[index] = this.basicDataTransHandle(combined_data[index], airports, citys, airlines, flightStatus); + } else { + let newFlight = {}; + newFlight['reaFlight'] = message; + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + combined_data.push(newFlight); + } + + //针对render_data的处理 + let index1 = render_data.findIndex(element => { + if (this.orderHandle.isDeptFlight(element) || this.orderHandle.isLinked(element)) { + if (element['reaFlight']['FLID'] === message.FLID) { + return true; + } else { + return false; + } + } else { + return false; + } + }); + if (index1 > -1) { + render_data[index1]['reaFlight'] = message; + render_data[index1] = this.flightsRenderTransfer(render_data[index1], col_lists); + render_data[index1] = this.basicDataTransHandle(render_data[index1], airports, citys, airlines, flightStatus); + + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (key === 'Abnormal_state') { + if (render_data[index1]['reaFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } else { + if (render_data[index1]['reaFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } + } + } + let search_satis = true; + if (LASTSEARCH) { + if (LAST_SEL_COL) { + if (render_data[index1]['reaFlight'][LAST_SEL_COL]) { + if (render_data[index1]['reaFlight'][LAST_SEL_COL].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + } else { + search_satis = false; + } + } else { + search_satis = false; + } + } else { + let cols = col_lists; + for (let i = 0; i < cols.length; i++) { + if (render_data[index1]['renderFlight'][cols[i]['COL_CODE']]) { + if (render_data[index1]['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + break; + } else { + search_satis = false; + continue; + } + } else { + search_satis = false; + continue; + } + } + } + } + if (!is_satis || !search_satis) { + if (this.orderHandle.isDeptFlight(render_data[index1])) { + render_data.splice(index1, 1); + } else if (this.orderHandle.isLinked(render_data[index1])) { + delete render_data[index1]['reaFlight']; + delete render_data[index1]['renderReaFlight']; + + render_data[index1] = this.flightsRenderTransfer(render_data[index1], col_lists); + render_data[index1] = this.basicDataTransHandle(render_data[index1], airports, citys, airlines, flightStatus); + } + } + } else { + let newFlight = {}; + newFlight['reaFlight'] = message; + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (key === 'Abnormal_state') { + if (newFlight['reaFlight'][filterItems[key]]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } else { + if (newFlight['reaFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } + } + } + let search_satis = true; + if (LASTSEARCH) { + if (LAST_SEL_COL) { + if (newFlight['reaFlight'][LAST_SEL_COL]) { + if (newFlight['reaFlight'][LAST_SEL_COL].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + } else { + search_satis = false; + } + } else { + search_satis = false; + } + } else { + let cols = col_lists; + for (let i = 0; i < cols.length; i++) { + if (newFlight['renderFlight'][cols[i]['COL_CODE']]) { + if (newFlight['renderFlight'][cols[i]['COL_CODE']].toString().match(new RegExp(LASTSEARCH, 'i'))) { + search_satis = true; + break; + } else { + search_satis = false; + continue; + } + } else { + search_satis = false; + continue; + } + } + } + } + if (is_satis && search_satis) { + let i = render_data.findIndex(element => { + if (this.orderHandle.isArriFlight(element)) { + if (message.TAID === element['preFlight']['FLID']) { + return true; + } else { + return false; + } + } else { + return false; + } + }) + + if (i > -1) { + let newFlight = {}; + newFlight['reaFlight'] = message; + newFlight['preFlight'] = Object.assign({}, render_data[i]['preFlight']); + render_data.splice(i, 1); + newFlight = this.flightsRenderTransfer(newFlight, col_lists); + newFlight = this.basicDataTransHandle(newFlight, airports, citys, airlines, flightStatus); + render_data.push(newFlight); + } else { + render_data.push(newFlight); + } + } + } + } + + return { + 'combined_data': combined_data, + 'render_data': render_data + } + } } \ No newline at end of file diff --git a/src/app/utils/abdg-formatter.ts b/src/app/utils/abdg-formatter.ts index f27b866..b4f3096 100644 --- a/src/app/utils/abdg-formatter.ts +++ b/src/app/utils/abdg-formatter.ts @@ -12,7 +12,7 @@ export default function (flight) { let set = new Set(abdg); return Array.from(set).join(','); }else{ - return flight['ABTM']['ABDG'] + return '' } }else{ return ''; diff --git a/src/app/utils/aotm_a-formatter.ts b/src/app/utils/aotm_a-formatter.ts index 484a6d4..1953b09 100644 --- a/src/app/utils/aotm_a-formatter.ts +++ b/src/app/utils/aotm_a-formatter.ts @@ -12,11 +12,7 @@ export default function (flight) { } } } else { - if (flight['ABTM']['ABOP'] === 'A') { - return timeFormatter(flight['ABTM']['AOTM']); - } else { - return ''; - } + return ''; } } else { return ''; diff --git a/src/app/utils/aotm_d-formatter.ts b/src/app/utils/aotm_d-formatter.ts index af452d6..8ee20b8 100644 --- a/src/app/utils/aotm_d-formatter.ts +++ b/src/app/utils/aotm_d-formatter.ts @@ -12,11 +12,7 @@ export default function (flight) { } } } else { - if (flight['ABTM']['ABOP'] === 'D') { - return timeFormatter(flight['ABTM']['AOTM']); - } else { - return ''; - } + return ''; } } else { return ''; diff --git a/src/app/utils/belt-formatter.ts b/src/app/utils/belt-formatter.ts index ff755c6..d1921a4 100644 --- a/src/app/utils/belt-formatter.ts +++ b/src/app/utils/belt-formatter.ts @@ -3,18 +3,18 @@ */ export default function (flight) { - if(flight['CLDT']){ - if(Array.isArray(flight['CLDT'])&&flight['CLDT'].length>0){ + if (flight['CLDT']) { + if (Array.isArray(flight['CLDT']) && flight['CLDT'].length > 0) { let belt = []; for (let i = 0; i < flight['CLDT'].length; i++) { belt.push(flight['CLDT'][i]['BELT']); } let set = new Set(belt); return Array.from(set).join(','); - }else{ - return flight['CLDT']['BELT'] + } else { + return ''; } - }else{ + } else { return ''; } } \ No newline at end of file diff --git a/src/app/utils/botm-formatter.ts b/src/app/utils/botm-formatter.ts index bebec9a..6e6f4da 100644 --- a/src/app/utils/botm-formatter.ts +++ b/src/app/utils/botm-formatter.ts @@ -1,5 +1,5 @@ /** - * 登机结束时间显示转换 + * 登机开始时间显示转换 */ import timeFormatter from './time-formatter'; diff --git a/src/app/utils/cctm-formatter.ts b/src/app/utils/cctm-formatter.ts index f5df47c..c213b9c 100644 --- a/src/app/utils/cctm-formatter.ts +++ b/src/app/utils/cctm-formatter.ts @@ -7,7 +7,7 @@ export default function(flight){ if(Array.isArray(flight['CKDT'])&&flight['CKDT'].length>0){ return timeFormatter(flight['CKDT'][0]['CCTM']); }else{ - return timeFormatter(flight['CKDT']['CCTM']); + return ''; } }else{ return ''; diff --git a/src/app/utils/chkc-formatter.ts b/src/app/utils/chkc-formatter.ts index 2162694..e1c5911 100644 --- a/src/app/utils/chkc-formatter.ts +++ b/src/app/utils/chkc-formatter.ts @@ -11,7 +11,7 @@ export default function(flight){ let set = new Set(chkc); return Array.from(set).join(','); }else{ - return flight['CKDT']['CHKC'] + return ''; } }else{ return ''; diff --git a/src/app/utils/chtm_off-formatter.ts b/src/app/utils/chtm_off-formatter.ts index 98e6d27..8866c3f 100644 --- a/src/app/utils/chtm_off-formatter.ts +++ b/src/app/utils/chtm_off-formatter.ts @@ -12,11 +12,7 @@ export default function (flight) { } } } else { - if (flight['CHOT']['CHID'] === 'OFF') { - return timeFormatter(flight['CHOT']['CHTM']); - } else { - return ''; - } + return ''; } } else { return ''; diff --git a/src/app/utils/chtm_on-formatter.ts b/src/app/utils/chtm_on-formatter.ts index 78fd217..fa9f73f 100644 --- a/src/app/utils/chtm_on-formatter.ts +++ b/src/app/utils/chtm_on-formatter.ts @@ -12,11 +12,7 @@ export default function (flight) { } } } else { - if (flight['CHOT']['CHID'] === 'ON') { - return timeFormatter(flight['CHOT']['CHTM']); - } else { - return ''; - } + return ''; } } else { return ''; diff --git a/src/app/utils/chut-formatter.ts b/src/app/utils/chut-formatter.ts index d029db0..94db545 100644 --- a/src/app/utils/chut-formatter.ts +++ b/src/app/utils/chut-formatter.ts @@ -11,7 +11,7 @@ export default function (flight) { let set = new Set(chdt); return Array.from(set).join(','); }else{ - return flight['CHDT']['CHUT'] + return ''; } }else{ return ''; diff --git a/src/app/utils/cotm-formatter.ts b/src/app/utils/cotm-formatter.ts index b6dc041..75496d8 100644 --- a/src/app/utils/cotm-formatter.ts +++ b/src/app/utils/cotm-formatter.ts @@ -2,14 +2,14 @@ * 值机结束时间显示转换 */ import timeFormatter from './time-formatter'; -export default function(flight){ - if(flight['CKDT']){ - if(Array.isArray(flight['CKDT'])&&flight['CKDT'].length>0){ +export default function (flight) { + if (flight['CKDT']) { + if (Array.isArray(flight['CKDT']) && flight['CKDT'].length > 0) { return timeFormatter(flight['CKDT'][0]['COTM']); - }else{ - return timeFormatter(flight['CKDT']['COTM']); + } else { + return ''; } - }else{ + } else { return ''; } } \ No newline at end of file diff --git a/src/app/utils/erut-formatter.ts b/src/app/utils/erut-formatter.ts index 6c96f22..7dbb502 100644 --- a/src/app/utils/erut-formatter.ts +++ b/src/app/utils/erut-formatter.ts @@ -10,7 +10,7 @@ export default function(flight){ } return erut.join(' - '); }else{ - return flight['ERUT']['APCD'] + return ''; } }else{ return ''; diff --git a/src/app/utils/gate-formatter.ts b/src/app/utils/gate-formatter.ts index b087e87..88db049 100644 --- a/src/app/utils/gate-formatter.ts +++ b/src/app/utils/gate-formatter.ts @@ -1,7 +1,6 @@ /** * 登机门显示转换 */ -import timeFormatter from './time-formatter'; export default function (flight) { if (flight['GTDT']) { @@ -13,7 +12,7 @@ export default function (flight) { let set = new Set(gate); return Array.from(set).join(','); } else { - return flight['GTDT']['GATE']; + return ''; } } else { return ''; diff --git a/src/app/utils/gctm-formatter.ts b/src/app/utils/gctm-formatter.ts index aa36525..0ef76b5 100644 --- a/src/app/utils/gctm-formatter.ts +++ b/src/app/utils/gctm-formatter.ts @@ -8,7 +8,7 @@ export default function (flight) { if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) { return timeFormatter(flight['GTDT'][0]['GCTM']); } else { - return timeFormatter(flight['GTDT']['GCTM']); + return ''; } } else { return ''; diff --git a/src/app/utils/psst-formatter.ts b/src/app/utils/psst-formatter.ts index 0df4ade..e1302e7 100644 --- a/src/app/utils/psst-formatter.ts +++ b/src/app/utils/psst-formatter.ts @@ -11,7 +11,7 @@ export default function(flight){ let set = new Set(chkc); return Array.from(set).join(','); }else{ - return flight['PSDT']['PSST'] + return ''; } }else{ return ''; diff --git a/src/assets/images/important-notes/alternate .png b/src/assets/images/important-notes/alternate .png new file mode 100644 index 0000000..6ae5af7 Binary files /dev/null and b/src/assets/images/important-notes/alternate .png differ diff --git a/src/assets/images/important-notes/cancle.png b/src/assets/images/important-notes/cancle.png new file mode 100644 index 0000000..42654fe Binary files /dev/null and b/src/assets/images/important-notes/cancle.png differ diff --git a/src/assets/images/important-notes/delay.png b/src/assets/images/important-notes/delay.png new file mode 100644 index 0000000..c7c288b Binary files /dev/null and b/src/assets/images/important-notes/delay.png differ diff --git a/src/assets/images/important-notes/delay_30.png b/src/assets/images/important-notes/delay_30.png new file mode 100644 index 0000000..854563a Binary files /dev/null and b/src/assets/images/important-notes/delay_30.png differ diff --git a/src/assets/images/important-notes/out_plan.png b/src/assets/images/important-notes/out_plan.png new file mode 100644 index 0000000..0fb8d20 Binary files /dev/null and b/src/assets/images/important-notes/out_plan.png differ diff --git a/src/assets/images/important-notes/return.png b/src/assets/images/important-notes/return.png new file mode 100644 index 0000000..2a2bb83 Binary files /dev/null and b/src/assets/images/important-notes/return.png differ diff --git a/src/assets/images/important-notes/stopover.png b/src/assets/images/important-notes/stopover.png new file mode 100644 index 0000000..5c0d0c6 Binary files /dev/null and b/src/assets/images/important-notes/stopover.png differ diff --git a/src/assets/images/important-notes/vip.png b/src/assets/images/important-notes/vip.png new file mode 100644 index 0000000..0811aa0 Binary files /dev/null and b/src/assets/images/important-notes/vip.png differ