基础数据服务加载基础数据
This commit is contained in:
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ChangeDetectorRef } from '@angular/core';
|
||||
|
||||
import { HttpClientService } from '../../services/http-client.service';
|
||||
import {BasicDataService} from '../basic-data-service'
|
||||
import { BasicDataService } from '../basic-data-service'
|
||||
|
||||
import dateFormatter from '../../utils/data-formatter';
|
||||
import routeType from '../../utils/route-type';
|
||||
@@ -19,64 +19,34 @@ import * as $ from 'jquery';
|
||||
export class MainComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
|
||||
private basicDataService:BasicDataService,
|
||||
private basicDataService: BasicDataService,
|
||||
private httpCilent: HttpClientService,
|
||||
private changeDetectorRef: ChangeDetectorRef
|
||||
) {
|
||||
this.basicDataService.checkin_group_subject.subscribe(val=>{
|
||||
console.log(val)
|
||||
})
|
||||
}
|
||||
) { }
|
||||
|
||||
//各项基础数据
|
||||
public checkin_group: Array<any>;
|
||||
public gate: Array<any>;
|
||||
public terminal: Array<any>;
|
||||
public chut: Array<any>;
|
||||
public stand: Array<any>;
|
||||
public carousel: Array<any>;
|
||||
public checkin_desk: Array<any>;
|
||||
public airport: Array<any>;
|
||||
public city: Array<any>;
|
||||
public aircraft_type: Array<any>;
|
||||
public aircraft: Array<any>;
|
||||
public terminal_area: Array<any>;
|
||||
public airline: Array<any>;
|
||||
|
||||
public raw_data: Array<object> = []; //原始数据,即航班计划
|
||||
|
||||
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
|
||||
|
||||
// public filter_data:Array<object> = []; //用于过滤和定位的数据
|
||||
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
|
||||
|
||||
|
||||
public col_lists: Array<object>; //列数据
|
||||
public airline_color: Array<object> = [];
|
||||
public row_state: any = { renderFlight: {} };
|
||||
|
||||
|
||||
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 = {
|
||||
ALCD: '', //航空公司
|
||||
FLIN: '', //航线类别
|
||||
FLTY: '', //航班类别
|
||||
MVIN: '', //到达/出发
|
||||
TRML: '', //航站楼
|
||||
FHAG: '', //机坪代理
|
||||
MHAG: '', //维护代理
|
||||
PHAG: '', //旅客代理
|
||||
}
|
||||
|
||||
public formatter = {
|
||||
'MVIN': {
|
||||
'A': '到达',
|
||||
@@ -95,20 +65,6 @@ export class MainComponent implements OnInit {
|
||||
'ACTT': dateFormatter
|
||||
}
|
||||
|
||||
|
||||
selectRow(i) {
|
||||
this.row_state = i;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
getColor(col_CODE) {
|
||||
if (col_CODE === 'SODT') {
|
||||
return 'skyblue'
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.changeDetectorRef.detach();
|
||||
/* 获取显示列 */
|
||||
@@ -206,11 +162,69 @@ export class MainComponent implements OnInit {
|
||||
* 固定表头
|
||||
*/
|
||||
var tableCont = document.querySelector('#table-container')
|
||||
function scrollHandle (){
|
||||
var scrollTop = this.scrollTop;
|
||||
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
|
||||
function scrollHandle() {
|
||||
var scrollTop = this.scrollTop;
|
||||
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
|
||||
}
|
||||
tableCont.addEventListener('scroll',scrollHandle)
|
||||
tableCont.addEventListener('scroll', scrollHandle)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基础数据
|
||||
*/
|
||||
getBasicData() {
|
||||
this.checkin_group = this.basicDataService.checkin_group;
|
||||
this.basicDataService.checkin_group_subject.subscribe(
|
||||
val => this.checkin_group = val
|
||||
);
|
||||
this.gate = this.basicDataService.gate;
|
||||
this.basicDataService.gate_subject.subscribe(
|
||||
val => this.gate = val
|
||||
);
|
||||
this.terminal = this.basicDataService.terminal;
|
||||
this.basicDataService.terminal_subject.subscribe(
|
||||
val => this.terminal = val
|
||||
);
|
||||
this.chut = this.basicDataService.chut;
|
||||
this.basicDataService.chut_subject.subscribe(
|
||||
val => this.chut = val
|
||||
);
|
||||
this.stand = this.basicDataService.stand;
|
||||
this.basicDataService.stand_subject.subscribe(
|
||||
val => this.stand = val
|
||||
);
|
||||
this.carousel = this.basicDataService.carousel;
|
||||
this.basicDataService.carousel_subject.subscribe(
|
||||
val => this.carousel = val
|
||||
);
|
||||
this.checkin_desk = this.basicDataService.checkin_desk;
|
||||
this.basicDataService.checkin_desk_subject.subscribe(
|
||||
val => this.checkin_desk = val
|
||||
);
|
||||
this.airport = this.basicDataService.airport;
|
||||
this.basicDataService.airport_subject.subscribe(
|
||||
val => this.airport = val
|
||||
);
|
||||
this.city = this.basicDataService.city;
|
||||
this.basicDataService.city_subject.subscribe(
|
||||
val => this.city = val
|
||||
);
|
||||
this.aircraft_type = this.basicDataService.aircraft_type;
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
val => this.aircraft_type = val
|
||||
);
|
||||
this.aircraft = this.basicDataService.aircraft;
|
||||
this.basicDataService.aircraft_subject.subscribe(
|
||||
val => this.aircraft = val
|
||||
);
|
||||
this.terminal_area = this.basicDataService.terminal_area;
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
val => this.terminal_area = val
|
||||
);
|
||||
this.airline = this.basicDataService.airline;
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
val => this.airline = val
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +251,23 @@ export class MainComponent implements OnInit {
|
||||
* @param filterItems
|
||||
* @return
|
||||
*/
|
||||
//输入框回车事件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
public filterItems = {
|
||||
ALCD: '', //航空公司
|
||||
FLIN: '', //航线类别
|
||||
FLTY: '', //航班类别
|
||||
MVIN: '', //到达/出发
|
||||
TRML: '', //航站楼
|
||||
FHAG: '', //机坪代理
|
||||
MHAG: '', //维护代理
|
||||
PHAG: '', //旅客代理
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入框回车事件
|
||||
*/
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.selectChange()
|
||||
@@ -247,7 +277,9 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
/**
|
||||
* 下拉框选择筛选
|
||||
*/
|
||||
selectChange() {
|
||||
let filter_data = [];
|
||||
let filterItems = this.filterItems;
|
||||
@@ -336,7 +368,11 @@ export class MainComponent implements OnInit {
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
//输入框筛选
|
||||
|
||||
/**
|
||||
* 输入框筛选
|
||||
* @param filterData
|
||||
*/
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
@@ -390,9 +426,12 @@ export class MainComponent implements OnInit {
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入框定位
|
||||
*/
|
||||
positionArray: Array<any> = [];
|
||||
positionArrayIndex: number = 0;
|
||||
//输入框定位
|
||||
|
||||
inputPosition(filterData) {
|
||||
let transArray = []
|
||||
if (this.SEL_COL) {
|
||||
@@ -463,33 +502,20 @@ export class MainComponent implements OnInit {
|
||||
* @param flight
|
||||
* @return
|
||||
*/
|
||||
|
||||
/** (0)000000+实际时间(到达航班有实际时间,且未超过1小时)
|
||||
(0-1)无链接航班,取实际(到达)时间
|
||||
(0-2)有链接航班,且出发航班未有实际时间,取实际(到达)时间
|
||||
(1)100000+商调完成时间(商调完成登机未开始)
|
||||
(2)110000+登机开始时间(登机开始尚未登机结束)
|
||||
(3)111000+登机结束时间(登机结束)
|
||||
(4)111100+计划/预计时间(无商调完成时间、登机开始时间、登机结束时间、航班实际完成时间)
|
||||
(4-1)无链接航班
|
||||
(4-1-1)若有预计时间则取预计时间
|
||||
(4-1-2)若无预计时间则取计划时间
|
||||
(4-2)有链接航班
|
||||
(4-2-1)若无实际到达时间,则
|
||||
(4-2-1-1)若有预计到达时间则取预计到达时间
|
||||
(4-2-1-2)若无预计到达时间则取计划到达时间
|
||||
(4-2-2)若有实际到达时间,
|
||||
(4-2-2-1)若有预计出发时间则取预计出发时间
|
||||
(4-2-2-2)若无预计出发时间则取计划出发时间
|
||||
(5)111110+计划/预计时间(航班取消)[只考虑无链接航班,因为链接航班不会有取消状态]
|
||||
(5-1)若有预计时间则取预计时间
|
||||
(5-2)若无预计时间则取计划时间
|
||||
(6)111111+实际时间(航班完成)
|
||||
(6-1)无链接航班,取实际(到达/出发)时间
|
||||
(6-1-1)到达航班有实际时间,且超过(含)1小时
|
||||
(6-1-2)出发航班有实际时间
|
||||
(6-2)有链接航班,取实际(出发)时间
|
||||
*/
|
||||
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;
|
||||
|
||||
public sequence(flight) {
|
||||
let dateTag: number = 10;
|
||||
@@ -775,4 +801,25 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
* @param i
|
||||
*/
|
||||
selectRow(i) {
|
||||
this.row_state = i;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前单元格颜色
|
||||
* @param col_CODE
|
||||
*/
|
||||
getColor(col_CODE) {
|
||||
if (col_CODE === 'SODT') {
|
||||
return 'skyblue'
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { NgZorroAntdModule } from 'ng-zorro-antd'
|
||||
import { PipesModule } from '../../pipes/pipes.module';
|
||||
import { MainComponent } from './main.component';
|
||||
import { MainRoutingModule } from './main-routing.module'
|
||||
import {BasicDataService} from '../basic-data-service'
|
||||
// import {BasicDataService} from '../basic-data-service'
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -18,6 +18,6 @@ import {BasicDataService} from '../basic-data-service'
|
||||
MainRoutingModule
|
||||
],
|
||||
declarations: [MainComponent],
|
||||
providers:[BasicDataService]
|
||||
providers:[]
|
||||
})
|
||||
export class MainModule { }
|
||||
|
||||
Reference in New Issue
Block a user