diff --git a/proxy.conf.json b/proxy.conf.json index d3fdba5..d0da7b1 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -12,6 +12,12 @@ "changeOrigin": true, "ws": true }, + "/logout":{ + "target": "http://130.120.3.231:91", + "secure": false, + "changeOrigin": true, + "ws": true + }, "/adminapi":{ "target": "http://130.120.3.231:91", "secure": false, diff --git a/src/app/pages/main/main.component.html b/src/app/pages/main/main.component.html index d477413..0d7636b 100644 --- a/src/app/pages/main/main.component.html +++ b/src/app/pages/main/main.component.html @@ -19,8 +19,8 @@
- + --> +
@@ -28,7 +28,7 @@
- @@ -54,11 +54,11 @@
+ + +
-->
+
@@ -114,29 +115,29 @@
-
+
@@ -151,25 +152,27 @@ -
{{i+1}} {{isLast}} {{airline_row['renderFlight'][airline_col.COL_CODE]}}
-
+
- + - + - + - + + + +
diff --git a/src/app/pages/main/main.component.scss b/src/app/pages/main/main.component.scss index b399af6..bdd34ad 100644 --- a/src/app/pages/main/main.component.scss +++ b/src/app/pages/main/main.component.scss @@ -1,7 +1,7 @@ .main-page { width: 100%; height: 100%; - overflow-y: scroll; + overflow-y: auto; padding: 15px 10px; background-color: #fff; .page-content { @@ -31,7 +31,7 @@ .table-container{ display: inline-block; // border: 1px solid #ccc; - width: 75%; + width: 100%; height: 700px; overflow: auto; box-shadow: 0 0 1px .5px #ddd; @@ -56,7 +56,7 @@ display: inline-block; // box-shadow: 0 0 1px .5px #ddd; vertical-align: top; - width: 24%; + width: 0; margin-left: 1%; height: 700px; /deep/ .ant-tabs-bar{ @@ -72,6 +72,19 @@ } } } + .table-c{ + width: 75%; + } + .table-o{ + width: 100%; + } + .tab-c{ + width: 0; + display: none; + } + .tab-o{ + width: 24%; + } } } } diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index b58528c..a60ac63 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -49,9 +49,12 @@ export class MainComponent implements OnInit { private toastService: ToastService, ) { console.log(new Date().getTime()) - } + } + public tabClose: boolean = true; + public isSpinning:boolean = true; //各项基础数据 + public terminals: Array; public flightStatus: Array; public airports: Array; public citys: Array;; @@ -65,6 +68,16 @@ export class MainComponent implements OnInit { public airline_color: Array = []; public row_state: any = { renderFlight: {} }; + + + public checkboxGroup = { + 'related': false, + 'detail': false, + 'vip': false, + 'special': false, + 'guarantee': false + } + public formatter = { 'GCTM': gctmFormatter, 'BOTM': botmFormatter, @@ -207,6 +220,7 @@ export class MainComponent implements OnInit { }) //从基础数据服务中拿出部分基础数据 + this.terminals = this.basicDataService.terminal; this.flightStatus = this.basicDataService.flightStatus; this.airlines = this.basicDataService.airline; this.citys = this.basicDataService.city; @@ -224,6 +238,9 @@ export class MainComponent implements OnInit { this.doSequence(this.combined_data); } }, 5000); + this.basicDataService.terminal_subject.subscribe( + val => this.terminals = val + ) this.basicDataService.flightStatus_subject.subscribe( val => this.flightStatus = val ); @@ -255,13 +272,9 @@ export class MainComponent implements OnInit { tableCont.addEventListener('scroll', scrollHandle) } - getLast(isLast){ - if(isLast){ - console.log('666666'); - } - } - - + /** + * 基础数据转换 + */ basicDataTransHandle() { this.combined_data.forEach(item => { if (this.isArriFlight(item) || this.isDeptFlight(item)) { @@ -284,7 +297,9 @@ export class MainComponent implements OnInit { let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - '); let erutLinkChnArray = [] for (let i = 0; i < erutLinkCodeArray.length; i++) { + console.log(erutLinkCodeArray[i]); let airportIndex = this.airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]); + console.log(airportIndex); let cityIndex = this.citys.findIndex(val => this.airports[airportIndex].cityId === val.cityId); erutLinkChnArray.push(this.citys[cityIndex].cityNameChn); } @@ -349,16 +364,47 @@ export class MainComponent implements OnInit { this.render_data = sequenceData; this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; - console.log(new Date().getTime() +'---'); + console.log(new Date().getTime() + '---'); this.changeDetectorRef.detectChanges(); - console.log(new Date().getTime() +'---'); - + console.log(new Date().getTime() + '---'); + } - nzClick(){ + /** + * 复选框勾选事件 + */ + checkboxChange() { + for (const key in this.checkboxGroup) { + if (this.checkboxGroup.hasOwnProperty(key)) { + if (this.checkboxGroup[key]) { + this.tabClose = false; + break; + } else { + this.tabClose = true; + continue; + } + } + } + this.changeDetectorRef.detectChanges() + } + + /** + * tab项切换事件 + */ + nzClick() { this.changeDetectorRef.detectChanges(); } + /** + * 刷新 + */ + refresh() { + this.render_data.reverse(); + console.log('====='); + this.changeDetectorRef.detectChanges(); + console.log('-----'); + } + /** * 过滤及定位 @@ -373,6 +419,7 @@ export class MainComponent implements OnInit { FLIN: '', //航线类别 FLTY: '', //航班类别 MVIN: '', //到达/出发 + FTSS: '', TRML: '', //航站楼 FHAG: '', //机坪代理 MHAG: '', //维护代理 @@ -395,7 +442,6 @@ export class MainComponent implements OnInit { * 下拉框选择筛选 */ selectChange() { - console.log(new Date().getTime() + '-----'); let filter_data = []; let filterItems = this.filterItems; this.combined_data.forEach(item => { @@ -538,7 +584,6 @@ export class MainComponent implements OnInit { this.render_data = filterData; this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; this.changeDetectorRef.detectChanges(); - console.log(new Date().getTime() + '====='); } /** diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html index 2297d57..4493344 100644 --- a/src/app/pages/pages.component.html +++ b/src/app/pages/pages.component.html @@ -4,13 +4,26 @@ 航班信息查询系统 - - + + + - +
-
+
-
+
-
\ No newline at end of file diff --git a/src/app/pages/pages.component.scss b/src/app/pages/pages.component.scss index a84adf0..9a92bbc 100644 --- a/src/app/pages/pages.component.scss +++ b/src/app/pages/pages.component.scss @@ -15,14 +15,26 @@ color: rgba(255, 255, 255, 1); cursor: pointer; } + .navbar-nav{ + background-color: rgb(38,51,68); + padding: 0 10px; + border-radius: 20px; + } // .bg-dark{ // } + .nav-link{ + display: flex; + align-items: center; + label{ + margin: 0; + } + } .nav-icon { - padding: 0.1rem 0.75rem; + // padding: 0.1rem 0.75rem; cursor: pointer; display: block; - font-size: 1.5rem; + // font-size: 1.5rem; transition: color 0.1s ease-in-out, color 0.1s ease-in-out; &:hover { color: $color-primary; @@ -39,9 +51,9 @@ box-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.05); border-radius: 50%; display: block; - height: 18px; - width: 18px; - padding: 1px; + height: 14px; + width: 14px; + line-height: 14px; position: absolute; top: -4px; right: -8px; @@ -77,7 +89,7 @@ left: 0; background-color: rgb(46, 59, 76); padding-bottom: 30px; - overflow-y: scroll; + overflow-y: auto; .left-header { height: 66px; border-bottom: 1px solid $gray-900; @@ -101,5 +113,18 @@ height: calc(100% - 66px); margin-left: 235px; } + .left-wrapper-o { + width: 235px; + } + .left-wrapper-c { + width: 0px; + display: none; + } + .right-wrapper-o { + margin-left: 235px; + } + .right-wrapper-c { + margin-left: 0px; + } } } diff --git a/src/app/pages/pages.component.ts b/src/app/pages/pages.component.ts index 8b63f4e..2757b7b 100644 --- a/src/app/pages/pages.component.ts +++ b/src/app/pages/pages.component.ts @@ -1,9 +1,12 @@ import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; -import { BasicDataService } from './basic-data-service' +import { BasicDataService } from './basic-data-service'; +import { HttpClientService } from '../services/http-client.service'; -import { map, filter, mergeMap } from 'rxjs/operators'; -import { pipe } from 'rxjs' +import { ToastService } from '../components/toast/toast.service'; +import { ToastConfig, ToastType } from '../components/toast/toast-model'; + +import { filter } from 'rxjs/operators'; // import 'rxjs/add/operator/map'; // import 'rxjs/add/operator/mergeMap'; @@ -13,7 +16,7 @@ import { pipe } from 'rxjs' styleUrls: ['./pages.component.scss'] }) export class PagesComponent implements OnInit { - + public menuClose: boolean = false; menuData = [ { "name": "航班动态", @@ -185,9 +188,10 @@ export class PagesComponent implements OnInit { }] constructor( private router: Router, - private basicDataService:BasicDataService, - private activatedRoute: ActivatedRoute - ) { + private basicDataService: BasicDataService, + private httpClient: HttpClientService, + private toastService: ToastService, + ) { this.basicDataService.loadBasicData(); } @@ -203,6 +207,10 @@ export class PagesComponent implements OnInit { } + toggleMenu() { + this.menuClose = !this.menuClose; + } + /** * 判断是否有子节点 * @param item @@ -225,4 +233,14 @@ export class PagesComponent implements OnInit { }) } + confirmLogout() { + this.httpClient.post('/logout').subscribe( + data => { + const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '退出系统成功!', 3000); + this.toastService.toast(toastCfg); + this.router.navigate(['/login']); + } + ) + } + } diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index 4ddb755..e929922 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -1,16 +1,21 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { PagesComponent } from './pages.component'; -import { PagesRoutingModule } from './pages-routing.module' +import { NgZorroAntdModule } from 'ng-zorro-antd'; -import { ComponentsModule } from '../components/components.module' +import { PagesComponent } from './pages.component'; +import { PagesRoutingModule } from './pages-routing.module'; + +import { SidebarMenuModule } from '../components/sidebar-menu/sidebar-menu.module'; +import { BarMenuModule } from '../components/bar-menu/bar-menu.module'; import { BasicDataService } from './basic-data-service' @NgModule({ imports: [ CommonModule, - ComponentsModule, + NgZorroAntdModule, + SidebarMenuModule, + BarMenuModule, PagesRoutingModule, ], declarations: [PagesComponent], diff --git a/src/app/services/http-client.service.ts b/src/app/services/http-client.service.ts index effe946..03062a1 100644 --- a/src/app/services/http-client.service.ts +++ b/src/app/services/http-client.service.ts @@ -51,9 +51,9 @@ export class HttpClientService { paramsString.push([key, params[key]].join('=')) } } - return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options = {})); + return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options)); } else { - return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {})); + return this.commonProcess(this.httpClient.get(url + 't=' + t, options)); } } @@ -80,7 +80,7 @@ export class HttpClientService { * @param url * @param options */ - patch(url: string, body, options?): Observable { + patch(url: string, body?, options?): Observable { return this.commonProcess(this.httpClient.patch(url, body, options)); } @@ -91,7 +91,7 @@ export class HttpClientService { * @param body * @param options */ - post(url: string, body, options?): Observable { + post(url: string, body?, options?): Observable { return this.commonProcess(this.httpClient.post(url, body, options)); } @@ -100,7 +100,7 @@ export class HttpClientService { * @param url * @param options */ - put(url: string, body, options?): Observable { + put(url: string, body?, options?): Observable { return this.commonProcess(this.httpClient.put(url, body, options)); } diff --git a/src/polyfills.ts b/src/polyfills.ts index d310405..0f92b27 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -19,20 +19,20 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`.