基础数据服务加载基础数据

This commit is contained in:
zhouyuejun
2018-11-19 09:30:59 +08:00
parent 5b29727f7f
commit 526cfe1251
8 changed files with 267 additions and 660 deletions
+8 -532
View File
@@ -249,7 +249,6 @@
"requires": { "requires": {
"anymatch": "1.3.2", "anymatch": "1.3.2",
"async-each": "1.0.1", "async-each": "1.0.1",
"fsevents": "1.2.4",
"glob-parent": "2.0.0", "glob-parent": "2.0.0",
"inherits": "2.0.3", "inherits": "2.0.3",
"is-binary-path": "1.0.1", "is-binary-path": "1.0.1",
@@ -1760,7 +1759,6 @@
"anymatch": "2.0.0", "anymatch": "2.0.0",
"async-each": "1.0.1", "async-each": "1.0.1",
"braces": "2.3.2", "braces": "2.3.2",
"fsevents": "1.2.4",
"glob-parent": "3.1.0", "glob-parent": "3.1.0",
"inherits": "2.0.3", "inherits": "2.0.3",
"is-binary-path": "1.0.1", "is-binary-path": "1.0.1",
@@ -3621,535 +3619,6 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true "dev": true
}, },
"fsevents": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
"integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
"dev": true,
"optional": true,
"requires": {
"nan": "2.11.1",
"node-pre-gyp": "0.10.0"
},
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
},
"aproba": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true
},
"are-we-there-yet": {
"version": "1.1.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"delegates": "1.0.0",
"readable-stream": "2.3.6"
}
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
"chownr": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"debug": {
"version": "2.6.9",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ms": "2.0.0"
}
},
"deep-extend": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true
},
"delegates": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"detect-libc": {
"version": "1.0.3",
"bundled": true,
"dev": true,
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "2.2.4"
}
},
"fs.realpath": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"gauge": {
"version": "2.7.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"aproba": "1.2.0",
"console-control-strings": "1.1.0",
"has-unicode": "2.0.1",
"object-assign": "4.1.1",
"signal-exit": "3.0.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wide-align": "1.1.2"
}
},
"glob": {
"version": "7.1.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"has-unicode": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"iconv-lite": {
"version": "0.4.21",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safer-buffer": "2.1.2"
}
},
"ignore-walk": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimatch": "3.0.4"
}
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
},
"ini": {
"version": "1.3.5",
"bundled": true,
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
},
"isarray": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"dev": true,
"requires": {
"brace-expansion": "1.1.11"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "5.1.1",
"yallist": "3.0.2"
}
},
"minizlib": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "2.2.4"
}
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"needle": {
"version": "2.2.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"debug": "2.6.9",
"iconv-lite": "0.4.21",
"sax": "1.2.4"
}
},
"node-pre-gyp": {
"version": "0.10.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"detect-libc": "1.0.3",
"mkdirp": "0.5.1",
"needle": "2.2.0",
"nopt": "4.0.1",
"npm-packlist": "1.1.10",
"npmlog": "4.1.2",
"rc": "1.2.7",
"rimraf": "2.6.2",
"semver": "5.5.0",
"tar": "4.4.1"
}
},
"nopt": {
"version": "4.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"abbrev": "1.1.1",
"osenv": "0.1.5"
}
},
"npm-bundled": {
"version": "1.0.3",
"bundled": true,
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.1.10",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ignore-walk": "3.0.1",
"npm-bundled": "1.0.3"
}
},
"npmlog": {
"version": "4.1.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"are-we-there-yet": "1.1.4",
"console-control-strings": "1.1.0",
"gauge": "2.7.4",
"set-blocking": "2.0.0"
}
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
},
"object-assign": {
"version": "4.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"dev": true,
"requires": {
"wrappy": "1.0.2"
}
},
"os-homedir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"osenv": {
"version": "0.1.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"os-homedir": "1.0.2",
"os-tmpdir": "1.0.2"
}
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"rc": {
"version": "1.2.7",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"deep-extend": "0.5.1",
"ini": "1.3.5",
"minimist": "1.2.0",
"strip-json-comments": "2.0.1"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"readable-stream": {
"version": "2.3.6",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.1",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"rimraf": {
"version": "2.6.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"glob": "7.1.2"
}
},
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
"bundled": true,
"dev": true,
"optional": true
},
"sax": {
"version": "1.2.4",
"bundled": true,
"dev": true,
"optional": true
},
"semver": {
"version": "5.5.0",
"bundled": true,
"dev": true,
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"string-width": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
},
"strip-json-comments": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"tar": {
"version": "4.4.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"chownr": "1.0.1",
"fs-minipass": "1.2.5",
"minipass": "2.2.4",
"minizlib": "1.1.0",
"mkdirp": "0.5.1",
"safe-buffer": "5.1.1",
"yallist": "3.0.2"
}
},
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"wide-align": {
"version": "1.1.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"string-width": "1.0.2"
}
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
}
}
},
"fstream": { "fstream": {
"version": "1.0.11", "version": "1.0.11",
"resolved": "http://registry.npm.taobao.org/fstream/download/fstream-1.0.11.tgz", "resolved": "http://registry.npm.taobao.org/fstream/download/fstream-1.0.11.tgz",
@@ -5755,7 +5224,6 @@
"requires": { "requires": {
"anymatch": "1.3.2", "anymatch": "1.3.2",
"async-each": "1.0.1", "async-each": "1.0.1",
"fsevents": "1.2.4",
"glob-parent": "2.0.0", "glob-parent": "2.0.0",
"inherits": "2.0.3", "inherits": "2.0.3",
"is-binary-path": "1.0.1", "is-binary-path": "1.0.1",
@@ -10580,6 +10048,14 @@
"version": "0.8.26", "version": "0.8.26",
"resolved": "http://registry.npm.taobao.org/zone.js/download/zone.js-0.8.26.tgz", "resolved": "http://registry.npm.taobao.org/zone.js/download/zone.js-0.8.26.tgz",
"integrity": "sha1-e91y92aMWnrWsRgUi06jnFnQjS0=" "integrity": "sha1-e91y92aMWnrWsRgUi06jnFnQjS0="
},
"ztree": {
"version": "3.5.24",
"resolved": "http://registry.npm.taobao.org/ztree/download/ztree-3.5.24.tgz",
"integrity": "sha1-tj/lKYH98sMpZ1z9J3Lw0UdSH/E=",
"requires": {
"jquery": "3.3.1"
}
} }
} }
} }
+12 -1
View File
@@ -1,4 +1,3 @@
{ {
"/sysapi":{ "/sysapi":{
@@ -6,5 +5,17 @@
"secure": false, "secure": false,
"changeOrigin": true, "changeOrigin": true,
"ws": true "ws": true
},
"/login":{
"target": "http://130.120.3.231:91",
"secure": false,
"changeOrigin": true,
"ws": true
},
"/adminapi":{
"target": "http://130.120.3.231:91",
"secure": false,
"changeOrigin": true,
"ws": true
} }
} }
+2 -2
View File
@@ -9,8 +9,8 @@
<div class="card-body"> <div class="card-body">
<form #loginFormSub="ngForm" [formGroup]="loginForm" (ngSubmit)="loginForm.valid&&_submit()"> <form #loginFormSub="ngForm" [formGroup]="loginForm" (ngSubmit)="loginForm.valid&&_submit()">
<div class="form-group mt-3 mb-4"> <div class="form-group mt-3 mb-4">
<input formControlName="userName" class="form-control" type="text" placeholder="请输入用户名..."> <input formControlName="username" class="form-control" type="text" placeholder="请输入用户名...">
<div class="validator" [hidden]="!(loginForm.controls['userName'].errors && loginForm.controls['userName'].dirty) && !(loginFormSub.submitted && loginForm.controls['userName'].errors)"> <div class="validator" [hidden]="!(loginForm.controls['username'].errors && loginForm.controls['username'].dirty) && !(loginFormSub.submitted && loginForm.controls['username'].errors)">
请输入用户名,6-15位 请输入用户名,6-15位
</div> </div>
</div> </div>
+12 -2
View File
@@ -6,6 +6,8 @@ import { Router, ActivatedRoute } from '@angular/router'
import { ToastService } from '../components/toast/toast.service'; import { ToastService } from '../components/toast/toast.service';
import { ToastConfig, ToastType } from '../components/toast/toast-model'; import { ToastConfig, ToastType } from '../components/toast/toast-model';
import { HttpClientService } from '../services/http-client.service';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
@@ -17,18 +19,26 @@ export class LoginComponent implements OnInit {
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private httpClient:HttpClientService,
private toastService: ToastService, private toastService: ToastService,
) { } ) { }
loginForm: FormGroup = this.formBuilder.group({ loginForm: FormGroup = this.formBuilder.group({
'userName': ['gzznadmin', [Validators.required, Validators.minLength(6), Validators.maxLength(15)]], 'username': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]],
'password': ['gzznadmin', [Validators.required, Validators.minLength(6), Validators.maxLength(15)]] 'password': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]]
}) })
ngOnInit() { ngOnInit() {
} }
_submit() { _submit() {
// this.httpClient.post('/login',this.loginForm.value).subscribe(
// data=>{
// console.log(data)
// }
// )
let date = new Date() let date = new Date()
// date.setTime(date.getTime() + 10 * 60 * 1000) // date.setTime(date.getTime() + 10 * 60 * 1000)
//为了测试方便,把用户登录缓存时间加长 //为了测试方便,把用户登录缓存时间加长
+87 -23
View File
@@ -1,48 +1,112 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClientService } from '../services/http-client.service'; import { HttpClientService } from '../services/http-client.service';
import { Subject } from 'rxjs' import { Subject, forkJoin, zip } from 'rxjs'
@Injectable() @Injectable()
export class BasicDataService{ export class BasicDataService {
public checkin_group; public checkin_group: Array<any>;
public checkin_group_subject = new Subject<any>(); public checkin_group_subject = new Subject<any>();
public gate; public gate: Array<any>;
public gate_subject = new Subject<any>(); public gate_subject = new Subject<any>();
public terminal; public terminal: Array<any>;
public terminal_subject = new Subject<any>(); public terminal_subject = new Subject<any>();
public chut; public chut: Array<any>;
public chut_subject = new Subject<any>(); public chut_subject = new Subject<any>();
public stand; public stand: Array<any>;
public stand_subject = new Subject<any>(); public stand_subject = new Subject<any>();
public carousel; public carousel: Array<any>;
public carousel_subject = new Subject<any>(); public carousel_subject = new Subject<any>();
public checkin_desk; public checkin_desk: Array<any>;
public checkin_desk_subject = new Subject<any>(); public checkin_desk_subject = new Subject<any>();
public airport; public airport: Array<any>;
public airport_subject = new Subject<any>(); public airport_subject = new Subject<any>();
public city; public city: Array<any>;
public city_subject = new Subject<any>(); public city_subject = new Subject<any>();
public aircraft_type; public aircraft_type: Array<any>;
public aircraft_type_subject = new Subject<any>(); public aircraft_type_subject = new Subject<any>();
public aircraft; public aircraft: Array<any>;
public aircraft_subject = new Subject<any>(); public aircraft_subject = new Subject<any>();
public terminal_area; public terminal_area: Array<any>;
public terminal_area_subject = new Subject<any>(); public terminal_area_subject = new Subject<any>();
public airline; public airline: Array<any>;
public airline_subject = new Subject<any>(); public airline_subject = new Subject<any>();
constructor( constructor(
private httpClient:HttpClientService private httpClient: HttpClientService
){} ) { }
loadBasicData(){ loadBasicData() {
console.log('---') console.log('---')
this.httpClient.get('/adminapi/basicdata/checkinGroups').subscribe( let checkinGroupHttp = this.httpClient.get('/adminapi/basicdata/checkinGroups');
data=>{ let gateHttp = this.httpClient.get('/adminapi/basicdata/ormsGates');
console.log(data) let terminalHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminals');
let chutHttp = this.httpClient.get('/adminapi/basicdata/ormsChuts');
let standHttp = this.httpClient.get('/adminapi/basicdata/ormsStands');
let carouselHttp = this.httpClient.get('/adminapi/basicdata/ormsCarousels');
let checkinDeskHttp = this.httpClient.get('/adminapi/basicdata/ormsCheckindesks');
let airportHttp = this.httpClient.get('/adminapi/basicdata/sysAirports');
let cityHttp = this.httpClient.get('/adminapi/basicdata/sysCitys');
let aircraftTypeHttp = this.httpClient.get('/adminapi/basicdata/sysAircrafttypes');
let aircraftHttp = this.httpClient.get('/adminapi/basicdata/sysAircrafts');
let terminalAreaHttp = this.httpClient.get('/adminapi/basicdata/ormsTerminalareas');
let airlineHttp = this.httpClient.get('/adminapi/basicdata/sysAirlines');
zip(
checkinGroupHttp,
gateHttp,
terminalHttp,
chutHttp,
standHttp,
carouselHttp,
checkinDeskHttp,
airportHttp,
cityHttp,
aircraftTypeHttp,
aircraftHttp,
terminalAreaHttp,
airlineHttp
).subscribe(
([
checkinGroupRes,
gateRes,
terminalRes,
chutRes,
standRes,
carouselRes,
checkinDeskRes,
airportRes,
cityRes,
aircraftTypeRes,
aircraftRes,
terminalAreaRes,
airlineRes
]) => {
this.checkin_group = checkinGroupRes.body;
this.checkin_group_subject.next(checkinGroupRes.body);
this.gate = gateRes.body;
this.gate_subject.next(gateRes.body);
this.terminal = terminalRes.body;
this.terminal_area_subject.next(terminalRes.body);
this.chut = chutRes.body;
this.chut_subject.next(chutRes.body);
this.stand = standRes.body;
this.stand_subject.next(standRes.body);
this.carousel = carouselRes.body;
this.carousel_subject.next(carouselRes.body);
this.checkin_desk = checkinDeskRes.body;
this.checkin_desk_subject.next(checkinDeskRes.body);
this.airport = airportRes.body;
this.airport_subject.next(airportRes.body);
this.city = cityRes.body;
this.city_subject.next(cityRes.body);
this.aircraft_type = aircraftTypeRes.body;
this.aircraft_type_subject.next(aircraftTypeRes.body);
this.aircraft = aircraftRes.body;
this.aircraft_subject.next(aircraftRes.body);
this.terminal_area = terminalAreaRes.body;
this.terminal_area_subject.next(terminalAreaRes.body);
this.airline = airlineRes.body;
this.airline_subject.next(airlineRes.body);
} }
) )
} }
} }
+142 -95
View File
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core'; import { ChangeDetectorRef } from '@angular/core';
import { HttpClientService } from '../../services/http-client.service'; import { HttpClientService } from '../../services/http-client.service';
import {BasicDataService} from '../basic-data-service' import { BasicDataService } from '../basic-data-service'
import dateFormatter from '../../utils/data-formatter'; import dateFormatter from '../../utils/data-formatter';
import routeType from '../../utils/route-type'; import routeType from '../../utils/route-type';
@@ -19,64 +19,34 @@ import * as $ from 'jquery';
export class MainComponent implements OnInit { export class MainComponent implements OnInit {
constructor( constructor(
private basicDataService: BasicDataService,
private basicDataService:BasicDataService,
private httpCilent: HttpClientService, private httpCilent: HttpClientService,
private changeDetectorRef: ChangeDetectorRef 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 raw_data: Array<object> = []; //原始数据,即航班计划
public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据 public combined_data: Array<object> = []; //组合数据,即链接航班,显示信息等组合好之后的数据
// public filter_data:Array<object> = []; //用于过滤和定位的数据
public render_data: Array<object> = []; //显示数据,即需要显示的数据 public render_data: Array<object> = []; //显示数据,即需要显示的数据
public col_lists: Array<object>; //列数据 public col_lists: Array<object>; //列数据
public airline_color: Array<object> = []; public airline_color: Array<object> = [];
public row_state: any = { renderFlight: {} }; 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 = { public formatter = {
'MVIN': { 'MVIN': {
'A': '到达', 'A': '到达',
@@ -95,20 +65,6 @@ export class MainComponent implements OnInit {
'ACTT': 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.changeDetectorRef.detach();
/* 获取显示列 */ /* 获取显示列 */
@@ -206,11 +162,69 @@ export class MainComponent implements OnInit {
* 固定表头 * 固定表头
*/ */
var tableCont = document.querySelector('#table-container') var tableCont = document.querySelector('#table-container')
function scrollHandle (){ function scrollHandle() {
var scrollTop = this.scrollTop; var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)'; 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 * @param filterItems
* @return * @return
*/ */
//输入框回车事 SEARCH = ''; //手动输入条
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
public filterItems = {
ALCD: '', //航空公司
FLIN: '', //航线类别
FLTY: '', //航班类别
MVIN: '', //到达/出发
TRML: '', //航站楼
FHAG: '', //机坪代理
MHAG: '', //维护代理
PHAG: '', //旅客代理
}
/**
* 输入框回车事件
*/
inputEnter() { inputEnter() {
if (this.FLT_POS === 1) { if (this.FLT_POS === 1) {
this.selectChange() this.selectChange()
@@ -247,7 +277,9 @@ export class MainComponent implements OnInit {
} }
} }
//下拉框选择筛选 /**
* 下拉框选择筛选
*/
selectChange() { selectChange() {
let filter_data = []; let filter_data = [];
let filterItems = this.filterItems; let filterItems = this.filterItems;
@@ -336,7 +368,11 @@ export class MainComponent implements OnInit {
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
} }
} }
//输入框筛选
/**
* 输入框筛选
* @param filterData
*/
inputFilter(filterData) { inputFilter(filterData) {
if (this.SEARCH) { if (this.SEARCH) {
if (this.SEL_COL) { if (this.SEL_COL) {
@@ -390,9 +426,12 @@ export class MainComponent implements OnInit {
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
} }
/**
* 输入框定位
*/
positionArray: Array<any> = []; positionArray: Array<any> = [];
positionArrayIndex: number = 0; positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) { inputPosition(filterData) {
let transArray = [] let transArray = []
if (this.SEL_COL) { if (this.SEL_COL) {
@@ -463,33 +502,20 @@ export class MainComponent implements OnInit {
* @param flight * @param flight
* @return * @return
*/ */
public TOP_1 = 1000000000000;
/** (0)000000+实际时间(到达航班有实际时间,且未超过1小时) public TOP_2 = 2000000000000;
(0-1)无链接航班,取实际(到达)时间 public TOP_3 = 3000000000000;
(0-2)有链接航班,且出发航班未有实际时间,取实际(到达)时间 public TOP_4 = 4000000000000;
(1)100000+商调完成时间(商调完成登机未开始) public TOP_5 = 5000000000000;
(2)110000+登机开始时间(登机开始尚未登机结束) public TOP_6 = 6000000000000;
(3)111000+登机结束时间(登机结束) public TOP_7 = 7000000000000;
(4)111100+计划/预计时间(无商调完成时间、登机开始时间、登机结束时间、航班实际完成时间) public TOP_8 = 8000000000000;
(4-1)无链接航班 public TOP_9 = 9000000000000;
(4-1-1)若有预计时间则取预计时间 public TOP_10 = 10000000000000;
(4-1-2)若无预计时间则取计划时间 public TOP_11 = 11000000000000;
(4-2)有链接航班 public TOP_12 = 12000000000000;
(4-2-1)若无实际到达时间,则 public TOP_13 = 13000000000000;
(4-2-1-1)若有预计到达时间则取预计到达时间 public TOP_14 = 14000000000000;
(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 sequence(flight) { public sequence(flight) {
let dateTag: number = 10; 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
}
}
} }
+2 -2
View File
@@ -6,7 +6,7 @@ import { NgZorroAntdModule } from 'ng-zorro-antd'
import { PipesModule } from '../../pipes/pipes.module'; import { PipesModule } from '../../pipes/pipes.module';
import { MainComponent } from './main.component'; import { MainComponent } from './main.component';
import { MainRoutingModule } from './main-routing.module' import { MainRoutingModule } from './main-routing.module'
import {BasicDataService} from '../basic-data-service' // import {BasicDataService} from '../basic-data-service'
@NgModule({ @NgModule({
imports: [ imports: [
@@ -18,6 +18,6 @@ import {BasicDataService} from '../basic-data-service'
MainRoutingModule MainRoutingModule
], ],
declarations: [MainComponent], declarations: [MainComponent],
providers:[BasicDataService] providers:[]
}) })
export class MainModule { } export class MainModule { }
-1
View File
@@ -4,7 +4,6 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>广州智能科技发展有限公司</title> <title>广州智能科技发展有限公司</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">