Merge branch 'develop-3'

This commit is contained in:
zhouyuejun
2018-11-21 18:59:17 +08:00
47 changed files with 3158 additions and 7278 deletions
@@ -3,7 +3,7 @@
<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" [(ngModel)]="SEL_COL" name="" id=""> <select class="mr-4 form-control" [(ngModel)]="SEL_COL" name="" id="">
<option value="">选择列名</option> <option value="">选择列名</option>
</select> </select>
<label class="radio-inline custom-radio nowrap mr-4"> <label class="radio-inline custom-radio nowrap mr-4">
@@ -14,7 +14,7 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">打印</button> <!-- <button type="button" class="btn btn-info mr-3">打印</button>
@@ -26,39 +26,57 @@
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">航空公司&nbsp;&nbsp;</label> <label for="aircrafttypegroupId">机型组&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.HK" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.aircrafttypegroupId" (ngModelChange)="selectChange()" id="jgroup">
<option value=""></option> <option value=""></option>
<option value="GH">海南航空公司</option> <option *ngFor="let item of aircraftTypes" [value]="item.aircrafttypegroupId">{{item.aircrafttypegroupId}}</option>
<option value="CH">国外航空公司</option> <!-- <option value="E">E-类飞机机型</option>
</select> <option value="T">T-类飞机机型</option>
<option value="G">G-类飞机机型</option> -->
</select>
</div>
</div> </div>
<div class="input-container mr-4">
<label for="">机型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.JX" (ngModelChange)="inputFliter()">
<option value=""></option>
<option value="A">A306</option>
<option value="B">B252</option>
<option value="C">C256</option>
</select>
</div>
</div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of aircrafttype_lists">{{airline_col.COL_CN}}</th> <th>机型代码</th>
<th>机型名称</th>
<th>飞机长度</th>
<th>翼展</th>
<th>机身高度</th>
<th>最大乘客数</th>
<th>最大货物重量</th>
<th>最大起飞重量</th>
<th>最大廊桥数</th>
<th>机型组</th>
<th>CAA码</th>
<th>IATA码</th>
<th>ICAO码</th>
<!-- <th *ngFor="let airline_col of aircrafttype_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let aircraftType of render_data;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of aircrafttype_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{aircraftType.aircraftTypeCode}}</td>
<td>{{aircraftType.aircraftTypeName}}</td>
<td>{{aircraftType.aircraftLength}}</td>
<td>{{aircraftType.aircraftWidth}}</td>
<td>{{aircraftType.aircraftHeight}}</td>
<td>{{aircraftType.maxPassengers}}</td>
<td>{{aircraftType.maxFreightWeight}}</td>
<td>{{aircraftType.maxTakeoffWeight}}</td>
<td>{{aircraftType.maxAirbridges}}</td>
<td>{{aircraftType.aircrafttypegroupId}}</td>
<td>{{aircraftType.aircraftTypeCodeCaa}}</td>
<td>{{aircraftType.aircraftTypeCodeIata}}</td>
<td>{{aircraftType.aircraftTypeCodeIcao}}</td>
<!-- <td *ngFor="let airline_col of aircrafttype_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,567 +1,195 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-aircraft-type', selector: 'app-aircraft-type',
templateUrl: './aircraft-type.component.html', templateUrl: './aircraft-type.component.html',
styleUrls: ['./aircraft-type.component.scss'] styleUrls: ['./aircraft-type.component.scss']
}) })
export class AircraftTypeComponent implements OnInit { export class AircraftTypeComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public aircrafttype_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
//下拉框
public filterItems = { public filterItems = {
HK: '', //航空公司 aircrafttypegroupId:'',
JX: '', //机型
} }
public formatter = { aircraftTypes : Array<any>;
'HK': { public row_state: any = { renderFlight: {} };
'GH': '海南航空公司', public render_data: Array<object> = []; //显示数据,即需要显示的数据
'CH': '国外航空公司' public return_data: Array<object> = []; //下拉框显示数据
}, ngOnInit() {
'JX': { this.aircraftTypes = this.basicDataService.aircraft_type;
'A': 'A306', this.basicDataService.aircraft_type_subject.subscribe(
'B': 'B252', data=>{
"C": 'C256' this.aircraftTypes = data;
}, this.render_data = this.aircraftTypes;
'SODT': dateFormatter, }
'ESTT': dateFormatter, )
'ACTT': dateFormatter /**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
selectRow(i) { ///输入框回车事件
this.row_state = i; inputEnter() {
this.changeDetectorRef.detectChanges(); if (this.FLT_POS === 1) {
} this.inputFilter(this.aircraftTypes)
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.inputFilter(this.aircraftTypes)
// this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ this.return_data = this.aircraftTypes.filter(item=>{
this.httpCilent.get('/assets/mock-data/aircraft-type-code.json').subscribe( let is_satis = true;
data => { for (const key in this.filterItems) {
data.sort(function (a, b) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
return (a['COL_ORDER'] - b['COL_ORDER']); if (item[key] === this.filterItems[key]) {
}) is_satis = true;
this.aircrafttype_lists = data; continue;
} } else {
) is_satis = false;
/* 获取机型信息 */ break;
this.httpCilent.get('/assets/mock-data/aircraft-type-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.aircrafttype_lists.length; i++) {
let key = this.aircrafttype_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.aircrafttype_lists.length; i++) {
let key = this.aircrafttype_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
} }
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
}
)
}
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
/* Enter键触发事件过滤条件数据 */
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -3,7 +3,7 @@
<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" [(ngModel)]="SEL_COL" name="" id=""> <select class="mr-4 form-control" [(ngModel)]="SEL_COL" name="" id="">
<option value="">选择列名</option> <option value="">选择列名</option>
</select> </select>
<label class="radio-inline custom-radio nowrap mr-4"> <label class="radio-inline custom-radio nowrap mr-4">
@@ -14,43 +14,66 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">打印</button> <!-- <button type="button" class="btn btn-info mr-3">打印</button>
<button type="button" class="btn btn-info mr-3">飞机登记</button> <button type="button" class="btn btn-info mr-3">飞机登记</button>
<button type="button" class="btn btn-info mr-3">定制查询</button> --> <button type="button" class="btn btn-info mr-3">定制查询</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">机型组&nbsp;&nbsp;</label> <label for="">航空公司&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZZU" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="aircrafts" (ngModelChange)="selectChange()" id="airlineCompany">
<option value=""></option> <option value=""></option>
<option value="E">E-类飞机机型</option> <option value="GH">海南航空公司</option>
<option value="T">T-类飞机机型</option> <option value="CH">国外航空公司</option>
<option value="G">G-类飞机机型</option> </select>
</select>
</div>
</div> </div>
<div class="input-container mr-4">
<label for="">机型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="aircrafts" (ngModelChange)="selectChange()" id="jx">
<option value=""></option>
<option value="A">A306</option>
<option value="B">B252</option>
<option value="C">C256</option>
</select>
</div>
</div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of aircraft_lists">{{airline_col.COL_CN}}</th> <th>飞机号</th>
<th>最大乘客数</th>
<th>最大货物重量</th>
<th>最大起飞重量</th>
<th>最大廊桥数</th>
<th>机主航空公司</th>
<th>航空公司</th>
<th>机型</th>
<!-- <th *ngFor="let airline_col of aircraft_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let aircraft of aircrafts;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of aircraft_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{aircraft.aircraftNumber}}</td>
<td>{{aircraft.maxPassengers}}</td>
<td>{{aircraft.maxFreightWeight}}</td>
<td>{{aircraft.maxTakeoffWeight}}</td>
<td>{{aircraft.maxAirbridges}}</td>
<td>{{aircraft.aircraftOwnerCode}}</td>
<td>{{aircraft.airlineCode}}</td>
<td>{{aircraft.aircraftTypeCode}}</td>
<!-- <td *ngFor="let airline_col of aircraft_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,563 +1,264 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-aircraft', selector: 'app-aircraft',
templateUrl: './aircraft.component.html', templateUrl: './aircraft.component.html',
styleUrls: ['./aircraft.component.scss'] styleUrls: ['./aircraft.component.scss']
}) })
export class AircraftComponent implements OnInit { export class AircraftComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public aircraft_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { aircrafts : Array<any>;
ZZU: '', //机型组 public row_state: any = { renderFlight: {} };
} public render_data: Array<object> = []; //显示数据,即需要显示的数据
public formatter = {
'ZZU': {
'E': 'E-类飞机机型',
'T': 'T-类飞机机型',
'G': 'G-类飞机机型'
},
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.aircrafts = this.basicDataService.aircraft;
/* 获取显示列 */ this.basicDataService.aircraft_subject.subscribe(
this.httpCilent.get('/assets/mock-data/aircraft-code.json').subscribe( data=>{
data => { this.aircrafts = data;
data.sort(function (a, b) { this.render_data = this.aircrafts;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.aircraft_lists = data;
}
)
/* 获取飞机信息 */
this.httpCilent.get('/assets/mock-data/aircraft-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.aircraft_lists.length; i++) {
let key = this.aircraft_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.aircraft_lists.length; i++) {
let key = this.aircraft_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public sequence(flight) { //刷新
let dateTag: number = 10; clearFiter(){
let dateToCompare = new Date().getTime(); $("#inputerInfo").val(""); //清空过滤或查找定位文本框
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { $("#airlineCompany").val(""); //清空航空公司
if (this.isLinked(flight)) { $("#jx").val(""); //清空机型
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { this.ngOnInit();
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); }
dateTag = this.TOP_1; //输入框回车事件
} inputEnter() {
else { if (this.FLT_POS === 1) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); this.selectChange()
dateTag = this.TOP_2; } else {
} this.selectChange()
} this.inputPosition(this.render_data)
else { }
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
} }
inputFliter() { //下拉框选择筛选
let filterItems = this.filterItems; selectChange() {
let combined_data = this.combined_data;
let filter_data = []; let filter_data = [];
let filteraircrafts = this.render_data;
let sel_col = this.SEL_COL; this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
if (this.FLT_POS === 1) { //过滤 })
//手动输入框筛选 if (this.FLT_POS === 1) {
if(sel_col){ this.inputFilter(filter_data);
combined_data.forEach(item=>{ } else {
if(item['renderFlight'][sel_col]){ this.aircrafts = filter_data;
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} };
filter_data.push(Object.assign({}, item)) }
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
} }
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
this.render_data = filter_data; }
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
} else { //定位 }
}
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
this.changeDetectorRef.detectChanges(); //输入框筛选
} inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
/** let sel_col = this.SEL_COL;
* 获取航班实际时间 filterData = filterData.filter(item => {
* @param flight if (item[sel_col]) {
* @return if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
*/ return true;
public getActualDatetime(flight) { }
return flight['ACTT']; } else {
} if (this.SEARCH) {
return false;
/** } else {
* 获取航班预计时间 return true;
* @param flight }
* @return }
*/ })
public getEstimatedDatetime(flight) {
return flight['ESTT'] } else {
} filterData = filterData.filter(item => {
let is_satis = false;
/** for (const key in item) {
* 获取航班计划时间 if (item.hasOwnProperty(key)) {
* @param flight if (item[key]) {
* @return if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
*/ is_satis = true;
public getScheduledDatetime(flight) { break;
return flight['SODT'] } else {
} is_satis = false;
continue;
}
/** } else {
* 判断航班是否是链接航班 if (this.SEARCH) {
* @param flight is_satis = false;
* @return continue;
*/ } else {
public isLinked(flight) { is_satis = true;
if (flight['preFlight'] && flight['reaFlight']) { break;
return true }
} else { }
return false } else {
} continue;
} }
}
/** return is_satis;
* 判断航班是否是纯离港航班 })
* @param flight }
* @return }
*/ this.aircrafts = filterData;
public isDeptFlight(flight) { this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} };
if (!flight['preFlight'] && flight['reaFlight']) { }
return true
} else { positionArray: Array<any> = [];
return false positionArrayIndex: number = 0;
} //输入框定位
inputPosition(filterData) {
} let transArray = []
if (this.SEL_COL) {
/** let sel_col = this.SEL_COL;
* 判断航班是否是纯到港航班 filterData.forEach(element => {
* @param flight if (element[sel_col]) {
* @return if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
*/ transArray.push(element)
public isArriFlight(flight) { }
if (flight['preFlight'] && !flight['reaFlight']) { } else {
return true; if (!this.SEARCH) {
} else { transArray.push(element)
return false; }
} }
} });
} else {
/** filterData.forEach(element => {
* 判断航班是否已经前站起飞 for (const key in element) {
* @param flight if (element.hasOwnProperty(key)) {
* @return if (element[key]) {
*/ if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
public isFlying(flight) { transArray.push(element)
if (this.isArriFlight(flight) || this.isLinked(flight)) { break;
if (flight['preFlight']['PADT']) { } else {
return true; continue;
} else { }
return false; } else {
} if (this.SEARCH) {
} else { continue;
return false; } else {
} transArray.push(element)
} break;
}
}
/**
* 判断航班是否取消 } else {
* @param flight continue;
* @return }
*/ }
public isCancled(flight) { });
if (this.isArriFlight(flight)) { }
if (flight['preFlight']['CNCL']) {
return true; if (transArray.length > 0) {
} else { if (transArray.toString() == this.positionArray.toString()) {
return false; this.positionArrayIndex++;
} if (this.positionArrayIndex === this.positionArray.length) {
} else if (this.isDeptFlight(flight)) { this.positionArrayIndex = 0;
if (flight['reaFlight']['CNCL']) { }
return true; this.row_state = this.positionArray[this.positionArrayIndex];
} else { } else {
return false; this.positionArray = transArray;
} this.positionArrayIndex = 0;
} else { this.row_state = this.positionArray[this.positionArrayIndex];
return false; }
} } else {
} alert('没有搜索到相关数据');
}
/** }
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,7 +14,7 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="gl">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">打印</button> <!-- <button type="button" class="btn btn-info mr-3">打印</button>
@@ -28,39 +28,53 @@
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">航空集团:&nbsp;&nbsp;</label> <label for="airlineName">航空集团:&nbsp;&nbsp;</label>
<select class="form-control"> <select class="form-control" [(ngModel)]="filterItems.airlineName" (ngModelChange)="selectChange()" id="handkong">
<option value=""></option> <option value=""></option>
<option value="GH">国内航空集团</option> <option *ngFor="let item of airlines" [value]="item.airlineName" >{{item.airlineName}}</option>
<option value="CH">国外航空集团</option>
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">航班代理:&nbsp;&nbsp;</label> <label for="briefNameChn">航班代理:&nbsp;&nbsp;</label>
<select class="form-control"> <select class="form-control" (ngModelChange)="selectChange()" [(ngModel)]="filterItems.briefNameChn" id="hb">
<option value=""></option> <option value=""></option>
<option value="0">广州</option> <option *ngFor="let items of airlines" [value]="items.briefNameChn">{{items.briefNameChn}}</option>
<option value="1">上海</option>
<option value="2">北京</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of airline_lists">{{airline_col.COL_CN}}</th> <th>航空公司代码</th>
<th>航空公司中文名</th>
<th>中文简称</th>
<th>航空公司英文名</th>
<th>英文简称</th>
<th>IATA码</th>
<th>CAA码</th>
<th>ICAO码</th>
<th>上级母公司</th>
<!-- <th *ngFor="let airline_col of airline_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let airline of render_data;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of airline_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{airline.airlineCode}}</td>
<td>{{airline.airlineName}}</td>
<td>{{airline.briefNameChn}}</td>
<td>{{airline.airlineNameEng}}</td>
<td>{{airline.briefNameEng}}</td>
<td>{{airline.airlineCodeIata}}</td>
<td>{{airline.airlineCodeCaa}}</td>
<td>{{airline.airlineCodeIcao}}</td>
<td>{{airline.parentAirlineId}}</td>
<!-- <td *ngFor="let airline_col of airline_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,558 +1,195 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-airline', selector: 'app-airline',
templateUrl: './airline.component.html', templateUrl: './airline.component.html',
styleUrls: ['./airline.component.scss'] styleUrls: ['./airline.component.scss']
}) })
export class AirlineComponent implements OnInit { export class AirlineComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划 // 搜索条件
SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据 airlines:Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
//下拉框
public filterItems = {
airlineName:'',
briefNameChn:'',
}
ngOnInit() {
this.airlines = this.basicDataService.airline;
this.basicDataService.airline_subject.subscribe(
data=>{
this.airlines = data;
this.render_data = this.airlines;
}
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
}
public render_data: Array<object> = []; //显示数据,即需要显示的数据 //输入框回车事件
inputEnter() {
public airline_lists: Array<object>; //列数据 if (this.FLT_POS === 1) {
this.inputFilter(this.airlines)
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件
SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
public filterItems = {
}
public formatter = {
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.inputFilter(this.airlines)
// this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ this.return_data = this.airlines.filter(item=>{
this.httpCilent.get('/assets/mock-data/airline-code.json').subscribe( let is_satis = true;
data => { for (const key in this.filterItems) {debugger
data.sort(function (a, b) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
return (a['COL_ORDER'] - b['COL_ORDER']); if (item[key] === this.filterItems[key]) {
}) is_satis = true;
this.airline_lists = data; continue;
} } else {
) is_satis = false;
/* 获取航空公司信息 */ break;
this.httpCilent.get('/assets/mock-data/airline-code-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.airline_lists.length; i++) {
let key = this.airline_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.airline_lists.length; i++) {
let key = this.airline_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
} }
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
}
)
}
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
/* Enter键触发事件过滤条件数据 */
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,7 +14,7 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">打印</button> <!-- <button type="button" class="btn btn-info mr-3">打印</button>
@@ -27,39 +27,60 @@
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">机场集团:&nbsp;&nbsp;</label> <label for="airportGroupId">机场集团:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.JT" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.airportGroupId" (ngModelChange)="selectChange()" id="jt">
<option value=""></option> <option value=""></option>
<option value="GH">国内机场</option> <!-- <option value="GH">国内机场</option>
<option value="CH">国际机场</option> <option value="CH">国际机场</option> -->
<option *ngFor="let item of airports" [value]="item.airportGroupId">{{item.airportGroupId}}</option>
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">城市:&nbsp;&nbsp;</label> <label for="cityId">城市:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.CS" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.cityId" (ngModelChange)="selectChange()" id="city">
<option value=""></option> <option value=""></option>
<option value="GZ">广州</option> <!-- <option value="GZ">广州</option>
<option value="SH">上海</option> <option value="SH">上海</option>
<option value="BJ">北京</option> <option value="BJ">北京</option> -->
<option *ngFor="let item of airports" [value]="item.cityId">{{item.cityId}}</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of airport_lists">{{airline_col.COL_CN}}</th> <th>机场代码</th>
<th>机场中文名</th>
<th>中文简称</th>
<th>机场英文名</th>
<th>英文简称</th>
<th>IATA码</th>
<th>CAA码</th>
<th>ICAO码</th>
<th>机场集团</th>
<th>所在城市</th>
<!-- <th *ngFor="let airline_col of airport_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let airport of render_data;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of airport_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{airport.airportCode}}</td>
<td>{{airport.airportNameChn}}</td>
<td>{{airport.briefNameChn}}</td>
<td>{{airport.airportNameEng}}</td>
<td>{{airport.briefNameEng}}</td>
<td>{{airport.airportCodeIata}}</td>
<td>{{airport.airportCodeCaa}}</td>
<td>{{airport.airportCodeIcao}}</td>
<td>{{airport.airportGroupId}}</td>
<td>{{airport.cityId}}</td>
<!-- <td *ngFor="let airline_col of airport_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
import { BasicDataService } from '../../basic-data-service'
@Component({ @Component({
selector: 'app-airport', selector: 'app-airport',
templateUrl: './airport.component.html', templateUrl: './airport.component.html',
@@ -11,556 +12,185 @@ export class AirportComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public airport_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
//下拉框
public filterItems = { public filterItems = {
JT: '', //机场集团 airportGroupId:'',
CS: '', //所在城市 cityId:'',
} }
public formatter = { airports : Array<any>;
'JT': { public row_state: any = { renderFlight: {} };
'GH': '国内区域', public render_data: Array<object> = []; //显示数据,即需要显示的数据
'CH': '国际区域' public return_data: Array<object> = []; //下拉框显示数据
},
'CS': {
'GZ': '广州',
'SH': '上海',
"BJ": '北京'
},
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.airports = this.basicDataService.airport;
/* 获取显示列 */ this.basicDataService.airport_subject.subscribe(
this.httpCilent.get('/assets/mock-data/airport-code.json').subscribe( data=>{
data => { this.airports = data;
data.sort(function (a, b) { this.render_data = this.airports;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.airport_lists = data;
}
)
/* 获取机场信息 */
this.httpCilent.get('/assets/mock-data/airport-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.airport_lists.length; i++) {
let key = this.airport_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.airport_lists.length; i++) {
let key = this.airport_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.inputFilter(this.airports)
} else {
this.inputFilter(this.airports)
// this.inputPosition(this.render_data)
}
} }
public sequence(flight) { //下拉框选择筛选
let dateTag: number = 10; selectChange() {
let dateToCompare = new Date().getTime(); this.return_data = this.airports.filter(item=>{
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { let is_satis = true;
if (this.isLinked(flight)) { for (const key in this.filterItems) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); if (item[key] === this.filterItems[key]) {
dateTag = this.TOP_1; is_satis = true;
} continue;
else { } else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); is_satis = false;
dateTag = this.TOP_2; break;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
/* Enter键触发事件过滤条件数据 */
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
} }
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,50 +14,59 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">行李转盘编辑</button> <!-- <button type="button" class="btn btn-info mr-3">行李转盘编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">所属航站楼区域:&nbsp;&nbsp;</label> <label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.HZ" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option> <option value=""></option>
<option value="GH">国内区域</option> <option *ngFor="let item of carousels" [value]="item.terminalAreaCode" >{{item.terminalAreaCode}}</option>
<!-- <option value="GH">国内区域</option>
<option value="CH">国际区域</option> <option value="CH">国际区域</option>
<option value="QT">其他区域</option> <option value="QT">其他区域</option> -->
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">资源状态:&nbsp;&nbsp;</label> <label for="carouselStatus">资源状态:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZY" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.carouselStatus" (ngModelChange)="selectChange()" id="zy">
<option value=""></option> <option value=""></option>
<option value="K">可用</option> <option *ngFor="let item of carousels" [value]="item.carouselStatus" >{{item.carouselStatus}}</option>
<option value="R">不可用</option> <!-- <option value="K">可用</option>
<option value="R">不可用</option> -->
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of carousel_lists">{{airline_col.COL_CN}}</th> <th>行李转盘代码</th>
<th>行李转盘名称</th>
<th>航站楼区域</th>
<th>资源状态</th>
<!-- <th *ngFor="let airline_col of carousel_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let carousel of render_data;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of carousel_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{carousel.carouselCode}}</td>
<td>{{carousel.carouselName}}</td>
<td>{{carousel.terminalAreaCode}}</td>
<td>{{carousel.carouselStatus}}</td>
<!-- <td *ngFor="let airline_col of carousel_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-carousel', selector: 'app-carousel',
templateUrl: './carousel.component.html', templateUrl: './carousel.component.html',
@@ -11,558 +13,183 @@ export class CarouselComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public carousel_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
//下拉框
public filterItems = { public filterItems = {
HZ: '', //所属航站楼区域 terminalAreaCode:'',
ZY: '', //资源状态 carouselStatus:'',
}
carousels:Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
ngOnInit() {
this.carousels = this.basicDataService.carousel;
this.basicDataService.carousel_subject.subscribe(
data=>{
this.carousels = data;
this.render_data = this.carousels;
}
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public formatter = { //输入框回车事件
'HZ': { inputEnter() {
'GH': '国内区域', if (this.FLT_POS === 1) {
'CH': '国际区域', this.inputFilter(this.carousels)
"QT": '其他区域'
},
'ZY': {
'K': '可用',
'R': '不可用',
"T": '其他'
},
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.inputFilter(this.carousels)
// this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ this.return_data = this.carousels.filter(item=>{
this.httpCilent.get('/assets/mock-data/carousel-code.json').subscribe( let is_satis = true;
data => { for (const key in this.filterItems) {
data.sort(function (a, b) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
return (a['COL_ORDER'] - b['COL_ORDER']); if (item[key] === this.filterItems[key]) {
}) is_satis = true;
this.carousel_lists = data; continue;
} } else {
) is_satis = false;
/* 获取行李转盘信息 */ break;
this.httpCilent.get('/assets/mock-data/carousel-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.carousel_lists.length; i++) {
let key = this.carousel_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];
}
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.carousel_lists.length; i++) {
let key = this.carousel_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
} }
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
}
)
}
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,19 +14,19 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">值机柜台编辑</button> <!-- <button type="button" class="btn btn-info mr-3">值机柜台编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">所属航站楼区域:&nbsp;&nbsp;</label> <label for="">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.HZ" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="qy">
<option value=""></option> <option value=""></option>
<option value="GH">国内区域</option> <option value="GH">国内区域</option>
<option value="CH">国外区域</option> <option value="CH">国外区域</option>
@@ -35,7 +35,7 @@
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">值机岛:&nbsp;&nbsp;</label> <label for="">值机岛:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.JJ" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="zjd">
<option value=""></option> <option value=""></option>
<option value="A">A岛</option> <option value="A">A岛</option>
<option value="B">B岛</option> <option value="B">B岛</option>
@@ -44,7 +44,7 @@
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">行李传送带:&nbsp;&nbsp;</label> <label for="">行李传送带:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZY" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="xl">
<option value=""></option> <option value=""></option>
<option value="X">X行李</option> <option value="X">X行李</option>
<option value="Z">Z行李</option> <option value="Z">Z行李</option>
@@ -55,19 +55,28 @@
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of checkindesk_lists">{{airline_col.COL_CN}}</th> <th>值机柜台代码</th>
<th>值机柜台名称</th>
<th>值机岛</th>
<th>行李传送带</th>
<th>航站楼区域</th>
<!-- <th *ngFor="let airline_col of checkindesk_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let checkinDesk of checkinDesks;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of checkindesk_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{checkinDesk.checkindeskCode}}</td>
<td>{{checkinDesk.checkindeskName}}</td>
<td>{{checkinDesk.checkinGroupCode}}</td>
<td>{{checkinDesk.chutCode}}</td>
<td>{{checkinDesk.terminalAreaCode}}</td>
<!-- <td *ngFor="let airline_col of checkindesk_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-checkin-desk', selector: 'app-checkin-desk',
templateUrl: './checkin-desk.component.html', templateUrl: './checkin-desk.component.html',
@@ -11,564 +12,254 @@ export class CheckinDeskComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public checkindesk_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { checkinDesks : Array<any>;
HZ: '', //所属航站楼区域 public row_state: any = { renderFlight: {} };
JJ: '', //值机岛 public render_data: Array<object> = []; //显示数据,即需要显示的数据
ZY: '', //行李传送带
}
public formatter = {
'HZ': {
'GH': '国内区域',
'CH': '国际区域',
"QH": '其他区域'
},
'JJ': {
'A': 'A岛',
'B': 'B岛',
"C": 'C岛'
},
'ZY': {
'X': 'X行李',
'Z': 'Z行李',
"Y": 'Y行李'
},
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.checkinDesks = this.basicDataService.checkin_desk;
/* 获取显示列 */ this.basicDataService.checkin_desk_subject.subscribe(
this.httpCilent.get('/assets/mock-data/checkindesk-code.json').subscribe( data=>{
data => { this.checkinDesks = data;
data.sort(function (a, b) { this.render_data = this.checkinDesks;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.checkindesk_lists = data;
}
)
/* 获取值机柜台信息 */
this.httpCilent.get('/assets/mock-data/checkindesk-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.checkindesk_lists.length; i++) {
let key = this.checkindesk_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.checkindesk_lists.length; i++) {
let key = this.checkindesk_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public sequence(flight) { //刷新
let dateTag: number = 10; clearFiter(){
let dateToCompare = new Date().getTime(); $("#inputerInfo").val(""); //清空过滤或查找定位文本框
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { $("#qy").val(""); //清空所属航站楼区域
if (this.isLinked(flight)) { $("#zjd").val(""); //清空值机岛
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { $("#xl").val(""); //清空行李传送带
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); this.ngOnInit();
dateTag = this.TOP_1; }
} //输入框回车事件
else { inputEnter() {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); if (this.FLT_POS === 1) {
dateTag = this.TOP_2; this.selectChange()
} } else {
} this.selectChange()
else { this.inputPosition(this.render_data)
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); }
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
} }
inputFliter() { //下拉框选择筛选
let filterItems = this.filterItems; selectChange() {
let combined_data = this.combined_data;
let filter_data = []; let filter_data = [];
let filtercheckinDesks = this.render_data;
let sel_col = this.SEL_COL; this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
if (this.FLT_POS === 1) { //过滤 })
//手动输入框筛选 if (this.FLT_POS === 1) {
if(sel_col){ this.inputFilter(filter_data);
combined_data.forEach(item=>{ } else {
if(item['renderFlight'][sel_col]){ this.checkinDesks = filter_data;
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
filter_data.push(Object.assign({}, item)) }
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
} }
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
this.render_data = filter_data; }
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
} else { //定位 }
}
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
this.changeDetectorRef.detectChanges(); //输入框筛选
} inputFilter(filterData) {
if (this.SEARCH) {
/** if (this.SEL_COL) {
* 获取航班实际时间 let sel_col = this.SEL_COL;
* @param flight filterData = filterData.filter(item => {
* @return if (item[sel_col]) {
*/ if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getActualDatetime(flight) { return true;
return flight['ACTT']; }
} } else {
if (this.SEARCH) {
/** return false;
* 获取航班预计时间 } else {
* @param flight return true;
* @return }
*/ }
public getEstimatedDatetime(flight) { })
return flight['ESTT']
} } else {
filterData = filterData.filter(item => {
/** let is_satis = false;
* 获取航班计划时间 for (const key in item) {
* @param flight if (item.hasOwnProperty(key)) {
* @return if (item[key]) {
*/ if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getScheduledDatetime(flight) { is_satis = true;
return flight['SODT'] break;
} } else {
is_satis = false;
continue;
/** }
* 判断航班是否是链接航班 } else {
* @param flight if (this.SEARCH) {
* @return is_satis = false;
*/ continue;
public isLinked(flight) { } else {
if (flight['preFlight'] && flight['reaFlight']) { is_satis = true;
return true break;
} else { }
return false }
} } else {
} continue;
}
/** }
* 判断航班是否是纯离港航班 return is_satis;
* @param flight })
* @return }
*/ }
public isDeptFlight(flight) { this.checkinDesks = filterData;
if (!flight['preFlight'] && flight['reaFlight']) { this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
return true }
} else {
return false positionArray: Array<any> = [];
} positionArrayIndex: number = 0;
//输入框定位
} inputPosition(filterData) {
let transArray = []
/** if (this.SEL_COL) {
* 判断航班是否是纯到港航班 let sel_col = this.SEL_COL;
* @param flight filterData.forEach(element => {
* @return if (element[sel_col]) {
*/ if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public isArriFlight(flight) { transArray.push(element)
if (flight['preFlight'] && !flight['reaFlight']) { }
return true; } else {
} else { if (!this.SEARCH) {
return false; transArray.push(element)
} }
} }
});
/** } else {
* 判断航班是否已经前站起飞 filterData.forEach(element => {
* @param flight for (const key in element) {
* @return if (element.hasOwnProperty(key)) {
*/ if (element[key]) {
public isFlying(flight) { if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
if (this.isArriFlight(flight) || this.isLinked(flight)) { transArray.push(element)
if (flight['preFlight']['PADT']) { break;
return true; } else {
} else { continue;
return false; }
} } else {
} else { if (this.SEARCH) {
return false; continue;
} } else {
} transArray.push(element)
break;
}
/** }
* 判断航班是否取消
* @param flight } else {
* @return continue;
*/ }
public isCancled(flight) { }
if (this.isArriFlight(flight)) { });
if (flight['preFlight']['CNCL']) { }
return true;
} else { if (transArray.length > 0) {
return false; if (transArray.toString() == this.positionArray.toString()) {
} this.positionArrayIndex++;
} else if (this.isDeptFlight(flight)) { if (this.positionArrayIndex === this.positionArray.length) {
if (flight['reaFlight']['CNCL']) { this.positionArrayIndex = 0;
return true; }
} else { this.row_state = this.positionArray[this.positionArrayIndex];
return false; } else {
} this.positionArray = transArray;
} else { this.positionArrayIndex = 0;
return false; this.row_state = this.positionArray[this.positionArrayIndex];
} }
} } else {
alert('没有搜索到相关数据');
/** }
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班) }
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,30 +14,33 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">值机岛编辑</button> <!-- <button type="button" class="btn btn-info mr-3">值机岛编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of col_lists">{{airline_col.COL_CN}}</th> <th>值机岛代码</th>
<th>值机岛名称</th>
<!-- th *ngFor="let airline_col of col_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let checkinGroup of checkinGroups;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of col_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{checkinGroup.checkinGroupCode}}</td>
<td>{{checkinGroup.checkinGroupName}}</td>
<!-- <td *ngFor="let airline_col of col_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
import { BasicDataService } from '../../basic-data-service'
@Component({ @Component({
selector: 'app-checkin-group', selector: 'app-checkin-group',
templateUrl: './checkin-group.component.html', templateUrl: './checkin-group.component.html',
@@ -11,548 +12,251 @@ export class CheckinGroupComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public col_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { checkinGroups : Array<any>;
public row_state: any = { renderFlight: {} };
} public render_data: Array<object> = []; //显示数据,即需要显示的数据
public formatter = {
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.checkinGroups = this.basicDataService.checkin_group;
/* 获取显示列 */ this.basicDataService.checkin_group_subject.subscribe(
this.httpCilent.get('/assets/mock-data/checkin-group.json').subscribe( data=>{
data => { this.checkinGroups = data;
data.sort(function (a, b) { this.render_data = this.checkinGroups;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.col_lists = data;
}
)
/* 获取值机岛信息 */
this.httpCilent.get('/assets/mock-data/checkin-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.col_lists.length; i++) {
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];
}
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.col_lists.length; i++) {
let key = this.col_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public sequence(flight) { //刷新
let dateTag: number = 10; clearFiter(){
let dateToCompare = new Date().getTime(); $("#inputerInfo").val(""); //清空过滤或查找定位文本框
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { this.ngOnInit();
if (this.isLinked(flight)) { }
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { //输入框回车事件
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); inputEnter() {
dateTag = this.TOP_1; if (this.FLT_POS === 1) {
} this.selectChange()
else { } else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); this.selectChange()
dateTag = this.TOP_2; this.inputPosition(this.render_data)
} }
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
} }
inputFliter() { //下拉框选择筛选
let filterItems = this.filterItems; selectChange() {
let combined_data = this.combined_data; let filter_data = [];
let filter_data = []; let filtercheckinGroups = this.render_data;
this.render_data.forEach(item => {
let sel_col = this.SEL_COL; filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) { //过滤 if (this.FLT_POS === 1) {
//手动输入框筛选 this.inputFilter(filter_data);
if(sel_col){ } else {
combined_data.forEach(item=>{ this.checkinGroups = filter_data;
if(item['renderFlight'][sel_col]){ this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} };
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { }
filter_data.push(Object.assign({}, item)) //下拉框筛选
} filter_data = filter_data.filter(item => {
}else{ if (item) {
if(!this.SEARCH){ let is_satis = true;
filter_data.push(Object.assign({}, item)) for (const key in filtercheckinGroups) {
} if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
} }
})
}else{ }
combined_data.forEach(item => { }
for (const key in item['renderFlight']) { return is_satis;
if (item['renderFlight'].hasOwnProperty(key)) { } else if (item) {
if (item['renderFlight'][key]) { let is_satis = true;
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) { for (const key in filtercheckinGroups) {
filter_data.push(Object.assign({}, item)) if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
break; if (item[key] === filtercheckinGroups[key]) {
} is_satis = true;
} else { continue;
continue; } else {
} is_satis = false;
} break;
} }
})
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
} }
//下拉框筛选 if (pre_satis && !rea_satis) {
filter_data = filter_data.filter(item => { item = item;
if (this.isArriFlight(item)) { return pre_satis;
let is_satis = true; } else if (!pre_satis && rea_satis) {
for (const key in filterItems) { item = item;
if (filterItems.hasOwnProperty(key) && filterItems[key]) { return rea_satis;
if (item['preFlight'][key] === filterItems[key]) { } else if (pre_satis && rea_satis) {
is_satis = true; return pre_satis && rea_satis;
continue; } else {
} else { return false;
is_satis = false; }
break; }
} })
}
} //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
} }
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else { } else {
let pre_satis = true; if (this.SEARCH) {
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false; return false;
} else {
return true;
} }
} }
}) })
this.render_data = filter_data; } else {
filterData = filterData.filter(item => {
} else { //定位 let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
} }
}
this.changeDetectorRef.detectChanges(); this.checkinGroups = filterData;
this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} };
} }
/** positionArray: Array<any> = [];
* 获取航班实际时间 positionArrayIndex: number = 0;
* @param flight //输入框定位
* @return inputPosition(filterData) {
*/ let transArray = []
public getActualDatetime(flight) { if (this.SEL_COL) {
return flight['ACTT']; let sel_col = this.SEL_COL;
} filterData.forEach(element => {
if (element[sel_col]) {
/** if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
* 获取航班预计时间 transArray.push(element)
* @param flight }
* @return } else {
*/ if (!this.SEARCH) {
public getEstimatedDatetime(flight) { transArray.push(element)
return flight['ESTT'] }
} }
});
/** } else {
* 获取航班计划时间 filterData.forEach(element => {
* @param flight for (const key in element) {
* @return if (element.hasOwnProperty(key)) {
*/ if (element[key]) {
public getScheduledDatetime(flight) { if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
return flight['SODT'] transArray.push(element)
} break;
} else {
continue;
/** }
* 判断航班是否是链接航班 } else {
* @param flight if (this.SEARCH) {
* @return continue;
*/ } else {
public isLinked(flight) { transArray.push(element)
if (flight['preFlight'] && flight['reaFlight']) { break;
return true }
} else { }
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} else {
continue;
}
}
});
}
if (transArray.length > 0) {
if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
if (this.positionArrayIndex === this.positionArray.length) {
this.positionArrayIndex = 0;
}
this.row_state = this.positionArray[this.positionArrayIndex];
} else {
this.positionArray = transArray;
this.positionArrayIndex = 0;
this.row_state = this.positionArray[this.positionArrayIndex];
}
} else {
alert('没有搜索到相关数据');
}
}
} }
@@ -14,30 +14,33 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">行李传送带编辑</button> <!-- <button type="button" class="btn btn-info mr-3">行李传送带编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of chut_lists">{{airline_col.COL_CN}}</th> <th>行李传送带代码</th>
<th>行李传送带名称</th>
<!-- <th *ngFor="let airline_col of chut_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let chut of chuts;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of chut_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{chut.chutCode}}</td>
<td>{{chut.chutName}}</td>
<!-- <td *ngFor="let airline_col of chut_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
+220 -515
View File
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-chut', selector: 'app-chut',
templateUrl: './chut.component.html', templateUrl: './chut.component.html',
@@ -11,547 +12,251 @@ export class ChutComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public chut_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { chuts : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
ngOnInit() {
this.chuts = this.basicDataService.chut;
this.basicDataService.chut_subject.subscribe(
data=>{
this.chuts = data;
this.render_data = this.chuts;
}
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public formatter = { //刷新
'SODT': dateFormatter, clearFiter(){
'ESTT': dateFormatter, $("#inputerInfo").val(""); //清空过滤或查找定位文本框
'ACTT': dateFormatter this.ngOnInit();
} }
//输入框回车事件
inputEnter() {
selectRow(i) { if (this.FLT_POS === 1) {
this.row_state = i; this.selectChange()
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.selectChange()
this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ let filter_data = [];
this.httpCilent.get('/assets/mock-data/chut-code.json').subscribe( let filterchuts = this.render_data;
data => { this.render_data.forEach(item => {
data.sort(function (a, b) { filter_data.push(Object.assign({}, item));
return (a['COL_ORDER'] - b['COL_ORDER']); })
}) if (this.FLT_POS === 1) {
this.chut_lists = data; this.inputFilter(filter_data);
} } else {
) this.chuts = filter_data;
/* 获取行李传送带信息 */ this.row_state = this.chuts.length > 0 ? this.chuts[0] : { renderFlight: {} };
this.httpCilent.get('/assets/mock-data/chut-data.json').subscribe( }
data => { //下拉框筛选
//解析数据 filter_data = filter_data.filter(item => {
data.forEach(element => { if (item) {
this.raw_data.push(JSON.parse(element.value)); let is_satis = true;
}); for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
let combined_linked_data = this.raw_data if (item[key] === filterchuts[key]) {
is_satis = true;
combined_linked_data.forEach(element => { continue;
let row_flights = {}; } else {
let render_flight = {}; is_satis = false;
let render_pre_flight = {}; break;
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.chut_lists.length; i++) {
let key = this.chut_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];
} }
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.chut_lists.length; i++) { }
let key = this.chut_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
public sequence(flight) { //输入框筛选
let dateTag: number = 10; inputFilter(filterData) {
let dateToCompare = new Date().getTime(); if (this.SEARCH) {
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { if (this.SEL_COL) {
if (this.isLinked(flight)) { let sel_col = this.SEL_COL;
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { filterData = filterData.filter(item => {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); if (item[sel_col]) {
dateTag = this.TOP_1; if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
} return true;
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
} }
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else { } else {
let pre_satis = true; if (this.SEARCH) {
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false; return false;
} else {
return true;
} }
} }
}) })
this.render_data = filter_data; } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.chuts = filterData;
this.row_state = this.chuts.length > 0 ? this.chuts[0] : { renderFlight: {} };
}
} else { //定位 positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,7 +14,7 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">打印</button> <!-- <button type="button" class="btn btn-info mr-3">打印</button>
@@ -22,7 +22,7 @@
<button type="button" class="btn btn-info mr-3">国家登记</button> <button type="button" class="btn btn-info mr-3">国家登记</button>
<button type="button" class="btn btn-info mr-3">洲/地区登记</button> <button type="button" class="btn btn-info mr-3">洲/地区登记</button>
<button type="button" class="btn btn-info mr-3">定制查询</button> --> <button type="button" class="btn btn-info mr-3">定制查询</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
@@ -37,11 +37,11 @@
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">国家:&nbsp;&nbsp;</label> <label for="">国家:&nbsp;&nbsp;</label>
<select class="form-control"> <select class="form-control" [(ngModel)]="citys" (ngModelChange)="selectChange()" id="citry">
<option value=""></option> <option value=""></option>
<option value="0">中国</option> <option value="ZG">中国</option>
<option value="1">美国</option> <option value="MG">美国</option>
<option value="2">英国</option> <option value="YG">英国</option>
</select> </select>
</div> </div>
<div class="third-condition row"> <div class="third-condition row">
@@ -58,20 +58,27 @@
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<!-- <div id="divFieldset_title" class="divFieldseTitle">城市</div> --> <!-- <div id="divFieldset_title" class="divFieldseTitle">城市</div> -->
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of city_lists">{{airline_col.COL_CN}}</th> <th>城市代码</th>
<th>城市中文名</th>
<th>城市英文名</th>
<th>所在国家</th>
<!-- <th *ngFor="let airline_col of city_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let city of citys;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of city_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{city.cityCode}}</td>
<td>{{city.cityNameChn}}</td>
<td>{{city.cityNameEng}}</td>
<td>{{city.countryId}}</td>
<!-- <td *ngFor="let airline_col of city_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
+227 -522
View File
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-city', selector: 'app-city',
templateUrl: './city.component.html', templateUrl: './city.component.html',
@@ -11,548 +12,252 @@ export class CityComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public city_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { citys : Array<any>;
public row_state: any = { renderFlight: {} };
} public render_data: Array<object> = []; //显示数据,即需要显示的数据
public formatter = {
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.citys = this.basicDataService.city;
/* 获取显示列 */ this.basicDataService.city_subject.subscribe(
this.httpCilent.get('/assets/mock-data/city-code.json').subscribe( data=>{
data => { this.citys = data;
data.sort(function (a, b) { this.render_data = this.citys;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.city_lists = data;
}
)
/* 获取城市信息 */
this.httpCilent.get('/assets/mock-data/city-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.city_lists.length; i++) {
let key = this.city_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.city_lists.length; i++) {
let key = this.city_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public sequence(flight) { //刷新
let dateTag: number = 10; clearFiter(){
let dateToCompare = new Date().getTime(); $("#inputerInfo").val(""); //清空过滤或查找定位文本框
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { $("#citry").val(""); //清空所国家
if (this.isLinked(flight)) { this.ngOnInit();
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { }
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); //输入框回车事件
dateTag = this.TOP_1; inputEnter() {
} if (this.FLT_POS === 1) {
else { this.selectChange()
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); } else {
dateTag = this.TOP_2; this.selectChange()
} this.inputPosition(this.render_data)
} }
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
} }
/* Enter键触发事件过滤条件数据 */ //下拉框选择筛选
inputFliter() { selectChange() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = []; let filter_data = [];
let filtercitys = this.render_data;
let sel_col = this.SEL_COL; this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
if (this.FLT_POS === 1) { //过滤 })
//手动输入框筛选 if (this.FLT_POS === 1) {
if(sel_col){ this.inputFilter(filter_data);
combined_data.forEach(item=>{ } else {
if(item['renderFlight'][sel_col]){ this.citys = filter_data;
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} };
filter_data.push(Object.assign({}, item)) }
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
} }
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
this.render_data = filter_data; }
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
} else { //定位 }
}
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
this.changeDetectorRef.detectChanges(); //输入框筛选
} inputFilter(filterData) {
if (this.SEARCH) {
/** if (this.SEL_COL) {
* 获取航班实际时间 let sel_col = this.SEL_COL;
* @param flight filterData = filterData.filter(item => {
* @return if (item[sel_col]) {
*/ if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getActualDatetime(flight) { return true;
return flight['ACTT']; }
} } else {
if (this.SEARCH) {
/** return false;
* 获取航班预计时间 } else {
* @param flight return true;
* @return }
*/ }
public getEstimatedDatetime(flight) { })
return flight['ESTT']
} } else {
filterData = filterData.filter(item => {
/** let is_satis = false;
* 获取航班计划时间 for (const key in item) {
* @param flight if (item.hasOwnProperty(key)) {
* @return if (item[key]) {
*/ if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getScheduledDatetime(flight) { is_satis = true;
return flight['SODT'] break;
} } else {
is_satis = false;
continue;
/** }
* 判断航班是否是链接航班 } else {
* @param flight if (this.SEARCH) {
* @return is_satis = false;
*/ continue;
public isLinked(flight) { } else {
if (flight['preFlight'] && flight['reaFlight']) { is_satis = true;
return true break;
} else { }
return false }
} } else {
} continue;
}
/** }
* 判断航班是否是纯离港航班 return is_satis;
* @param flight })
* @return }
*/ }
public isDeptFlight(flight) { this.citys = filterData;
if (!flight['preFlight'] && flight['reaFlight']) { this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} };
return true }
} else {
return false positionArray: Array<any> = [];
} positionArrayIndex: number = 0;
//输入框定位
} inputPosition(filterData) {
let transArray = []
/** if (this.SEL_COL) {
* 判断航班是否是纯到港航班 let sel_col = this.SEL_COL;
* @param flight filterData.forEach(element => {
* @return if (element[sel_col]) {
*/ if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public isArriFlight(flight) { transArray.push(element)
if (flight['preFlight'] && !flight['reaFlight']) { }
return true; } else {
} else { if (!this.SEARCH) {
return false; transArray.push(element)
} }
} }
});
/** } else {
* 判断航班是否已经前站起飞 filterData.forEach(element => {
* @param flight for (const key in element) {
* @return if (element.hasOwnProperty(key)) {
*/ if (element[key]) {
public isFlying(flight) { if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
if (this.isArriFlight(flight) || this.isLinked(flight)) { transArray.push(element)
if (flight['preFlight']['PADT']) { break;
return true; } else {
} else { continue;
return false; }
} } else {
} else { if (this.SEARCH) {
return false; continue;
} } else {
} transArray.push(element)
break;
}
/** }
* 判断航班是否取消
* @param flight } else {
* @return continue;
*/ }
public isCancled(flight) { }
if (this.isArriFlight(flight)) { });
if (flight['preFlight']['CNCL']) { }
return true;
} else { if (transArray.length > 0) {
return false; if (transArray.toString() == this.positionArray.toString()) {
} this.positionArrayIndex++;
} else if (this.isDeptFlight(flight)) { if (this.positionArrayIndex === this.positionArray.length) {
if (flight['reaFlight']['CNCL']) { this.positionArrayIndex = 0;
return true; }
} else { this.row_state = this.positionArray[this.positionArrayIndex];
return false; } else {
} this.positionArray = transArray;
} else { this.positionArrayIndex = 0;
return false; this.row_state = this.positionArray[this.positionArrayIndex];
} }
} } else {
alert('没有搜索到相关数据');
/** }
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班) }
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -1,67 +1,71 @@
<div class="main-page"> <div class="main-page">
<div class="page-content"> <div class="page-content">
<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 class="mr-4 form-control" name="" id="">
<option value="">选择列名</option> <option value="">选择列名</option>
</select> </select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
<span>过滤</span>
</label>
<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]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
<span>查找定位</span> <span>过滤</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <label class="radio-inline custom-radio nowrap mr-4">
</div> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <span>查找定位</span>
<!-- <button type="button" class="btn btn-info mr-3">登机门编辑</button> </label>
<button type="button" class="btn btn-info mr-3">打印</button> --> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
<button type="button" class="btn btn-info mr-3">刷新</button> </div>
</div> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
</div> <!-- <button type="button" class="btn btn-info mr-3">登机门编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button>
</div>
</div>
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4">
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option>
<option *ngFor="let items of gates" [value]="items.terminalAreaCode">{{items.terminalAreaCode}}</option>
</select>
</div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">所属航站楼区域&nbsp;&nbsp;</label> <label for="gateStatus">资源状态&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.HZ" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.gateStatus" (ngModelChange)="selectChange()" id="zy">
<option value=""></option> <option value=""></option>
<option value="GH">国内区域</option> <option *ngFor="let items of gates" [value]="items.gateStatus">{{items.gateStatus}}</option>
<option value="CH">国际区域</option> </select>
<option value="QT">其他区域</option> </div>
</select>
</div>
<div class="input-container mr-4">
<label for="">资源状态:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZY" (ngModelChange)="inputFliter()">
<option value=""></option>
<option value="K">可用</option>
<option value="R">不可用</option>
</select>
</div> </div>
</div> </div>
</div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of gate_lists">{{airline_col.COL_CN}}</th> <th>登机门代码</th>
</tr> <th>登机门名称</th>
</thead> <th>航站楼区域</th>
<tbody> <th>资源状态</th>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <!-- <th *ngFor="let airline_col of gate_lists">{{airline_col.COL_CN}}</th> -->
[ngClass]="{'active':row_state===i}"> </tr>
<td>{{i+1}}</td> </thead>
<td *ngFor="let airline_col of gate_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <tbody>
</tr> <tr *ngFor="let gate of render_data;let i = index">
</tbody> <td>{{i+1}}</td>
</table> <td>{{gate.gateCode}}</td>
</div> <td>{{gate.gateName}}</td>
</div> <td>{{gate.terminalAreaCode}}</td>
<td>{{gate.gateStatus}}</td>
<!-- <td *ngFor="let airline_col of gate_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
</div>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
+160 -533
View File
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-gate', selector: 'app-gate',
templateUrl: './gate.component.html', templateUrl: './gate.component.html',
@@ -11,559 +12,185 @@ export class GateComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public gate_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
//下拉框
public filterItems = { public filterItems = {
HZ: '', //所属航站楼区域 terminalAreaCode:'',
ZY: '', //资源状态 gateStatus:'',
} }
public formatter = { gates : Array<any>;
'HZ': { public row_state: any = { renderFlight: {} };
'GH': '国内区域', public render_data: Array<object> = []; //显示数据,即需要显示的数据
'CH': '国际区域', public return_data: Array<object> = []; //下拉框显示数据
"QT": '其他区域' ngOnInit() {
}, this.gates = this.basicDataService.gate;
'ZY': { this.basicDataService.gate_subject.subscribe(
'K': '可用', data=>{
'R': '不可用', this.gates = data;
"T": '其他' this.render_data = this.gates;
}, }
'SODT': dateFormatter, )
'ESTT': dateFormatter, /**
'ACTT': dateFormatter * 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
//输入框回车事件
selectRow(i) { inputEnter() {
this.row_state = i; if (this.FLT_POS === 1) {
this.changeDetectorRef.detectChanges(); this.inputFilter(this.gates)
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.inputFilter(this.gates)
// this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ this.return_data = this.gates.filter(item=>{
this.httpCilent.get('/assets/mock-data/gate-code.json').subscribe( let is_satis = true;
data => { for (const key in this.filterItems) {
data.sort(function (a, b) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
return (a['COL_ORDER'] - b['COL_ORDER']); if (item[key] === this.filterItems[key]) {
}) is_satis = true;
this.gate_lists = data; continue;
} } else {
) is_satis = false;
/* 获取登机门信息 */ break;
this.httpCilent.get('/assets/mock-data/gate-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.gate_lists.length; i++) {
let key = this.gate_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];
}
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.gate_lists.length; i++) {
let key = this.gate_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
} }
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
}
)
}
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,7 +14,7 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">机位编辑</button> <!-- <button type="button" class="btn btn-info mr-3">机位编辑</button>
@@ -25,49 +25,61 @@
<div class="second-condition mb-3 row"> <div class="second-condition mb-3 row">
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">所属航站楼区域:&nbsp;&nbsp;</label> <label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZY" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option> <option value=""></option>
<option value="GH">国内区域</option> <option *ngFor="let items of stands" [value]="items.terminalAreaCode">{{items.terminalAreaCode}}</option>
<!-- <option value="GH">国内区域</option>
<option value="CH">国际区域</option> <option value="CH">国际区域</option>
<option value="QH">其他区域</option> <option value="QH">其他区域</option> -->
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">机位类型:&nbsp;&nbsp;</label> <label for="standType">机位类型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.HZ" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.standType" (ngModelChange)="selectChange()" id="jtype">
<option value=""></option> <option value=""></option>
<option value="YJW">远机位</option> <option *ngFor="let items of stands" [value]="items.standType">{{items.standType}}</option>
<!-- <option value="YJW">远机位</option>
<option value="JJW">近机位</option> <option value="JJW">近机位</option>
<option value="GWJW">过夜机位</option> <option value="GWJW">过夜机位</option>
<option value="ZJW">专机位</option> <option value="ZJW">专机位</option> -->
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="">资源状态:&nbsp;&nbsp;</label> <label for="standStatus">资源状态:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.ZYZT" (ngModelChange)="inputFliter()"> <select class="form-control" [(ngModel)]="filterItems.standStatus" (ngModelChange)="selectChange()" id="zystatus">
<option value=""></option> <option value=""></option>
<option value="K">可用</option> <option *ngFor="let items of stands" [value]="items.standStatus">{{items.standStatus}}</option>
<option value="R">不可用</option> <!-- <option value="K">可用</option>
<option value="R">不可用</option> -->
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of stand_lists">{{airline_col.COL_CN}}</th> <th>机位代码</th>
<th>机位名称</th>
<th>机位类型</th>
<th>资源状态</th>
<th>航站楼区域</th>
<!-- <th *ngFor="let airline_col of stand_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let stand of render_data;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of stand_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{stand.standCode}}</td>
<td>{{stand.standName}}</td>
<td>{{stand.standType}}</td>
<td>{{stand.standStatus}}</td>
<td>{{stand.terminalAreaCode}}</td>
<!-- <td *ngFor="let airline_col of stand_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
+160 -539
View File
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-stand', selector: 'app-stand',
templateUrl: './stand.component.html', templateUrl: './stand.component.html',
@@ -11,565 +12,185 @@ export class StandComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public stand_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
//下拉框
public filterItems = { public filterItems = {
ZY: '', //所属航站楼区域 terminalAreaCode:'',
HZ: '', //机位类型 gateStatus:'',
ZYZT: '', //资源状态
} }
public formatter = { stands : Array<any>;
'ZY': { public row_state: any = { renderFlight: {} };
'GH': '国内区域', public render_data: Array<object> = []; //显示数据,即需要显示的数据
'CH': '国际区域', public return_data: Array<object> = []; //下拉框显示数据
"QH": '其他区域' ngOnInit() {
}, this.stands = this.basicDataService.stand;
'HZ': { this.basicDataService.stand_subject.subscribe(
'YJW': '远机位', data=>{
'JJW': '近机位', this.stands = data;
"GWJW": '过夜机位', this.render_data = this.stands;
"ZJW": '专机位' }
}, )
'ZYZT': { /**
'K': '可用', * 固定表头
'R': '不可用', */
"T": '其他' var tableCont = document.querySelector('#table-container');
}, function scrollHandle (){
'SODT': dateFormatter, var scrollTop = this.scrollTop;
'ESTT': dateFormatter, this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
'ACTT': dateFormatter }
tableCont.addEventListener('scroll',scrollHandle);
} }
//输入框回车事件
selectRow(i) { inputEnter() {
this.row_state = i; if (this.FLT_POS === 1) {
this.changeDetectorRef.detectChanges(); this.inputFilter(this.stands)
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.inputFilter(this.stands)
// this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ this.return_data = this.stands.filter(item=>{
this.httpCilent.get('/assets/mock-data/stand-code.json').subscribe( let is_satis = true;
data => { for (const key in this.filterItems) {
data.sort(function (a, b) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
return (a['COL_ORDER'] - b['COL_ORDER']); if (item[key] === this.filterItems[key]) {
}) is_satis = true;
this.stand_lists = data; continue;
} } else {
) is_satis = false;
/* 获取机位信息 */ break;
this.httpCilent.get('/assets/mock-data/stand-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.stand_lists.length; i++) {
let key = this.stand_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];
}
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.stand_lists.length; i++) {
let key = this.stand_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
} }
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
}
)
}
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
})
this.render_data = this.return_data;
}
this.render_data = filter_data; //输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
if (this.SEARCH) {
return false;
} else {
return true;
}
}
})
} else { //定位 } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,30 +14,33 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">航站楼区域编辑</button> <!-- <button type="button" class="btn btn-info mr-3">航站楼区域编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of terminalarea_lists">{{airline_col.COL_CN}}</th> <th>航站楼区域代码</th>
<th>航站楼区域名称</th>
<!-- <th *ngFor="let airline_col of terminalarea_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let terminalArea of terminalAreas;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of terminalarea_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{terminalArea.terminalAreaCode}}</td>
<td>{{terminalArea.terminalAreaName}}</td>
<!-- <td *ngFor="let airline_col of terminalarea_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-terminal-area', selector: 'app-terminal-area',
templateUrl: './terminal-area.component.html', templateUrl: './terminal-area.component.html',
@@ -11,547 +12,251 @@ export class TerminalAreaComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public terminalarea_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { terminalAreas : Array<any>;
public row_state: any = { renderFlight: {} };
} public render_data: Array<object> = []; //显示数据,即需要显示的数据
public formatter = {
'SODT': dateFormatter,
'ESTT': dateFormatter,
'ACTT': dateFormatter
}
selectRow(i) {
this.row_state = i;
this.changeDetectorRef.detectChanges();
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() { ngOnInit() {
this.changeDetectorRef.detach(); this.terminalAreas = this.basicDataService.terminal_area;
/* 获取显示列 */ this.basicDataService.terminal_area_subject.subscribe(
this.httpCilent.get('/assets/mock-data/terminal-area-code.json').subscribe( data=>{
data => { this.terminalAreas = data;
data.sort(function (a, b) { this.render_data = this.terminalAreas;
return (a['COL_ORDER'] - b['COL_ORDER']);
})
this.terminalarea_lists = data;
}
)
/* 获取航站楼区域信息 */
this.httpCilent.get('/assets/mock-data/terminal-area-data.json').subscribe(
data => {
//解析数据
data.forEach(element => {
this.raw_data.push(JSON.parse(element.value));
});
let combined_linked_data = this.raw_data
combined_linked_data.forEach(element => {
let row_flights = {};
let render_flight = {};
let render_pre_flight = {};
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.terminalarea_lists.length; i++) {
let key = this.terminalarea_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];
}
row_flights['renderFlight'] = render_flight;
if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.terminalarea_lists.length; i++) {
let key = this.terminalarea_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) )
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public sequence(flight) { //刷新
let dateTag: number = 10; clearFiter(){
let dateToCompare = new Date().getTime(); $("#inputerInfo").val(""); //清空过滤或查找定位文本框
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { this.ngOnInit();
if (this.isLinked(flight)) { }
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { //输入框回车事件
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); inputEnter() {
dateTag = this.TOP_1; if (this.FLT_POS === 1) {
} this.selectChange()
else { } else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime(); this.selectChange()
dateTag = this.TOP_2; this.inputPosition(this.render_data)
} }
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
} }
/* Enter键触发事件过滤条件数据 */ //下拉框选择筛选
inputFliter() { selectChange() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = []; let filter_data = [];
let filterterminalAreas = this.render_data;
let sel_col = this.SEL_COL; this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
if (this.FLT_POS === 1) { //过滤 })
//手动输入框筛选 if (this.FLT_POS === 1) {
if(sel_col){ this.inputFilter(filter_data);
combined_data.forEach(item=>{ } else {
if(item['renderFlight'][sel_col]){ this.terminalAreas = filter_data;
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { this.row_state = this.terminalAreas.length > 0 ? this.terminalAreas[0] : { renderFlight: {} };
filter_data.push(Object.assign({}, item)) }
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
} }
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
}
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false;
} }
} }
}) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
this.render_data = filter_data; }
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
} else { //定位 }
}
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
this.changeDetectorRef.detectChanges(); //输入框筛选
} inputFilter(filterData) {
if (this.SEARCH) {
/** if (this.SEL_COL) {
* 获取航班实际时间 let sel_col = this.SEL_COL;
* @param flight filterData = filterData.filter(item => {
* @return if (item[sel_col]) {
*/ if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getActualDatetime(flight) { return true;
return flight['ACTT']; }
} } else {
if (this.SEARCH) {
/** return false;
* 获取航班预计时间 } else {
* @param flight return true;
* @return }
*/ }
public getEstimatedDatetime(flight) { })
return flight['ESTT']
} } else {
filterData = filterData.filter(item => {
/** let is_satis = false;
* 获取航班计划时间 for (const key in item) {
* @param flight if (item.hasOwnProperty(key)) {
* @return if (item[key]) {
*/ if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
public getScheduledDatetime(flight) { is_satis = true;
return flight['SODT'] break;
} } else {
is_satis = false;
continue;
/** }
* 判断航班是否是链接航班 } else {
* @param flight if (this.SEARCH) {
* @return is_satis = false;
*/ continue;
public isLinked(flight) { } else {
if (flight['preFlight'] && flight['reaFlight']) { is_satis = true;
return true break;
} else { }
return false }
} } else {
} continue;
}
/** }
* 判断航班是否是纯离港航班 return is_satis;
* @param flight })
* @return }
*/ }
public isDeptFlight(flight) { this.terminalAreas = filterData;
if (!flight['preFlight'] && flight['reaFlight']) { this.row_state = this.terminalAreas.length > 0 ? this.terminalAreas[0] : { renderFlight: {} };
return true }
} else {
return false positionArray: Array<any> = [];
} positionArrayIndex: number = 0;
//输入框定位
} inputPosition(filterData) {
let transArray = []
/** if (this.SEL_COL) {
* 判断航班是否是纯到港航班 let sel_col = this.SEL_COL;
* @param flight filterData.forEach(element => {
* @return if (element[sel_col]) {
*/ if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
public isArriFlight(flight) { transArray.push(element)
if (flight['preFlight'] && !flight['reaFlight']) { }
return true; } else {
} else { if (!this.SEARCH) {
return false; transArray.push(element)
} }
} }
});
/** } else {
* 判断航班是否已经前站起飞 filterData.forEach(element => {
* @param flight for (const key in element) {
* @return if (element.hasOwnProperty(key)) {
*/ if (element[key]) {
public isFlying(flight) { if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
if (this.isArriFlight(flight) || this.isLinked(flight)) { transArray.push(element)
if (flight['preFlight']['PADT']) { break;
return true; } else {
} else { continue;
return false; }
} } else {
} else { if (this.SEARCH) {
return false; continue;
} } else {
} transArray.push(element)
break;
}
/** }
* 判断航班是否取消
* @param flight } else {
* @return continue;
*/ }
public isCancled(flight) { }
if (this.isArriFlight(flight)) { });
if (flight['preFlight']['CNCL']) { }
return true;
} else { if (transArray.length > 0) {
return false; if (transArray.toString() == this.positionArray.toString()) {
} this.positionArrayIndex++;
} else if (this.isDeptFlight(flight)) { if (this.positionArrayIndex === this.positionArray.length) {
if (flight['reaFlight']['CNCL']) { this.positionArrayIndex = 0;
return true; }
} else { this.row_state = this.positionArray[this.positionArrayIndex];
return false; } else {
} this.positionArray = transArray;
} else { this.positionArrayIndex = 0;
return false; this.row_state = this.positionArray[this.positionArrayIndex];
} }
} } else {
alert('没有搜索到相关数据');
/** }
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班) }
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
@@ -14,30 +14,33 @@
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
<span>查找定位</span> <span>查找定位</span>
</label> </label>
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()"> <input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
</div> </div>
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">航站楼编辑</button> <!-- <button type="button" class="btn btn-info mr-3">航站楼编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <button type="button" class="btn btn-info mr-3" (click)="clearFiter()">刷新</button>
</div> </div>
</div> </div>
</div> </div>
<div class="airline-table"> <div class="airline-table">
<div class="table-container"> <div id="table-container" class="table-container">
<table class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>序号</th> <th>序号</th>
<th *ngFor="let airline_col of terminal_lists">{{airline_col.COL_CN}}</th> <th>航站楼代码</th>
<th>航站楼名称</th>
<!-- <th *ngFor="let airline_col of terminal_lists">{{airline_col.COL_CN}}</th> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)" <tr *ngFor="let terminal of terminals;let i = index">
[ngClass]="{'active':row_state===i}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td *ngFor="let airline_col of terminal_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> <td>{{terminal.terminalCode}}</td>
<td>{{terminal.terminalName}}</td>
<!-- <td *ngFor="let airline_col of terminal_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -1,6 +1,7 @@
.main-page { .main-page {
width: 100%; width: 100%;
height: calc(100% - 66px); height: 100%;
overflow-y: scroll;
padding: 15px 10px; padding: 15px 10px;
background-color: #fff; background-color: #fff;
.page-content { .page-content {
@@ -31,15 +32,19 @@
// border: 1px solid #ccc; // border: 1px solid #ccc;
width: 100%; width: 100%;
height: 700px; height: 700px;
overflow: scroll; overflow: auto;
box-shadow: 0 0 1px .5px #ddd;
table{ table{
width: max-content; width: max-content;
tr{ tr{
cursor: pointer; cursor: pointer;
&.active{ &.selected{
background: rgb(181, 215, 255); background: rgb(181, 215, 255);
} }
} }
th{
background-color: #ddd;
}
th,td{ th,td{
// border: none; // border: none;
text-align: center; text-align: center;
@@ -1,7 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service'; import { HttpClientService } from '../../../services/http-client.service';
import dateFormatter from '../../../utils/data-formatter'; import { BasicDataService } from '../../basic-data-service'
import { HttpParams } from '@angular/common/http';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-terminal', selector: 'app-terminal',
templateUrl: './terminal.component.html', templateUrl: './terminal.component.html',
@@ -11,547 +12,251 @@ export class TerminalComponent implements OnInit {
constructor( constructor(
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef private basicDataService: BasicDataService
) { } ) { }
public raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public terminal_lists: Array<object>; //列数据
public row_state: number;
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
// 搜索条件 // 搜索条件
SEARCH = ''; //手动输入条件 SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位 FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名 SEL_COL = ''; //选择列名
public filterItems = { terminals : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
ngOnInit() {
this.terminals = this.basicDataService.terminal;
this.basicDataService.terminal_subject.subscribe(
data=>{
this.terminals = data;
this.render_data = this.terminals;
}
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
} }
public formatter = { //刷新
'SODT': dateFormatter, clearFiter(){
'ESTT': dateFormatter, $("#inputerInfo").val(""); //清空过滤或查找定位文本框
'ACTT': dateFormatter this.ngOnInit();
} }
//输入框回车事件
selectRow(i) { inputEnter() {
this.row_state = i; if (this.FLT_POS === 1) {
this.changeDetectorRef.detectChanges(); this.selectChange()
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else { } else {
return null this.selectChange()
this.inputPosition(this.render_data)
} }
} }
ngOnInit() { //下拉框选择筛选
this.changeDetectorRef.detach(); selectChange() {
/* 获取显示列 */ let filter_data = [];
this.httpCilent.get('/assets/mock-data/terminal-code.json').subscribe( let filterterminals = this.render_data;
data => { this.render_data.forEach(item => {
data.sort(function (a, b) { filter_data.push(Object.assign({}, item));
return (a['COL_ORDER'] - b['COL_ORDER']); })
}) if (this.FLT_POS === 1) {
this.terminal_lists = data; this.inputFilter(filter_data);
} } else {
) this.terminals = filter_data;
/* 获取航站楼信息 */ this.row_state = this.terminals.length > 0 ? this.terminals[0] : { renderFlight: {} };
this.httpCilent.get('/assets/mock-data/terminal-data.json').subscribe( }
data => { //下拉框筛选
//解析数据 filter_data = filter_data.filter(item => {
data.forEach(element => { if (item) {
this.raw_data.push(JSON.parse(element.value)); let is_satis = true;
}); for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
let combined_linked_data = this.raw_data if (item[key] === filterterminals[key]) {
is_satis = true;
combined_linked_data.forEach(element => { continue;
let row_flights = {}; } else {
let render_flight = {}; is_satis = false;
let render_pre_flight = {}; break;
let render_rea_flight = {};
row_flights['preFlight'] = element;
for (let i = 0; i < this.terminal_lists.length; i++) {
let key = this.terminal_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];
} }
row_flights['renderFlight'] = render_flight;if (element['isLinked']) {
row_flights['preFlight'] = element['linkFlight'];
delete element['linkFlight'];
delete element['isLinked'];
row_flights['reaFlight'] = element;
for (let i = 0; i < this.terminal_lists.length; i++) { }
let key = this.terminal_lists[i]['COL_CODE']
if (this.formatter.hasOwnProperty(key)) {
if (typeof (this.formatter[key]) === 'function') {
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));
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
} 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]]);
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
}
} 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_pre_flight[key] = row_flights['preFlight'][key];
render_rea_flight[key] = row_flights['reaFlight'][key];
}
}
row_flights['renderFlight'] = render_flight;
row_flights['renderPreFlight'] = render_pre_flight;
row_flights['renderReaFlight'] = render_rea_flight;
}
this.combined_data.push(row_flights)
})
//排序
this.combined_data.forEach(element => {
element['ORDER'] = this.sequence(element)
// element['ORDER'] = '+' + element['order']
})
this.combined_data.sort(function (a, b) {
return (a['ORDER'] - b['ORDER']);
})
this.render_data = this.combined_data
this.changeDetectorRef.detectChanges();
} }
) return is_satis;
} else if (item) {
let is_satis = true;
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
} }
public sequence(flight) { //输入框筛选
let dateTag: number = 10; inputFilter(filterData) {
let dateToCompare = new Date().getTime(); if (this.SEARCH) {
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) { if (this.SEL_COL) {
if (this.isLinked(flight)) { let sel_col = this.SEL_COL;
if (this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) { filterData = filterData.filter(item => {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime(); if (item[sel_col]) {
dateTag = this.TOP_1; if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
} return true;
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight) && !this.getActualDatetime(flight['preFlight'])) {
if (this.getEstimatedDatetime(flight['preFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['preFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['preFlight']) && !this.getActualDatetime(flight['reaFlight'])) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['reaFlight']))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
if (this.isDeptFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['reaFlight']))).getTime();
} else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['preFlight']))).getTime();
}
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
inputFliter() {
let filterItems = this.filterItems;
let combined_data = this.combined_data;
let filter_data = [];
let sel_col = this.SEL_COL;
if (this.FLT_POS === 1) { //过滤
//手动输入框筛选
if(sel_col){
combined_data.forEach(item=>{
if(item['renderFlight'][sel_col]){
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
}
}else{
if(!this.SEARCH){
filter_data.push(Object.assign({}, item))
}
} }
})
}else{
combined_data.forEach(item => {
for (const key in item['renderFlight']) {
if (item['renderFlight'].hasOwnProperty(key)) {
if (item['renderFlight'][key]) {
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
filter_data.push(Object.assign({}, item))
break;
}
} else {
continue;
}
}
}
})
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (this.isArriFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else if (this.isDeptFlight(item)) {
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;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else { } else {
let pre_satis = true; if (this.SEARCH) {
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;
} 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;
} else {
rea_satis = false;
break;
}
}
}
if(pre_satis&&!rea_satis){
item['renderFlight'] = item['renderPreFlight'];
return pre_satis;
}else if(!pre_satis&&rea_satis){
item['renderFlight'] = item['renderReaFlight'];
return rea_satis;
}else if(pre_satis&&rea_satis){
return pre_satis&&rea_satis;
}else{
return false; return false;
} else {
return true;
} }
} }
}) })
this.render_data = filter_data; } else {
filterData = filterData.filter(item => {
let is_satis = false;
for (const key in item) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
this.terminals = filterData;
this.row_state = this.terminals.length > 0 ? this.terminals[0] : { renderFlight: {} };
}
} else { //定位 positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} else {
filterData.forEach(element => {
for (const key in element) {
if (element.hasOwnProperty(key)) {
if (element[key]) {
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
} }
this.changeDetectorRef.detectChanges(); if (transArray.length > 0) {
} if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
/** if (this.positionArrayIndex === this.positionArray.length) {
* 获取航班实际时间 this.positionArrayIndex = 0;
* @param flight }
* @return this.row_state = this.positionArray[this.positionArrayIndex];
*/ } else {
public getActualDatetime(flight) { this.positionArray = transArray;
return flight['ACTT']; this.positionArrayIndex = 0;
} this.row_state = this.positionArray[this.positionArrayIndex];
}
/** } else {
* 获取航班预计时间 alert('没有搜索到相关数据');
* @param flight }
* @return }
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
if (flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
if (!flight['preFlight'] && flight['reaFlight']) {
return true
} else {
return false
}
}
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
if (flight['preFlight'] && !flight['reaFlight']) {
return true;
} else {
return false;
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight) || this.isLinked(flight)) {
if (flight['preFlight']['PADT']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight)) {
if (flight['preFlight']['CNCL']) {
return true;
} else {
return false;
}
} else if (this.isDeptFlight(flight)) {
if (flight['reaFlight']['CNCL']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['reaFlight']['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight['reaFlight'])) {
return false;
} else {
return true;
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight['preFlight'])) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['reaFlight']['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['reaFlight']['BOTM'] && !flight['reaFlight']['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
} }
+8 -33
View File
@@ -1,67 +1,42 @@
[ [
{ {
"COL_CODE":"FLNO", "COL_CODE":"FLNO",
"COL_CN":"机型代码", "COL_CN":"飞机号",
"COL_ORDER":"1" "COL_ORDER":"1"
}, },
{ {
"COL_CODE":"ALCD", "COL_CODE":"ALCD",
"COL_CN":"机型名称", "COL_CN":"最大乘客数",
"COL_ORDER":"2" "COL_ORDER":"2"
}, },
{ {
"COL_CODE":"HZ", "COL_CODE":"HZ",
"COL_CN":"飞机长度", "COL_CN":"最大货物重量",
"COL_ORDER":"3" "COL_ORDER":"3"
}, },
{ {
"COL_CODE":"ZY", "COL_CODE":"ZY",
"COL_CN":"翼展", "COL_CN":"最大起飞重量",
"COL_ORDER":"4" "COL_ORDER":"4"
}, },
{ {
"COL_CODE":"LQ", "COL_CODE":"LQ",
"COL_CN":"机身高度", "COL_CN":"最大廊桥数",
"COL_ORDER":"5" "COL_ORDER":"5"
}, },
{ {
"COL_CODE":"ZJ", "COL_CODE":"ZJ",
"COL_CN":"最大乘客数", "COL_CN":"机主航空公司",
"COL_ORDER":"6" "COL_ORDER":"6"
}, },
{ {
"COL_CODE":"HK", "COL_CODE":"HK",
"COL_CN":"最大货物重量", "COL_CN":"航空公司",
"COL_ORDER":"7" "COL_ORDER":"7"
}, },
{ {
"COL_CODE":"JX", "COL_CODE":"JX",
"COL_CN":"最大起飞重量", "COL_CN":"机型",
"COL_ORDER":"8" "COL_ORDER":"8"
},
{
"COL_CODE":"ZDLQS",
"COL_CN":"最大廊桥数",
"COL_ORDER":"9"
},
{
"COL_CODE":"ZZU",
"COL_CN":"机型组",
"COL_ORDER":"10"
},
{
"COL_CODE":"CAA",
"COL_CN":"CAA码",
"COL_ORDER":"11"
},
{
"COL_CODE":"IATA",
"COL_CN":"IATA码",
"COL_ORDER":"12"
},
{
"COL_CODE":"ICAO",
"COL_CN":"ICAO码",
"COL_ORDER":"13"
} }
] ]
+21 -21
View File
@@ -1,7 +1,7 @@
[ [
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"B\"}",
"offset": 1988, "offset": 1988,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -9,7 +9,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"T\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"C\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -17,7 +17,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -25,7 +25,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"T\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"C\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -33,7 +33,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"B\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -41,7 +41,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -49,7 +49,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"B\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -57,7 +57,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"C\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -65,7 +65,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -73,7 +73,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -81,7 +81,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -89,7 +89,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -97,7 +97,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -105,7 +105,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -113,7 +113,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -121,7 +121,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -129,7 +129,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -137,7 +137,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -145,7 +145,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -153,7 +153,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -161,7 +161,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}", "value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
+33 -8
View File
@@ -1,42 +1,67 @@
[ [
{ {
"COL_CODE":"FLNO", "COL_CODE":"FLNO",
"COL_CN":"飞机号", "COL_CN":"机型代码",
"COL_ORDER":"1" "COL_ORDER":"1"
}, },
{ {
"COL_CODE":"ALCD", "COL_CODE":"ALCD",
"COL_CN":"最大乘客数", "COL_CN":"机型名称",
"COL_ORDER":"2" "COL_ORDER":"2"
}, },
{ {
"COL_CODE":"HZ", "COL_CODE":"HZ",
"COL_CN":"最大货物重量", "COL_CN":"飞机长度",
"COL_ORDER":"3" "COL_ORDER":"3"
}, },
{ {
"COL_CODE":"ZY", "COL_CODE":"ZY",
"COL_CN":"最大起飞重量", "COL_CN":"翼展",
"COL_ORDER":"4" "COL_ORDER":"4"
}, },
{ {
"COL_CODE":"LQ", "COL_CODE":"LQ",
"COL_CN":"最大廊桥数", "COL_CN":"机身高度",
"COL_ORDER":"5" "COL_ORDER":"5"
}, },
{ {
"COL_CODE":"ZJ", "COL_CODE":"ZJ",
"COL_CN":"机主航空公司", "COL_CN":"最大乘客数",
"COL_ORDER":"6" "COL_ORDER":"6"
}, },
{ {
"COL_CODE":"HK", "COL_CODE":"HK",
"COL_CN":"航空公司", "COL_CN":"最大货物重量",
"COL_ORDER":"7" "COL_ORDER":"7"
}, },
{ {
"COL_CODE":"JX", "COL_CODE":"JX",
"COL_CN":"机型", "COL_CN":"最大起飞重量",
"COL_ORDER":"8" "COL_ORDER":"8"
},
{
"COL_CODE":"ZDLQS",
"COL_CN":"最大廊桥数",
"COL_ORDER":"9"
},
{
"COL_CODE":"ZZU",
"COL_CN":"机型组",
"COL_ORDER":"10"
},
{
"COL_CODE":"CAA",
"COL_CN":"CAA码",
"COL_ORDER":"11"
},
{
"COL_CODE":"IATA",
"COL_CN":"IATA码",
"COL_ORDER":"12"
},
{
"COL_CODE":"ICAO",
"COL_CN":"ICAO码",
"COL_ORDER":"13"
} }
] ]
+21 -21
View File
@@ -1,7 +1,7 @@
[ [
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"B\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1988, "offset": 1988,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -9,7 +9,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"C\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"T\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -17,7 +17,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -25,7 +25,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"C\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"T\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -33,7 +33,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"B\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -41,7 +41,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -49,7 +49,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"CH\", \"JX\": \"B\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -57,7 +57,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"C\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"G\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -65,7 +65,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -73,7 +73,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -81,7 +81,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -89,7 +89,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -97,7 +97,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -105,7 +105,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -113,7 +113,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -121,7 +121,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -129,7 +129,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -137,7 +137,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -145,7 +145,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -153,7 +153,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -161,7 +161,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"415\", \"FLNO\": \"B6532\", \"HZ\": \"926999.0\", \"ZY\": \"9999.0\", \"LQ\": \"2\", \"ZJ\": \"海南航空公司\", \"HK\": \"GH\", \"JX\": \"A\"}", "value": "{\"ALCD\": \"ADFKJDNL\", \"FLNO\": \"AN28\", \"HZ\": \"12.68\", \"ZY\": \"0.0\", \"LQ\": \"236\", \"ZJ\": \"9999\", \"HK\": \"88888\",\"JX\": \"2222000\",\"ZDLQS\": \"666\",\"ZZU\": \"E\",\"CAA\": \"CAA000\",\"IATA\": \"AN8552\",\"ICAO\": \"AN285\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
+21 -21
View File
@@ -1,7 +1,7 @@
[ [
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"GH\"}",
"offset": 1988, "offset": 1988,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -9,7 +9,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"GH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -17,7 +17,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -25,7 +25,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -33,7 +33,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -41,7 +41,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -49,7 +49,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -57,7 +57,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -65,7 +65,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -73,7 +73,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -81,7 +81,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -89,7 +89,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"QH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -97,7 +97,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -105,7 +105,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -113,7 +113,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -121,7 +121,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -129,7 +129,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -137,7 +137,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -145,7 +145,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"XG\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -153,7 +153,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -161,7 +161,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"香港华明\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"机场集团\"}", "value": "{\"ALCD\": \"香港华明航空公司\", \"FLNO\": \"LD\", \"HZ\": \"GZ\", \"ZY\": \"GZ\", \"YW\": \"GZ\", \"IATA\": \"IATA\", \"CAA\": \"CAA\",\"ICAO\": \"ICAO\",\"JT\": \"CH\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
+21 -21
View File
@@ -1,7 +1,7 @@
[ [
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CZ\", \"FLNO\": \"CZ3402\"}", "value": "{\"ALCD\": \"CZ\", \"FLNOJ\": \"CZ3402\"}",
"offset": 1988, "offset": 1988,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -9,7 +9,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -17,7 +17,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -25,7 +25,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -33,7 +33,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -41,7 +41,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -49,7 +49,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -57,7 +57,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -65,7 +65,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -73,7 +73,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -81,7 +81,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -89,7 +89,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -97,7 +97,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -105,7 +105,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -113,7 +113,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -121,7 +121,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -129,7 +129,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -137,7 +137,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -145,7 +145,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -153,7 +153,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -161,7 +161,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"CA\", \"FLNO\": \"CA4513\"}", "value": "{\"ALCD\": \"CA\", \"FLNOJ\": \"CA4513\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
+1 -1
View File
@@ -1,6 +1,6 @@
[ [
{ {
"COL_CODE":"FLNO", "COL_CODE":"FLNOJ",
"COL_CN":"值机岛代码", "COL_CN":"值机岛代码",
"COL_ORDER":"1" "COL_ORDER":"1"
}, },
+21 -21
View File
@@ -1,7 +1,7 @@
[ [
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"ZG\"}",
"offset": 1988, "offset": 1988,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -9,7 +9,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"YG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -17,7 +17,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -25,7 +25,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"YG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -33,7 +33,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -41,7 +41,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"ZG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -49,7 +49,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -57,7 +57,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"ZG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -65,7 +65,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -73,7 +73,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -81,7 +81,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -89,7 +89,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -97,7 +97,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -105,7 +105,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -113,7 +113,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -121,7 +121,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -129,7 +129,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -137,7 +137,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -145,7 +145,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -153,7 +153,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,
@@ -161,7 +161,7 @@
}, },
{ {
"topic": "schd", "topic": "schd",
"value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"埃及\"}", "value": "{\"ALCD\": \"开罗\", \"FLNO\": \"YYJ\", \"HZ\": \"ICAJI\", \"ZY\": \"MG\"}",
"offset": 1989, "offset": 1989,
"partition": 0, "partition": 0,
"highWaterOffset": 3975, "highWaterOffset": 3975,