航班信息显示转换
This commit is contained in:
@@ -7,6 +7,7 @@ import { ToastService } from '../components/toast/toast.service';
|
|||||||
import { ToastConfig, ToastType } from '../components/toast/toast-model';
|
import { ToastConfig, ToastType } from '../components/toast/toast-model';
|
||||||
|
|
||||||
import { HttpClientService } from '../services/http-client.service';
|
import { HttpClientService } from '../services/http-client.service';
|
||||||
|
import { HttpHeaders } from '@angular/common/http';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -19,34 +20,30 @@ export class LoginComponent implements OnInit {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private httpClient:HttpClientService,
|
private httpClient: HttpClientService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
loginForm: FormGroup = this.formBuilder.group({
|
loginForm: FormGroup = this.formBuilder.group({
|
||||||
'username': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]],
|
'username': ['', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]],
|
||||||
'password': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]]
|
'password': ['', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]]
|
||||||
})
|
})
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_submit() {
|
_submit() {
|
||||||
// this.httpClient.post('/login',this.loginForm.value).subscribe(
|
this.httpClient.post('/login', this.loginForm.value).subscribe(
|
||||||
// data=>{
|
data => {
|
||||||
// console.log(data)
|
if(data.is_success){
|
||||||
// }
|
|
||||||
// )
|
|
||||||
|
|
||||||
|
|
||||||
let date = new Date()
|
|
||||||
// date.setTime(date.getTime() + 10 * 60 * 1000)
|
|
||||||
//为了测试方便,把用户登录缓存时间加长
|
|
||||||
date.setTime(date.getTime() + 10 * 60 * 1000000000000)
|
|
||||||
document.cookie = 'token=cnlpYWRtaW4lM0FyeWlhZG1pbg==;path=/;expires=' + date.toUTCString()
|
|
||||||
|
|
||||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '登录成功!', 3000);
|
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '登录成功!', 3000);
|
||||||
this.toastService.toast(toastCfg);
|
this.toastService.toast(toastCfg);
|
||||||
this.router.navigate(['../app'], { relativeTo: this.route })
|
this.router.navigate(['../app'], { relativeTo: this.route })
|
||||||
|
}else{
|
||||||
|
const toastCfg = new ToastConfig(ToastType.ERROR, '', '登录失败!', 3000);
|
||||||
|
this.toastService.toast(toastCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { Subject, forkJoin, zip } from 'rxjs'
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BasicDataService {
|
export class BasicDataService {
|
||||||
|
public flightStatus:Array<any>;
|
||||||
|
public flightStatus_subject = new Subject<any>();
|
||||||
public checkin_group: Array<any>;
|
public checkin_group: Array<any>;
|
||||||
public checkin_group_subject = new Subject<any>();
|
public checkin_group_subject = new Subject<any>();
|
||||||
public gate: Array<any>;
|
public gate: Array<any>;
|
||||||
@@ -36,7 +38,7 @@ export class BasicDataService {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
loadBasicData() {
|
loadBasicData() {
|
||||||
console.log('---')
|
let flightStatusHttp = this.httpClient.get('/adminapi/basicdata/sysFlightStatus');
|
||||||
let checkinGroupHttp = this.httpClient.get('/adminapi/basicdata/checkinGroups');
|
let checkinGroupHttp = this.httpClient.get('/adminapi/basicdata/checkinGroups');
|
||||||
let gateHttp = this.httpClient.get('/adminapi/basicdata/ormsGates');
|
let gateHttp = this.httpClient.get('/adminapi/basicdata/ormsGates');
|
||||||
let terminalHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminals');
|
let terminalHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminals');
|
||||||
@@ -51,6 +53,7 @@ export class BasicDataService {
|
|||||||
let terminalAreaHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminalareas');
|
let terminalAreaHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminalareas');
|
||||||
let airlineHttp = this.httpClient.get('/adminapi/basicdata/sysAirlines');
|
let airlineHttp = this.httpClient.get('/adminapi/basicdata/sysAirlines');
|
||||||
zip(
|
zip(
|
||||||
|
flightStatusHttp,
|
||||||
checkinGroupHttp,
|
checkinGroupHttp,
|
||||||
gateHttp,
|
gateHttp,
|
||||||
terminalHttp,
|
terminalHttp,
|
||||||
@@ -66,6 +69,7 @@ export class BasicDataService {
|
|||||||
airlineHttp
|
airlineHttp
|
||||||
).subscribe(
|
).subscribe(
|
||||||
([
|
([
|
||||||
|
flightStatusRes,
|
||||||
checkinGroupRes,
|
checkinGroupRes,
|
||||||
gateRes,
|
gateRes,
|
||||||
terminalRes,
|
terminalRes,
|
||||||
@@ -80,12 +84,15 @@ export class BasicDataService {
|
|||||||
terminalAreaRes,
|
terminalAreaRes,
|
||||||
airlineRes
|
airlineRes
|
||||||
]) => {
|
]) => {
|
||||||
|
console.log('---')
|
||||||
|
this.flightStatus = flightStatusRes.body;
|
||||||
|
this.flightStatus_subject.next(flightStatusRes.body);
|
||||||
this.checkin_group = checkinGroupRes.body;
|
this.checkin_group = checkinGroupRes.body;
|
||||||
this.checkin_group_subject.next(checkinGroupRes.body);
|
this.checkin_group_subject.next(checkinGroupRes.body);
|
||||||
this.gate = gateRes.body;
|
this.gate = gateRes.body;
|
||||||
this.gate_subject.next(gateRes.body);
|
this.gate_subject.next(gateRes.body);
|
||||||
this.terminal = terminalRes.body;
|
this.terminal = terminalRes.body;
|
||||||
this.terminal_area_subject.next(terminalRes.body);
|
this.terminal_subject.next(terminalRes.body);
|
||||||
this.chut = chutRes.body;
|
this.chut = chutRes.body;
|
||||||
this.chut_subject.next(chutRes.body);
|
this.chut_subject.next(chutRes.body);
|
||||||
this.stand = standRes.body;
|
this.stand = standRes.body;
|
||||||
@@ -94,10 +101,6 @@ export class BasicDataService {
|
|||||||
this.carousel_subject.next(carouselRes.body);
|
this.carousel_subject.next(carouselRes.body);
|
||||||
this.checkin_desk = checkinDeskRes.body;
|
this.checkin_desk = checkinDeskRes.body;
|
||||||
this.checkin_desk_subject.next(checkinDeskRes.body);
|
this.checkin_desk_subject.next(checkinDeskRes.body);
|
||||||
this.airport = airportRes.body;
|
|
||||||
this.airport_subject.next(airportRes.body);
|
|
||||||
this.city = cityRes.body;
|
|
||||||
this.city_subject.next(cityRes.body);
|
|
||||||
this.aircraft_type = aircraftTypeRes.body;
|
this.aircraft_type = aircraftTypeRes.body;
|
||||||
this.aircraft_type_subject.next(aircraftTypeRes.body);
|
this.aircraft_type_subject.next(aircraftTypeRes.body);
|
||||||
this.aircraft = aircraftRes.body;
|
this.aircraft = aircraftRes.body;
|
||||||
@@ -106,6 +109,10 @@ export class BasicDataService {
|
|||||||
this.terminal_area_subject.next(terminalAreaRes.body);
|
this.terminal_area_subject.next(terminalAreaRes.body);
|
||||||
this.airline = airlineRes.body;
|
this.airline = airlineRes.body;
|
||||||
this.airline_subject.next(airlineRes.body);
|
this.airline_subject.next(airlineRes.body);
|
||||||
|
this.city = cityRes.body;
|
||||||
|
this.city_subject.next(cityRes.body);
|
||||||
|
this.airport = airportRes.body;
|
||||||
|
this.airport_subject.next(airportRes.body);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
<div class="search-filter mb-3">
|
<div class="search-filter mb-3">
|
||||||
<div class="first-condition row">
|
<div class="first-condition row">
|
||||||
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
|
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
|
||||||
<select class="mr-4 form-control" name="" id="">
|
<select [(ngModel)]="SEL_COL" class="mr-4 form-control" name="" id="">
|
||||||
<option value="">选择列名</option>
|
<option value="">选择列名</option>
|
||||||
|
<option *ngFor="let airline_col of col_lists" [value]="airline_col.COL_CODE">{{airline_col.COL_CN}}</option>
|
||||||
</select>
|
</select>
|
||||||
<label class="radio-inline custom-radio nowrap mr-4">
|
<label class="radio-inline custom-radio nowrap mr-4">
|
||||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
<label for="">航空公司: </label>
|
<label for="">航空公司: </label>
|
||||||
<select [(ngModel)]="filterItems.ALCD" class="form-control">
|
<select [(ngModel)]="filterItems.ALCD" class="form-control">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
|
<option *ngFor="let airline of airlines" [value]="airline.airlineCodeIata">{{airline.airlineName}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-container mr-4">
|
<div class="input-container mr-4">
|
||||||
@@ -75,8 +77,7 @@
|
|||||||
<label for="">航站楼: </label>
|
<label for="">航站楼: </label>
|
||||||
<select [(ngModel)]="filterItems.TRML" (ngModelChange)="selectChange()" class="form-control">
|
<select [(ngModel)]="filterItems.TRML" (ngModelChange)="selectChange()" class="form-control">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="T1">T1</option>
|
<option *ngFor="let terminal of terminals" [value]="terminal.terminalCode">{{terminal.terminalName}}</option>
|
||||||
<option value="T2">T2</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-container mr-4">
|
<div class="input-container mr-4">
|
||||||
|
|||||||
@@ -5,10 +5,31 @@ import { HttpClientService } from '../../services/http-client.service';
|
|||||||
import { BasicDataService } from '../basic-data-service'
|
import { BasicDataService } from '../basic-data-service'
|
||||||
|
|
||||||
import dateFormatter from '../../utils/data-formatter';
|
import dateFormatter from '../../utils/data-formatter';
|
||||||
import routeType from '../../utils/route-type';
|
import timeFormatter from '../../utils/time-formatter';
|
||||||
import flightType from '../../utils/flight-type';
|
|
||||||
import arriDept from '../../utils/arri-dept';
|
import gctmFormatter from '../../utils/gctm-formatter';
|
||||||
import { HttpParams } from '@angular/common/http';
|
import botmFormatter from '../../utils/botm-formatter';
|
||||||
|
import abdgFormatter from '../../utils/abdg-formatter';
|
||||||
|
import aotm_aFormatter from '../../utils/aotm_a-formatter';
|
||||||
|
import aotm_dFormatter from '../../utils/aotm_d-formatter';
|
||||||
|
import beltFormatter from '../../utils/belt-formatter';
|
||||||
|
import chkcFormatter from '../../utils/chkc-formatter';
|
||||||
|
import cctmFormatter from '../../utils/cctm-formatter';
|
||||||
|
import cotmFormatter from '../../utils/cotm-formatter';
|
||||||
|
import chtmOnFormatter from '../../utils/chtm_on-formatter';
|
||||||
|
import chtmOffFormatter from '../../utils/chtm_off-formatter';
|
||||||
|
import laclFormatter from '../../utils/lacl-formatter';
|
||||||
|
import chutFormatter from '../../utils/chut-formatter';
|
||||||
|
import acttFormatter from '../../utils/actt-formatter';
|
||||||
|
import psstFormatter from '../../utils/psst-formatter';
|
||||||
|
import esttFormatter from '../../utils/estt-formatter';
|
||||||
|
import mvinFormatter from '../../utils/mvin-formatter';
|
||||||
|
import erutFormatter from '../../utils/erut-formatter';
|
||||||
|
import flinFormatter from '../../utils/flin-formatter';
|
||||||
|
import sodtFormatter from '../../utils/sodt-formatter';
|
||||||
|
import gateFormatter from '../../utils/gate-formatter';
|
||||||
|
import padtFormatter from '../../utils/padt-formatter';
|
||||||
|
|
||||||
|
|
||||||
import * as $ from 'jquery';
|
import * as $ from 'jquery';
|
||||||
@Component({
|
@Component({
|
||||||
@@ -25,19 +46,10 @@ export class MainComponent implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
//各项基础数据
|
//各项基础数据
|
||||||
public checkin_group: Array<any>;
|
public flightStatus: Array<any>;
|
||||||
public gate: Array<any>;
|
public airports: Array<any>;
|
||||||
public terminal: Array<any>;
|
public citys: Array<any>;;
|
||||||
public chut: Array<any>;
|
public airlines: Array<any>;
|
||||||
public stand: Array<any>;
|
|
||||||
public carousel: Array<any>;
|
|
||||||
public checkin_desk: Array<any>;
|
|
||||||
public airport: Array<any>;
|
|
||||||
public city: Array<any>;
|
|
||||||
public aircraft_type: Array<any>;
|
|
||||||
public aircraft: Array<any>;
|
|
||||||
public terminal_area: Array<any>;
|
|
||||||
public airline: Array<any>;
|
|
||||||
|
|
||||||
public raw_data: Array<object> = []; //原始数据,即航班计划
|
public raw_data: Array<object> = []; //原始数据,即航班计划
|
||||||
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
|
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
|
||||||
@@ -48,24 +60,32 @@ export class MainComponent implements OnInit {
|
|||||||
public row_state: any = { renderFlight: {} };
|
public row_state: any = { renderFlight: {} };
|
||||||
|
|
||||||
public formatter = {
|
public formatter = {
|
||||||
'MVIN': {
|
'GCTM': gctmFormatter,
|
||||||
'A': '到达',
|
'BOTM': botmFormatter,
|
||||||
'D': '出发',
|
'ABDG': abdgFormatter,
|
||||||
'DF': '其他'
|
'AOTM_A': aotm_aFormatter,
|
||||||
},
|
'AOTM_D': aotm_dFormatter,
|
||||||
'FLIN': {
|
'BELT': beltFormatter,
|
||||||
'D': '国内',
|
'CHKC': chkcFormatter,
|
||||||
'I': '国际',
|
'CCTM': cctmFormatter,
|
||||||
'M': '混合',
|
'COTM': cotmFormatter,
|
||||||
'R': '地区',
|
'CHTM_ON': chtmOnFormatter,
|
||||||
'DF': '其他'
|
'CHTM_OFF': chtmOffFormatter,
|
||||||
},
|
'LACL': laclFormatter,
|
||||||
'SODT': dateFormatter,
|
'CHUT': chutFormatter,
|
||||||
'ESTT': dateFormatter,
|
'ACTT': acttFormatter,
|
||||||
'ACTT': dateFormatter
|
'PSST': psstFormatter,
|
||||||
|
'ESTT': esttFormatter,
|
||||||
|
'MVIN': mvinFormatter,
|
||||||
|
'ERUT': erutFormatter,
|
||||||
|
'FLIN': flinFormatter,
|
||||||
|
'SODT': sodtFormatter,
|
||||||
|
'GATE': gateFormatter,
|
||||||
|
'PADT': padtFormatter
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
// this.getBasicData()
|
||||||
this.changeDetectorRef.detach();
|
this.changeDetectorRef.detach();
|
||||||
/* 获取显示列 */
|
/* 获取显示列 */
|
||||||
this.httpCilent.get('/assets/mock-data/airline-col_code.json').subscribe(
|
this.httpCilent.get('/assets/mock-data/airline-col_code.json').subscribe(
|
||||||
@@ -85,8 +105,6 @@ export class MainComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let combined_linked_data = this.raw_data;
|
let combined_linked_data = this.raw_data;
|
||||||
// this.combined_data = this.raw_data
|
|
||||||
|
|
||||||
//查找链接航班并将其组合成一条数据
|
//查找链接航班并将其组合成一条数据
|
||||||
for (let i = 0; i < combined_linked_data.length; i++) {
|
for (let i = 0; i < combined_linked_data.length; i++) {
|
||||||
if (combined_linked_data[i]['MVIN'] === 'D') {
|
if (combined_linked_data[i]['MVIN'] === 'D') {
|
||||||
@@ -111,7 +129,7 @@ export class MainComponent implements OnInit {
|
|||||||
|
|
||||||
for (let i = 0; i < this.col_lists.length; i++) {
|
for (let i = 0; i < this.col_lists.length; i++) {
|
||||||
let key = this.col_lists[i]['COL_CODE']
|
let key = this.col_lists[i]['COL_CODE']
|
||||||
render_flight[key] = typeof (this.formatter[key]) === 'function' ? this.formatter[key](row_flights['preFlight'][key], 1) : this.formatter[key] ? this.formatter[key][row_flights['preFlight'][key]] : row_flights['preFlight'][key];
|
render_flight[key] = this.formatter.hasOwnProperty(key) ? this.formatter[key](row_flights['preFlight']) : row_flights['preFlight'][key];
|
||||||
}
|
}
|
||||||
row_flights['renderFlight'] = render_flight;
|
row_flights['renderFlight'] = render_flight;
|
||||||
|
|
||||||
@@ -119,7 +137,7 @@ export class MainComponent implements OnInit {
|
|||||||
row_flights['reaFlight'] = element;
|
row_flights['reaFlight'] = element;
|
||||||
for (let i = 0; i < this.col_lists.length; i++) {
|
for (let i = 0; i < this.col_lists.length; i++) {
|
||||||
let key = this.col_lists[i]['COL_CODE']
|
let key = this.col_lists[i]['COL_CODE']
|
||||||
render_flight[key] = typeof (this.formatter[key]) === 'function' ? this.formatter[key](row_flights['reaFlight'][key], 1) : this.formatter[key] ? this.formatter[key][row_flights['reaFlight'][key]] : row_flights['reaFlight'][key];
|
render_flight[key] = this.formatter.hasOwnProperty(key) ? this.formatter[key](row_flights['reaFlight']) : row_flights['reaFlight'][key];
|
||||||
}
|
}
|
||||||
row_flights['renderFlight'] = render_flight;
|
row_flights['renderFlight'] = render_flight;
|
||||||
|
|
||||||
@@ -132,19 +150,47 @@ export class MainComponent implements OnInit {
|
|||||||
for (let i = 0; i < this.col_lists.length; i++) {
|
for (let i = 0; i < this.col_lists.length; i++) {
|
||||||
let key = this.col_lists[i]['COL_CODE']
|
let key = this.col_lists[i]['COL_CODE']
|
||||||
if (this.formatter.hasOwnProperty(key)) {
|
if (this.formatter.hasOwnProperty(key)) {
|
||||||
if (typeof (this.formatter[key]) === 'function') {
|
let preHasValue = this.formatter[key](row_flights['preFlight']);
|
||||||
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key](row_flights['preFlight'][key], 1)) : (this.formatter[key](row_flights['preFlight'][key], 1) + '/' + this.formatter[key](row_flights['reaFlight'][key], 1));
|
let reaHasValue = this.formatter[key](row_flights['reaFlight']);
|
||||||
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
|
if (preHasValue && !reaHasValue) {
|
||||||
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
|
render_flight[key] = preHasValue;
|
||||||
|
} else if (!preHasValue && reaHasValue) {
|
||||||
|
render_flight[key] = reaHasValue;
|
||||||
|
} else if (preHasValue && reaHasValue) {
|
||||||
|
if (preHasValue === reaHasValue) {
|
||||||
|
render_flight[key] = preHasValue
|
||||||
} else {
|
} else {
|
||||||
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key][row_flights['preFlight'][key]]) : (this.formatter[key][row_flights['preFlight'][key]] + '/' + this.formatter[key][row_flights['reaFlight'][key]]);
|
if (key === 'ERUT') {
|
||||||
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
|
render_flight[key] = preHasValue.split(' - ').slice(0, -1).join(' - ') + ' - ' + reaHasValue;
|
||||||
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
|
} else {
|
||||||
|
render_flight[key] = preHasValue + ' / ' + reaHasValue;
|
||||||
|
}
|
||||||
|
// render_flight[key] = preHasValue + ' / ' + reaHasValue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (row_flights['preFlight'][key]) : (row_flights['preFlight'][key] + '/' + row_flights['reaFlight'][key]);
|
render_flight[key] = '';
|
||||||
render_pre_flight[key] = row_flights['preFlight'][key];
|
}
|
||||||
render_rea_flight[key] = row_flights['reaFlight'][key];
|
render_pre_flight[key] = preHasValue;
|
||||||
|
render_rea_flight[key] = reaHasValue;
|
||||||
|
} else {
|
||||||
|
let preHasValue = row_flights['preFlight'][key];
|
||||||
|
let reaHasValue = row_flights['reaFlight'][key]
|
||||||
|
if (preHasValue && !reaHasValue) {
|
||||||
|
render_flight[key] = preHasValue;
|
||||||
|
} else if (!preHasValue && reaHasValue) {
|
||||||
|
render_flight[key] = reaHasValue;
|
||||||
|
} else if (preHasValue && reaHasValue) {
|
||||||
|
if (preHasValue === reaHasValue) {
|
||||||
|
render_flight[key] = preHasValue
|
||||||
|
} else {
|
||||||
|
render_flight[key] = preHasValue + ' / ' + reaHasValue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
render_flight[key] = '';
|
||||||
|
}
|
||||||
|
// render_flight[key] = (row_flights['preFlight'][key] + '/' + row_flights['reaFlight'][key]);
|
||||||
|
render_pre_flight[key] = preHasValue;
|
||||||
|
render_rea_flight[key] = reaHasValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
row_flights['renderFlight'] = render_flight;
|
row_flights['renderFlight'] = render_flight;
|
||||||
@@ -154,7 +200,32 @@ export class MainComponent implements OnInit {
|
|||||||
this.combined_data.push(row_flights)
|
this.combined_data.push(row_flights)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.doSequence(this.combined_data);
|
//从基础数据服务中拿出部分基础数据
|
||||||
|
this.flightStatus = this.basicDataService.flightStatus;
|
||||||
|
this.airlines = this.basicDataService.airline;
|
||||||
|
this.citys = this.basicDataService.city;
|
||||||
|
this.airports = this.basicDataService.airport;
|
||||||
|
|
||||||
|
if (this.airports && this.airports.length > 0) {
|
||||||
|
this.basicDataTransHandle();
|
||||||
|
} else {
|
||||||
|
this.basicDataService.flightStatus_subject.subscribe(
|
||||||
|
val => this.flightStatus = val
|
||||||
|
);
|
||||||
|
this.basicDataService.airline_subject.subscribe(
|
||||||
|
val => this.airlines = val
|
||||||
|
);
|
||||||
|
this.basicDataService.city_subject.subscribe(
|
||||||
|
val => this.citys = val
|
||||||
|
);
|
||||||
|
this.basicDataService.airport_subject.subscribe(
|
||||||
|
val => {
|
||||||
|
this.airports = val;
|
||||||
|
this.basicDataTransHandle();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -172,59 +243,138 @@ export class MainComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* 获取基础数据
|
* 获取基础数据
|
||||||
*/
|
*/
|
||||||
getBasicData() {
|
// getBasicData() {
|
||||||
this.checkin_group = this.basicDataService.checkin_group;
|
// this.checkin_group = this.basicDataService.checkin_group;
|
||||||
this.basicDataService.checkin_group_subject.subscribe(
|
// this.basicDataService.checkin_group_subject.subscribe(
|
||||||
val => this.checkin_group = val
|
// val => this.checkin_group = val
|
||||||
);
|
// );
|
||||||
this.gate = this.basicDataService.gate;
|
// this.gate = this.basicDataService.gate;
|
||||||
this.basicDataService.gate_subject.subscribe(
|
// this.basicDataService.gate_subject.subscribe(
|
||||||
val => this.gate = val
|
// val => this.gate = val
|
||||||
);
|
// );
|
||||||
this.terminal = this.basicDataService.terminal;
|
// this.terminals = this.basicDataService.terminal;
|
||||||
this.basicDataService.terminal_subject.subscribe(
|
// this.basicDataService.terminal_subject.subscribe(
|
||||||
val => this.terminal = val
|
// val => {
|
||||||
);
|
// this.terminals = val;
|
||||||
this.chut = this.basicDataService.chut;
|
// this.changeDetectorRef.detectChanges();
|
||||||
this.basicDataService.chut_subject.subscribe(
|
// }
|
||||||
val => this.chut = val
|
// );
|
||||||
);
|
// this.chut = this.basicDataService.chut;
|
||||||
this.stand = this.basicDataService.stand;
|
// this.basicDataService.chut_subject.subscribe(
|
||||||
this.basicDataService.stand_subject.subscribe(
|
// val => this.chut = val
|
||||||
val => this.stand = val
|
// );
|
||||||
);
|
// this.stand = this.basicDataService.stand;
|
||||||
this.carousel = this.basicDataService.carousel;
|
// this.basicDataService.stand_subject.subscribe(
|
||||||
this.basicDataService.carousel_subject.subscribe(
|
// val => this.stand = val
|
||||||
val => this.carousel = val
|
// );
|
||||||
);
|
// this.carousel = this.basicDataService.carousel;
|
||||||
this.checkin_desk = this.basicDataService.checkin_desk;
|
// this.basicDataService.carousel_subject.subscribe(
|
||||||
this.basicDataService.checkin_desk_subject.subscribe(
|
// val => this.carousel = val
|
||||||
val => this.checkin_desk = val
|
// );
|
||||||
);
|
// this.checkin_desk = this.basicDataService.checkin_desk;
|
||||||
this.airport = this.basicDataService.airport;
|
// this.basicDataService.checkin_desk_subject.subscribe(
|
||||||
this.basicDataService.airport_subject.subscribe(
|
// val => this.checkin_desk = val
|
||||||
val => this.airport = val
|
// );
|
||||||
);
|
// this.airports = this.basicDataService.airport;
|
||||||
this.city = this.basicDataService.city;
|
// this.basicDataService.airport_subject.subscribe(
|
||||||
this.basicDataService.city_subject.subscribe(
|
// val => this.airports = val
|
||||||
val => this.city = val
|
// );
|
||||||
);
|
// this.citys = this.basicDataService.city;
|
||||||
this.aircraft_type = this.basicDataService.aircraft_type;
|
// this.basicDataService.city_subject.subscribe(
|
||||||
this.basicDataService.aircraft_type_subject.subscribe(
|
// val => this.citys = val
|
||||||
val => this.aircraft_type = val
|
// );
|
||||||
);
|
// this.aircraft_type = this.basicDataService.aircraft_type;
|
||||||
this.aircraft = this.basicDataService.aircraft;
|
// this.basicDataService.aircraft_type_subject.subscribe(
|
||||||
this.basicDataService.aircraft_subject.subscribe(
|
// val => this.aircraft_type = val
|
||||||
val => this.aircraft = val
|
// );
|
||||||
);
|
// this.aircraft = this.basicDataService.aircraft;
|
||||||
this.terminal_area = this.basicDataService.terminal_area;
|
// this.basicDataService.aircraft_subject.subscribe(
|
||||||
this.basicDataService.terminal_area_subject.subscribe(
|
// val => this.aircraft = val
|
||||||
val => this.terminal_area = val
|
// );
|
||||||
);
|
// this.terminal_area = this.basicDataService.terminal_area;
|
||||||
this.airline = this.basicDataService.airline;
|
// this.basicDataService.terminal_area_subject.subscribe(
|
||||||
this.basicDataService.airline_subject.subscribe(
|
// val => this.terminal_area = val
|
||||||
val => this.airline = val
|
// );
|
||||||
);
|
// this.airlines = this.basicDataService.airline;
|
||||||
|
// this.basicDataService.airline_subject.subscribe(
|
||||||
|
// val => {
|
||||||
|
// this.airlines = val;
|
||||||
|
// this.changeDetectorRef.detectChanges();
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// this.changeDetectorRef.detectChanges();
|
||||||
|
// }
|
||||||
|
|
||||||
|
basicDataTransHandle() {
|
||||||
|
this.combined_data.forEach(item => {
|
||||||
|
if (this.isArriFlight(item) || this.isDeptFlight(item)) {
|
||||||
|
//航线处理
|
||||||
|
let erutCodeArray = item['renderFlight']['ERUT'].split(' - ');
|
||||||
|
let erutChnArray = []
|
||||||
|
for (let i = 0; i < erutCodeArray.length; i++) {
|
||||||
|
let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutCodeArray[i]);
|
||||||
|
let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId);
|
||||||
|
erutChnArray.push(this.citys[cityIndex].cityNameChn);
|
||||||
|
}
|
||||||
|
item['renderFlight']['ERUT'] = erutChnArray.join(' - ');
|
||||||
|
//航空公司处理
|
||||||
|
let airlineIndex = this.airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
|
||||||
|
item['renderFlight']['ALCD'] = this.airlines[airlineIndex].airlineName;
|
||||||
|
//运营状态处理
|
||||||
|
item['renderFlight']['FTSS'] = this.flightStatus.find(val => val.sttc === item['renderFlight']['FTSS']).stdc
|
||||||
|
} else {
|
||||||
|
//航线处理
|
||||||
|
let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - ');
|
||||||
|
let erutLinkChnArray = []
|
||||||
|
for (let i = 0; i < erutLinkCodeArray.length; i++) {
|
||||||
|
let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]);
|
||||||
|
let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId);
|
||||||
|
erutLinkChnArray.push(this.citys[cityIndex].cityNameChn);
|
||||||
|
}
|
||||||
|
item['renderFlight']['ERUT'] = erutLinkChnArray.join(' - ');
|
||||||
|
//航空公司处理
|
||||||
|
let airlineLinkIndex = this.airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
|
||||||
|
item['renderFlight']['ALCD'] = this.airlines[airlineLinkIndex].airlineName;
|
||||||
|
//运营状态处理
|
||||||
|
let ftssLinkCodeArray = item['renderFlight']['FTSS'].split(' / ');
|
||||||
|
let ftssChnArray = [];
|
||||||
|
for (let i = 0; i < ftssLinkCodeArray.length; i++) {
|
||||||
|
ftssChnArray.push(this.flightStatus.find(val => val.sttc === ftssLinkCodeArray[i]).stdc)
|
||||||
|
}
|
||||||
|
item['renderFlight']['FTSS'] = ftssChnArray.join(' / ');
|
||||||
|
|
||||||
|
//航线处理
|
||||||
|
let erutPreCodeArray = item['renderPreFlight']['ERUT'].split(' - ');
|
||||||
|
let erutPreChnArray = []
|
||||||
|
for (let i = 0; i < erutPreCodeArray.length; i++) {
|
||||||
|
let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutPreCodeArray[i]);
|
||||||
|
let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId);
|
||||||
|
erutPreChnArray.push(this.citys[cityIndex].cityNameChn);
|
||||||
|
}
|
||||||
|
item['renderPreFlight']['ERUT'] = erutPreChnArray.join(' - ');
|
||||||
|
//航空公司处理
|
||||||
|
let airlinePreIndex = this.airlines.findIndex(val => val.airlineCode === item['renderPreFlight']['ALCD']);
|
||||||
|
item['renderPreFlight']['ALCD'] = this.airlines[airlinePreIndex].airlineName;
|
||||||
|
//运营状态处理
|
||||||
|
item['renderPreFlight']['FTSS'] = this.flightStatus.find(val => val.sttc === item['renderPreFlight']['FTSS']).stdc
|
||||||
|
|
||||||
|
//航线处理
|
||||||
|
let erutReaCodeArray = item['renderReaFlight']['ERUT'].split(' - ');
|
||||||
|
let erutReaChnArray = []
|
||||||
|
for (let i = 0; i < erutReaCodeArray.length; i++) {
|
||||||
|
let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutReaCodeArray[i]);
|
||||||
|
let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId);
|
||||||
|
erutReaChnArray.push(this.citys[cityIndex].cityNameChn);
|
||||||
|
}
|
||||||
|
item['renderReaFlight']['ERUT'] = erutReaChnArray.join(' - ');
|
||||||
|
//航空公司处理
|
||||||
|
let airlineReaIndex = this.airlines.findIndex(val => val.airlineCode === item['renderReaFlight']['ALCD']);
|
||||||
|
item['renderReaFlight']['ALCD'] = this.airlines[airlineReaIndex].airlineName;
|
||||||
|
//运营状态处理
|
||||||
|
item['renderReaFlight']['FTSS'] = this.flightStatus.find(val => val.sttc === item['renderReaFlight']['FTSS']).stdc
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.doSequence(this.combined_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -272,7 +422,7 @@ export class MainComponent implements OnInit {
|
|||||||
if (this.FLT_POS === 1) {
|
if (this.FLT_POS === 1) {
|
||||||
this.selectChange()
|
this.selectChange()
|
||||||
} else {
|
} else {
|
||||||
this.selectChange()
|
// this.selectChange()
|
||||||
this.inputPosition(this.render_data)
|
this.inputPosition(this.render_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,7 +514,6 @@ export class MainComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.render_data = filter_data;
|
this.render_data = filter_data;
|
||||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||||
// this.inputPosition(this.render_data);
|
|
||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -773,7 +922,7 @@ export class MainComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
public isBoading(flight) {
|
public isBoading(flight) {
|
||||||
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
|
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
|
||||||
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
|
if (flight['reaFlight']['BOTM'] && !(flight['reaFlight']['GTDT']['GCTM'])) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -791,10 +940,10 @@ export class MainComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
public isOverBoading(flight) {
|
public isOverBoading(flight) {
|
||||||
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
|
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
|
||||||
if (!flight['GCTM']) {
|
if (flight['reaFlight']['GTDT'] && flight['reaFlight']['GTDT']['GCTM']) {
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core';
|
|
||||||
import dataFormatter from '../utils/data-formatter'
|
|
||||||
import routeType from '../utils/route-type';
|
|
||||||
import flightType from '../utils/flight-type';
|
|
||||||
import arriDept from '../utils/arri-dept';
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name: 'dataFormatter'
|
|
||||||
})
|
|
||||||
export class DataFormatterPipe implements PipeTransform {
|
|
||||||
|
|
||||||
transform(col_code: string,args:any): any {
|
|
||||||
|
|
||||||
if(args['isLinked']){
|
|
||||||
if(col_code==='MVIN'){
|
|
||||||
return arriDept(args['linkFlight'][col_code]) + ' / ' + arriDept(args[col_code])
|
|
||||||
}else if(col_code==='FLIN'){
|
|
||||||
return routeType(args['linkFlight'][col_code]) + ' / ' + routeType(args[col_code])
|
|
||||||
}else if(col_code==='FLTY'){
|
|
||||||
return flightType(args['linkFlight'][col_code]) + ' / ' + flightType(args[col_code])
|
|
||||||
}else{
|
|
||||||
return this.dateTransform(args['linkFlight'][col_code]) + ' / ' + this.dateTransform(args[col_code])
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(col_code==='MVIN'){
|
|
||||||
return arriDept(args[col_code])
|
|
||||||
}else if(col_code==='FLIN'){
|
|
||||||
return routeType(args[col_code])
|
|
||||||
}else if(col_code==='FLTY'){
|
|
||||||
return flightType(args[col_code])
|
|
||||||
}else{
|
|
||||||
return this.dateTransform(args[col_code])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dateTransform(dataString){
|
|
||||||
const monthToNumber = {
|
|
||||||
JAN: '01',
|
|
||||||
FEB: '02',
|
|
||||||
MAR: '03',
|
|
||||||
APR: '04',
|
|
||||||
MAY: '05',
|
|
||||||
JUN: '06',
|
|
||||||
JUL: '07',
|
|
||||||
AUG: '08',
|
|
||||||
SEP: '09',
|
|
||||||
OCT: '10',
|
|
||||||
NOV: '11',
|
|
||||||
DEC: '12',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!dataString || dataString.length < 11) {
|
|
||||||
return dataString?dataString:'';
|
|
||||||
}
|
|
||||||
if (!dataString.substring(7)) {
|
|
||||||
return dataString?dataString:'';
|
|
||||||
}
|
|
||||||
if(!monthToNumber.hasOwnProperty(dataString.substring(2, 5).toUpperCase())){
|
|
||||||
return dataString?dataString:'';
|
|
||||||
}
|
|
||||||
// console.log(monthToNumber.hasOwnProperty(dataString.substring(2, 5).toUpperCase()))
|
|
||||||
|
|
||||||
|
|
||||||
let year = "20" + dataString.substring(5, 7);
|
|
||||||
let month = monthToNumber[dataString.substring(2, 5).toUpperCase()];
|
|
||||||
let day = dataString.substring(0, 2);
|
|
||||||
let hour = dataString.substring(7, 9);
|
|
||||||
let min = dataString.substring(9, 11);
|
|
||||||
|
|
||||||
return hour + ':' + min
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,10 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { DataFormatterPipe } from './data-formatter.pipe';
|
|
||||||
import { ScreeningFlightPipe } from './screening-flight.pipe';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [],
|
imports: [],
|
||||||
declarations: [
|
declarations: [
|
||||||
DataFormatterPipe,
|
|
||||||
ScreeningFlightPipe
|
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
DataFormatterPipe,
|
|
||||||
ScreeningFlightPipe
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core';
|
|
||||||
|
|
||||||
@Pipe({
|
|
||||||
name:'screeningFlight'
|
|
||||||
})
|
|
||||||
|
|
||||||
export class ScreeningFlightPipe implements PipeTransform{
|
|
||||||
transform(items:Array<any>,args:any){
|
|
||||||
console.log(args)
|
|
||||||
var searchCtrl = ( data: any ) => {
|
|
||||||
var all = false;
|
|
||||||
if ( typeof data === 'object' ) {
|
|
||||||
for ( var z in data ) {
|
|
||||||
if ( all = searchCtrl( data[z] ) ) {
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if ( typeof data === 'number' ) {
|
|
||||||
all = data === args;
|
|
||||||
} else {
|
|
||||||
all = data.toString().match( new RegExp( args, 'i' ) );
|
|
||||||
};
|
|
||||||
};
|
|
||||||
return all;
|
|
||||||
};
|
|
||||||
return items.filter(searchCtrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,20 +21,8 @@ export class HttpClientService {
|
|||||||
*
|
*
|
||||||
* @return any
|
* @return any
|
||||||
*/
|
*/
|
||||||
request(method: string, url: string, options?: {
|
request(method: string, url: string, options?): Observable<any> {
|
||||||
body?: any;
|
return this.commonProcess(this.httpClient.request(method, url, options));
|
||||||
headers?: HttpHeaders | {
|
|
||||||
[header: string]: string | string[];
|
|
||||||
};
|
|
||||||
params?: HttpParams | {
|
|
||||||
[param: string]: string | string[];
|
|
||||||
};
|
|
||||||
observe?: HttpObserve;
|
|
||||||
reportProgress?: boolean;
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
||||||
withCredentials?: boolean;
|
|
||||||
}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.request(method, url, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,15 +32,8 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
delete(url: string, options: {
|
delete(url: string, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.delete(url, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.delete(url, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,25 +41,18 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
get(url: string,params?:object, options?: {
|
get(url: string, params?: object, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} ): Observable<any> {
|
|
||||||
let paramsString = [];
|
let paramsString = [];
|
||||||
url = url + '?'
|
url = url + '?'
|
||||||
let t = Math.random();
|
let t = Math.random();
|
||||||
if (params&¶ms) {
|
if (params && params) {
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
if (params[key] !== '') {
|
if (params[key] !== '') {
|
||||||
paramsString.push([key, params[key]].join('='))
|
paramsString.push([key, params[key]].join('='))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options = {}));
|
return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options = {}));
|
||||||
}else{
|
} else {
|
||||||
return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
|
return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,15 +62,8 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
head(url: string, options: {
|
head(url: string, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.head(url, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.head(url, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,15 +71,8 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
options(url: string, options: {
|
options(url: string, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.options(url, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.options(url, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,32 +80,19 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
patch(url: string, body: any | null, options: {
|
patch(url: string, body, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.patch(url, body, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.patch(url, body, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* post
|
* post
|
||||||
* @param url
|
* @param url
|
||||||
|
* @param body
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
post(url: string, body: any | null, options: {
|
post(url: string, body, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.post(url, body, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.post(url, body, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,15 +100,8 @@ export class HttpClientService {
|
|||||||
* @param url
|
* @param url
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
put(url: string, body: any | null, options: {
|
put(url: string, body, options?): Observable<any> {
|
||||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
return this.commonProcess(this.httpClient.put(url, body, options));
|
||||||
observe?: HttpObserve,
|
|
||||||
params?: HttpParams | { [param: string]: string | string[] },
|
|
||||||
reportProgress?: boolean,
|
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
|
||||||
withCredentials?: boolean,
|
|
||||||
} = {}): Observable<any> {
|
|
||||||
return this.commonProcess(this.httpClient.put(url, body, options = {}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* 登机桥显示转换
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if(flight['ABTM']){
|
||||||
|
if(Array.isArray(flight['ABTM'])&&flight['ABTM'].length>0){
|
||||||
|
let abdg = [];
|
||||||
|
for (let i = 0; i < flight['ABTM'].length; i++) {
|
||||||
|
abdg.push(flight['ABTM'][i]['ABDG']);
|
||||||
|
}
|
||||||
|
let set = new Set(abdg);
|
||||||
|
return Array.from(set).join(',');
|
||||||
|
}else{
|
||||||
|
return flight['ABTM']['ABDG']
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 实际到达/出发时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['ACTT']) {
|
||||||
|
return timeFormatter(flight['ACTT']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 登机桥靠桥时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['ABTM']) {
|
||||||
|
if (Array.isArray(flight['ABTM']) && flight['ABTM'].length > 0) {
|
||||||
|
for (let i = 0; i < flight['ABTM'].length; i++) {
|
||||||
|
if (flight['ABTM'][i]['ABOP'] === 'A') {
|
||||||
|
return timeFormatter(flight['ABTM'][i]['AOTM']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (flight['ABTM']['ABOP'] === 'A') {
|
||||||
|
return timeFormatter(flight['ABTM']['AOTM']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 登机桥撤桥时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['ABTM']) {
|
||||||
|
if (Array.isArray(flight['ABTM']) && flight['ABTM'].length > 0) {
|
||||||
|
for (let i = 0; i < flight['ABTM'].length; i++) {
|
||||||
|
if (flight['ABTM'][i]['ABOP'] === 'D') {
|
||||||
|
return timeFormatter(flight['ABTM'][i]['AOTM']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (flight['ABTM']['ABOP'] === 'D') {
|
||||||
|
return timeFormatter(flight['ABTM']['AOTM']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
export default function (type: string) {
|
|
||||||
if (type === 'D') {
|
|
||||||
return '离港';
|
|
||||||
} else if (type === 'A') {
|
|
||||||
return '到达';
|
|
||||||
}else {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* 转盘号显示转换
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
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 '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* 登机结束时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['BOTM']) {
|
||||||
|
return timeFormatter(flight['BOTM']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* 值机结束时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function(flight){
|
||||||
|
if(flight['CKDT']){
|
||||||
|
if(Array.isArray(flight['CKDT'])&&flight['CKDT'].length>0){
|
||||||
|
return timeFormatter(flight['CKDT'][0]['CCTM']);
|
||||||
|
}else{
|
||||||
|
return timeFormatter(flight['CKDT']['CCTM']);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* 值机柜台显示转换
|
||||||
|
*/
|
||||||
|
export default function(flight){
|
||||||
|
if(flight['CKDT']){
|
||||||
|
if(Array.isArray(flight['CKDT'])&&flight['CKDT'].length>0){
|
||||||
|
let chkc = [];
|
||||||
|
for (let i = 0; i < flight['CKDT'].length; i++) {
|
||||||
|
chkc.push(flight['CKDT'][i]['CHKC']);
|
||||||
|
}
|
||||||
|
let set = new Set(chkc);
|
||||||
|
return Array.from(set).join(',');
|
||||||
|
}else{
|
||||||
|
return flight['CKDT']['CHKC']
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 下轮档时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['CHOT']) {
|
||||||
|
if (Array.isArray(flight['CHOT']) && flight['CHOT'].length > 0) {
|
||||||
|
for (let i = 0; i < flight['CHOT'].length; i++) {
|
||||||
|
if (flight['CHOT'][i]['CHID'] === 'OFF') {
|
||||||
|
return timeFormatter(flight['CHOT'][i]['CHTM']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (flight['CHOT']['CHID'] === 'OFF') {
|
||||||
|
return timeFormatter(flight['CHOT']['CHTM']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 上轮档时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['CHOT']) {
|
||||||
|
if (Array.isArray(flight['CHOT']) && flight['CHOT'].length > 0) {
|
||||||
|
for (let i = 0; i < flight['CHOT'].length; i++) {
|
||||||
|
if (flight['CHOT'][i]['CHID'] === 'ON') {
|
||||||
|
return timeFormatter(flight['CHOT'][i]['CHTM']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (flight['CHOT']['CHID'] === 'ON') {
|
||||||
|
return timeFormatter(flight['CHOT']['CHTM']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* 行李传送带号显示转换
|
||||||
|
*/
|
||||||
|
export default function (flight) {
|
||||||
|
if(flight['CHDT']){
|
||||||
|
if(Array.isArray(flight['CHDT'])&&flight['CHDT'].length>0){
|
||||||
|
let chdt = [];
|
||||||
|
for (let i = 0; i < flight['CHDT'].length; i++) {
|
||||||
|
chdt.push(flight['CHDT'][i]['CHUT']);
|
||||||
|
}
|
||||||
|
let set = new Set(chdt);
|
||||||
|
return Array.from(set).join(',');
|
||||||
|
}else{
|
||||||
|
return flight['CHDT']['CHUT']
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* 值机结束时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
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 '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* 菜单点击事件
|
* 日期时间转换
|
||||||
* @param dataString 需要转换成时间的字符串
|
* @param dataString 需要转换成日期时间的字符串
|
||||||
*/
|
*/
|
||||||
|
export default function (dataString) {
|
||||||
|
|
||||||
|
|
||||||
export default function (dataString,type?) {
|
|
||||||
const monthToNumber = {
|
const monthToNumber = {
|
||||||
JAN: '01',
|
JAN: '01',
|
||||||
FEB: '02',
|
FEB: '02',
|
||||||
@@ -21,13 +18,13 @@ export default function (dataString,type?) {
|
|||||||
DEC: '12',
|
DEC: '12',
|
||||||
}
|
}
|
||||||
if (!dataString || dataString.length < 11) {
|
if (!dataString || dataString.length < 11) {
|
||||||
return dataString?dataString:'';
|
return dataString ? dataString : '';
|
||||||
}
|
}
|
||||||
if (!dataString.substring(7)) {
|
if (!dataString.substring(7)) {
|
||||||
return dataString?dataString:'';
|
return dataString ? dataString : '';
|
||||||
}
|
}
|
||||||
if(!monthToNumber.hasOwnProperty(dataString.substring(2, 5).toUpperCase())){
|
if (!monthToNumber.hasOwnProperty(dataString.substring(2, 5).toUpperCase())) {
|
||||||
return dataString?dataString:'';
|
return dataString ? dataString : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
let year = "20" + dataString.substring(5, 7);
|
let year = "20" + dataString.substring(5, 7);
|
||||||
@@ -35,11 +32,5 @@ export default function (dataString,type?) {
|
|||||||
let day = dataString.substring(0, 2);
|
let day = dataString.substring(0, 2);
|
||||||
let hour = dataString.substring(7, 9);
|
let hour = dataString.substring(7, 9);
|
||||||
let min = dataString.substring(9, 11);
|
let min = dataString.substring(9, 11);
|
||||||
|
|
||||||
if(type){
|
|
||||||
return hour + ':' + min
|
|
||||||
}else{
|
|
||||||
return year + '-' + month + '-' + day + ' ' + hour + ':' + min
|
return year + '-' + month + '-' + day + ' ' + hour + ':' + min
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* 航线显示转换
|
||||||
|
*/
|
||||||
|
export default function(flight){
|
||||||
|
if(flight['ERUT']){
|
||||||
|
if(Array.isArray(flight['ERUT'])&&flight['ERUT'].length>0){
|
||||||
|
let erut = [];
|
||||||
|
for (let i = 0; i < flight['ERUT'].length; i++) {
|
||||||
|
erut.push(flight['ERUT'][i]['APCD']);
|
||||||
|
}
|
||||||
|
return erut.join(' - ');
|
||||||
|
}else{
|
||||||
|
return flight['ERUT']['APCD']
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 预计到达/出发时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['ESTT']) {
|
||||||
|
return timeFormatter(flight['ESTT']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
export default function (type: string) {
|
|
||||||
if (type === 'D') {
|
|
||||||
return '国内';
|
|
||||||
} else if (type === 'I') {
|
|
||||||
return '国际';
|
|
||||||
} else if (type === 'M') {
|
|
||||||
return '混合';
|
|
||||||
} else {
|
|
||||||
return '其他';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* 航线类别显示转换
|
||||||
|
*/
|
||||||
|
const flinChn = {
|
||||||
|
'D': '国内',
|
||||||
|
'I': '国际',
|
||||||
|
'M': '混合',
|
||||||
|
'R': '地区'
|
||||||
|
}
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['FLIN']) {
|
||||||
|
return flinChn[flight['FLIN']];
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* 登机门显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['GTDT']) {
|
||||||
|
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
|
||||||
|
let gate = [];
|
||||||
|
for (let i = 0; i < flight['GTDT'].length; i++) {
|
||||||
|
gate.push(flight['GTDT'][i]['GATE']);
|
||||||
|
}
|
||||||
|
let set = new Set(gate);
|
||||||
|
return Array.from(set).join(',');
|
||||||
|
} else {
|
||||||
|
return flight['GTDT']['GATE'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* 登机结束时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['GTDT']) {
|
||||||
|
if (Array.isArray(flight['GTDT']) && flight['GTDT'].length > 0) {
|
||||||
|
return timeFormatter(flight['GTDT'][0]['GCTM']);
|
||||||
|
} else {
|
||||||
|
return timeFormatter(flight['GTDT']['GCTM']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 最后通知时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['LACL']) {
|
||||||
|
return timeFormatter(flight['LACL']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* 到达/出发显示转换
|
||||||
|
*/
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['MVIN']) {
|
||||||
|
if (flight['MVIN'] === 'A') {
|
||||||
|
return '到达';
|
||||||
|
} else if (flight['MVIN'] === 'D') {
|
||||||
|
return '出发';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 前站起飞时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['PADT']) {
|
||||||
|
return timeFormatter(flight['PADT']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* 计划停机位显示转换
|
||||||
|
*/
|
||||||
|
export default function(flight){
|
||||||
|
if(flight['PSDT']){
|
||||||
|
if(Array.isArray(flight['PSDT'])&&flight['PSDT'].length>0){
|
||||||
|
let chkc = [];
|
||||||
|
for (let i = 0; i < flight['PSDT'].length; i++) {
|
||||||
|
chkc.push(flight['PSDT'][i]['PSST']);
|
||||||
|
}
|
||||||
|
let set = new Set(chkc);
|
||||||
|
return Array.from(set).join(',');
|
||||||
|
}else{
|
||||||
|
return flight['PSDT']['PSST']
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
export default function (type: string) {
|
|
||||||
if (type === 'D') {
|
|
||||||
return '国内';
|
|
||||||
} else if (type === 'I') {
|
|
||||||
return '国际';
|
|
||||||
} else if (type === 'M') {
|
|
||||||
return '混合';
|
|
||||||
} else {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 计划到达/出发时间显示转换
|
||||||
|
*/
|
||||||
|
import timeFormatter from './time-formatter';
|
||||||
|
export default function (flight) {
|
||||||
|
if (flight['SODT']) {
|
||||||
|
return timeFormatter(flight['SODT']);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* 时间转换显示
|
||||||
|
* @param dataString 需要转换成时间的字符串
|
||||||
|
*/
|
||||||
|
export default function (dataString) {
|
||||||
|
const monthToNumber = {
|
||||||
|
JAN: '01',
|
||||||
|
FEB: '02',
|
||||||
|
MAR: '03',
|
||||||
|
APR: '04',
|
||||||
|
MAY: '05',
|
||||||
|
JUN: '06',
|
||||||
|
JUL: '07',
|
||||||
|
AUG: '08',
|
||||||
|
SEP: '09',
|
||||||
|
OCT: '10',
|
||||||
|
NOV: '11',
|
||||||
|
DEC: '12',
|
||||||
|
}
|
||||||
|
if (!dataString || dataString.length < 11) {
|
||||||
|
return dataString ? dataString : '';
|
||||||
|
}
|
||||||
|
if (!dataString.substring(7)) {
|
||||||
|
return dataString ? dataString : '';
|
||||||
|
}
|
||||||
|
if (!monthToNumber.hasOwnProperty(dataString.substring(2, 5).toUpperCase())) {
|
||||||
|
return dataString ? dataString : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let year = "20" + dataString.substring(5, 7);
|
||||||
|
let month = monthToNumber[dataString.substring(2, 5).toUpperCase()];
|
||||||
|
let day = dataString.substring(0, 2);
|
||||||
|
let hour = dataString.substring(7, 9);
|
||||||
|
let min = dataString.substring(9, 11);
|
||||||
|
return hour + ':' + min
|
||||||
|
}
|
||||||
@@ -1,57 +1,162 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"COL_CODE":"ACFT",
|
||||||
|
"COL_CN":"机型",
|
||||||
|
"COL_ORDER":"22"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"GCTM",
|
||||||
|
"COL_CN":"登机结束",
|
||||||
|
"COL_ORDER":"8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"BOTM",
|
||||||
|
"COL_CN":"登机开始",
|
||||||
|
"COL_ORDER":"21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"ABDG",
|
||||||
|
"COL_CN":"登机桥",
|
||||||
|
"COL_ORDER":"14"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"AOTM_A",
|
||||||
|
"COL_CN":"靠桥时间",
|
||||||
|
"COL_ORDER":"26"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"AOTM_D",
|
||||||
|
"COL_CN":"撤桥时间",
|
||||||
|
"COL_ORDER":"19"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"BELT",
|
||||||
|
"COL_CN":"转盘",
|
||||||
|
"COL_ORDER":"30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CHKC",
|
||||||
|
"COL_CN":"值机柜台",
|
||||||
|
"COL_ORDER":"17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CCTM",
|
||||||
|
"COL_CN":"值机结束",
|
||||||
|
"COL_ORDER":"23"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"COTM",
|
||||||
|
"COL_CN":"值机开始",
|
||||||
|
"COL_ORDER":"10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CHTM_ON",
|
||||||
|
"COL_CN":"上轮档时间",
|
||||||
|
"COL_ORDER":"11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CHTM_OFF",
|
||||||
|
"COL_CN":"下轮档时间",
|
||||||
|
"COL_ORDER":"12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"LACL",
|
||||||
|
"COL_CN":"最后通知时间",
|
||||||
|
"COL_ORDER":"13"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CHUT",
|
||||||
|
"COL_CN":"行李传送带",
|
||||||
|
"COL_ORDER":"4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"RENO",
|
||||||
|
"COL_CN":"飞机号",
|
||||||
|
"COL_ORDER":"15"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"ALCD",
|
||||||
|
"COL_CN":"航空公司",
|
||||||
|
"COL_ORDER":"16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"ACTT",
|
||||||
|
"COL_CN":"实际到达/出发",
|
||||||
|
"COL_ORDER":"8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"PSST",
|
||||||
|
"COL_CN":"计划机位",
|
||||||
|
"COL_ORDER":"18"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"ESTT",
|
||||||
|
"COL_CN":"预计到达/出发",
|
||||||
|
"COL_ORDER":"6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"MVIN",
|
||||||
|
"COL_CN":"到达/出发",
|
||||||
|
"COL_ORDER":"20"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"ERUT",
|
||||||
|
"COL_CN":"航线",
|
||||||
|
"COL_ORDER":"3"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"FLNO",
|
"COL_CODE":"FLNO",
|
||||||
"COL_CN":"航班号",
|
"COL_CN":"航班号",
|
||||||
"COL_ORDER":"1"
|
"COL_ORDER":"1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"ALCD",
|
"COL_CODE":"FTSS",
|
||||||
"COL_CN":"航空公司",
|
"COL_CN":"运营状态",
|
||||||
"COL_ORDER":"8"
|
"COL_ORDER":"9"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"FLIN",
|
"COL_CODE":"FLIN",
|
||||||
"COL_CN":"航线类别",
|
"COL_CN":"航线类别",
|
||||||
"COL_ORDER":"4"
|
"COL_ORDER":"24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"FLTY",
|
"COL_CODE":"IMPA",
|
||||||
"COL_CN":"航班类别",
|
"COL_CN":"重要提示",
|
||||||
"COL_ORDER":"5"
|
"COL_ORDER":"25"
|
||||||
},
|
|
||||||
{
|
|
||||||
"COL_CODE":"MVIN",
|
|
||||||
"COL_CN":"航向指示",
|
|
||||||
"COL_ORDER":"9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"COL_CODE":"TRML",
|
|
||||||
"COL_CN":"候机楼",
|
|
||||||
"COL_ORDER":"7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"COL_CODE":"RENO",
|
|
||||||
"COL_CN":"飞机号",
|
|
||||||
"COL_ORDER":"3"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"SODT",
|
"COL_CODE":"SODT",
|
||||||
"COL_CN":"计划到达/出发",
|
"COL_CN":"计划到达/出发",
|
||||||
"COL_ORDER":"13"
|
"COL_ORDER":"5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"ESTT",
|
"COL_CODE":"TRML",
|
||||||
"COL_CN":"预计到达/出发",
|
"COL_CN":"航站楼",
|
||||||
"COL_ORDER":"14"
|
"COL_ORDER":"27"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"ACTT",
|
"COL_CODE":"FLTY",
|
||||||
"COL_CN":"实际到达/出发",
|
"COL_CN":"航班类别",
|
||||||
"COL_ORDER":"15"
|
"COL_ORDER":"28"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"GATE",
|
||||||
|
"COL_CN":"登机门",
|
||||||
|
"COL_ORDER":"29"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"PADT",
|
||||||
|
"COL_CN":"前站起飞时间",
|
||||||
|
"COL_ORDER":"7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"COL_CODE":"CSFT",
|
||||||
|
"COL_CN":"共享航班号",
|
||||||
|
"COL_ORDER":"31"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"COL_CODE":"STND",
|
"COL_CODE":"STND",
|
||||||
"COL_CN":"停机位",
|
"COL_CN":"当前机位",
|
||||||
"COL_ORDER":"16"
|
"COL_ORDER":"32"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user