From 526cfe12514ad108542b69330eec59c4570ecc8e Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Mon, 19 Nov 2018 09:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=8A=A0=E8=BD=BD=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 540 +-------------------------- proxy.conf.json | 13 +- src/app/login/login.component.html | 4 +- src/app/login/login.component.ts | 14 +- src/app/pages/basic-data-service.ts | 110 ++++-- src/app/pages/main/main.component.ts | 241 +++++++----- src/app/pages/main/main.module.ts | 4 +- src/index.html | 1 - 8 files changed, 267 insertions(+), 660 deletions(-) diff --git a/package-lock.json b/package-lock.json index dababff..c437d0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -249,7 +249,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.2.4", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1760,7 +1759,6 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.2", - "fsevents": "1.2.4", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -3621,535 +3619,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "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": { "version": "1.0.11", "resolved": "http://registry.npm.taobao.org/fstream/download/fstream-1.0.11.tgz", @@ -5755,7 +5224,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.2.4", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -10580,6 +10048,14 @@ "version": "0.8.26", "resolved": "http://registry.npm.taobao.org/zone.js/download/zone.js-0.8.26.tgz", "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" + } } } } diff --git a/proxy.conf.json b/proxy.conf.json index c7c8e59..d3fdba5 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -1,4 +1,3 @@ - { "/sysapi":{ @@ -6,5 +5,17 @@ "secure": false, "changeOrigin": 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 } } \ No newline at end of file diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index 1eb9de9..10a1708 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -9,8 +9,8 @@
- -
+ +
请输入用户名,6-15位
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 2aa2333..3a7efa8 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -6,6 +6,8 @@ import { Router, ActivatedRoute } from '@angular/router' import { ToastService } from '../components/toast/toast.service'; import { ToastConfig, ToastType } from '../components/toast/toast-model'; +import { HttpClientService } from '../services/http-client.service'; + @Component({ selector: 'app-login', templateUrl: './login.component.html', @@ -17,18 +19,26 @@ export class LoginComponent implements OnInit { private formBuilder: FormBuilder, private router: Router, private route: ActivatedRoute, + private httpClient:HttpClientService, private toastService: ToastService, ) { } loginForm: FormGroup = this.formBuilder.group({ - 'userName': ['gzznadmin', [Validators.required, Validators.minLength(6), Validators.maxLength(15)]], - 'password': ['gzznadmin', [Validators.required, Validators.minLength(6), Validators.maxLength(15)]] + 'username': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]], + 'password': ['admin', [Validators.required, Validators.minLength(5), Validators.maxLength(15)]] }) ngOnInit() { } _submit() { + // this.httpClient.post('/login',this.loginForm.value).subscribe( + // data=>{ + // console.log(data) + // } + // ) + + let date = new Date() // date.setTime(date.getTime() + 10 * 60 * 1000) //为了测试方便,把用户登录缓存时间加长 diff --git a/src/app/pages/basic-data-service.ts b/src/app/pages/basic-data-service.ts index ca0ac9f..9b9a0bd 100644 --- a/src/app/pages/basic-data-service.ts +++ b/src/app/pages/basic-data-service.ts @@ -1,48 +1,112 @@ import { Injectable } from '@angular/core'; import { HttpClientService } from '../services/http-client.service'; -import { Subject } from 'rxjs' +import { Subject, forkJoin, zip } from 'rxjs' @Injectable() -export class BasicDataService{ - public checkin_group; +export class BasicDataService { + public checkin_group: Array; public checkin_group_subject = new Subject(); - public gate; + public gate: Array; public gate_subject = new Subject(); - public terminal; + public terminal: Array; public terminal_subject = new Subject(); - public chut; + public chut: Array; public chut_subject = new Subject(); - public stand; + public stand: Array; public stand_subject = new Subject(); - public carousel; + public carousel: Array; public carousel_subject = new Subject(); - public checkin_desk; + public checkin_desk: Array; public checkin_desk_subject = new Subject(); - public airport; + public airport: Array; public airport_subject = new Subject(); - public city; + public city: Array; public city_subject = new Subject(); - public aircraft_type; + public aircraft_type: Array; public aircraft_type_subject = new Subject(); - public aircraft; + public aircraft: Array; public aircraft_subject = new Subject(); - public terminal_area; + public terminal_area: Array; public terminal_area_subject = new Subject(); - public airline; + public airline: Array; public airline_subject = new Subject(); constructor( - private httpClient:HttpClientService - ){} + private httpClient: HttpClientService + ) { } - loadBasicData(){ + loadBasicData() { console.log('---') - this.httpClient.get('/adminapi/basicdata/checkinGroups').subscribe( - data=>{ - console.log(data) + let checkinGroupHttp = this.httpClient.get('/adminapi/basicdata/checkinGroups'); + let gateHttp = this.httpClient.get('/adminapi/basicdata/ormsGates'); + 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); } ) } - - } \ No newline at end of file diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index bd2a7ac..2107d14 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -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; + public gate: Array; + public terminal: Array; + public chut: Array; + public stand: Array; + public carousel: Array; + public checkin_desk: Array; + public airport: Array; + public city: Array; + public aircraft_type: Array; + public aircraft: Array; + public terminal_area: Array; + public airline: Array; public raw_data: Array = []; //原始数据,即航班计划 - public combined_data: Array = []; //组合数据,即链接航班,显示信息等组合好之后的数据 - - // public filter_data:Array = []; //用于过滤和定位的数据 - public render_data: Array = []; //显示数据,即需要显示的数据 - - public col_lists: Array; //列数据 public airline_color: Array = []; 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 = []; 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 + } + } + } \ No newline at end of file diff --git a/src/app/pages/main/main.module.ts b/src/app/pages/main/main.module.ts index 8e20994..ca33e84 100644 --- a/src/app/pages/main/main.module.ts +++ b/src/app/pages/main/main.module.ts @@ -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 { } diff --git a/src/index.html b/src/index.html index 8f6dcef..173559a 100644 --- a/src/index.html +++ b/src/index.html @@ -4,7 +4,6 @@ 广州智能科技发展有限公司 -