From 7f7bb13847c409550dc20b004239086348760487 Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Wed, 23 Jan 2019 10:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=8A=B6=E6=80=81=E7=AD=89?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=8F=90=E7=A4=BA=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.ts | 1 - src/app/app.module.ts | 3 --- src/app/login/login.component.ts | 12 ++++-------- .../pages/main/detail-tab/detail-tab.component.scss | 5 ----- src/app/pages/main/main.component.html | 3 ++- src/app/pages/main/main.component.ts | 2 -- src/app/pages/main/main.module.ts | 7 +++++-- src/app/pages/pages-routing.module.ts | 1 + src/app/pages/pages.component.ts | 9 +++------ src/app/services/http-client.service.ts | 8 +++----- 10 files changed, 18 insertions(+), 33 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 09d2485..f09d775 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -4,7 +4,6 @@ import { Component } from '@angular/core'; selector: 'app-root', template: ` - `, }) export class AppComponent { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 177a53f..40fd78f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -14,8 +14,6 @@ import { AppComponent } from './app.component'; import { HttpService } from './services/http.service' import { HttpClientService } from './services/http-client.service' -/* 消息提示 */ -import { ToastModule } from './components/toast/toast.module' /* 预加载策略 */ import { SelectivePreloadingStrategy } from './preloading-strategy'; @@ -40,7 +38,6 @@ import { OperateSpinServiceService } from './services/operate-spin-service.servi BrowserAnimationsModule, CommonModule, HttpClientModule, - ToastModule, NgZorroAntdModule, AppRoutingModule ], diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 0d6c4a5..e9532da 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -2,9 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms' import { Router, ActivatedRoute } from '@angular/router' - -import { ToastService } from '../components/toast/toast.service'; -import { ToastConfig, ToastType } from '../components/toast/toast-model'; +import { NzMessageService } from 'ng-zorro-antd'; import { HttpClientService } from '../services/http-client.service'; import { HttpHeaders } from '@angular/common/http'; @@ -21,7 +19,7 @@ export class LoginComponent implements OnInit { private router: Router, private route: ActivatedRoute, private httpClient: HttpClientService, - private toastService: ToastService, + private message: NzMessageService ) { } loginForm: FormGroup = this.formBuilder.group({ @@ -41,15 +39,13 @@ export class LoginComponent implements OnInit { console.log(xhr); if (xhr.is_success) { sessionStorage.setItem('userInfo', JSON.stringify(xhr.body)); - const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '登录成功!', 3000); - this.toastService.toast(toastCfg); + this.message.success('登录成功!'); this.router.navigate(['../app/main'], { relativeTo: this.route }); } } ) } else { - const toastCfg = new ToastConfig(ToastType.ERROR, '', '登录失败!', 3000); - this.toastService.toast(toastCfg); + this.message.error('登录失败!'); } } ) diff --git a/src/app/pages/main/detail-tab/detail-tab.component.scss b/src/app/pages/main/detail-tab/detail-tab.component.scss index 0c929bc..b454e14 100644 --- a/src/app/pages/main/detail-tab/detail-tab.component.scss +++ b/src/app/pages/main/detail-tab/detail-tab.component.scss @@ -10,11 +10,6 @@ padding: 5px 10px 5px 20px; p{ margin: 0; - label{ - // width: 120px; - font-weight: bolder; - // text-align: right; - } } } } \ No newline at end of file diff --git a/src/app/pages/main/main.component.html b/src/app/pages/main/main.component.html index 46227a3..fb844f9 100644 --- a/src/app/pages/main/main.component.html +++ b/src/app/pages/main/main.component.html @@ -201,7 +201,7 @@ {{airline_row['renderFlight']['FLID']}} {{airline_row['renderFlight'][airline_col.COL_CODE]}} + [ngStyle]="getColor(airline_col.COL_CODE,airline_row,airline_col.COL_WIDTH)">{{airline_row['renderFlight'][airline_col.COL_CODE]}} @@ -228,4 +228,5 @@ + \ 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 e4137a0..14a20d6 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -413,8 +413,6 @@ export class MainComponent implements OnInit { }) this.combined_data = combined_data; this.doSequence(this.combined_data); - // const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '刷新成功!', 3000); - // this.toastService.toast(toastCfg); } ) } diff --git a/src/app/pages/main/main.module.ts b/src/app/pages/main/main.module.ts index ff8684e..fb41e21 100644 --- a/src/app/pages/main/main.module.ts +++ b/src/app/pages/main/main.module.ts @@ -1,7 +1,9 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NgZorroAntdModule } from 'ng-zorro-antd' +import { NgZorroAntdModule } from 'ng-zorro-antd'; +/* 消息提示 */ +import { ToastModule } from '../../components/toast/toast.module' import { MainComponent } from './main.component'; import { MainRoutingModule } from './main-routing.module'; @@ -17,7 +19,8 @@ import { SpecialTabComponent } from './special-tab/special-tab.component'; FormsModule, ReactiveFormsModule, NgZorroAntdModule, - MainRoutingModule + MainRoutingModule, + ToastModule ], declarations: [ MainComponent, diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index a5da6eb..e23edee 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -7,6 +7,7 @@ const pagesRoutes: Routes = [ { path: '', component: PagesComponent, + data: { preload: false, reuse: false }, children:[ { path:'', diff --git a/src/app/pages/pages.component.ts b/src/app/pages/pages.component.ts index 22dd0c2..2d38e60 100644 --- a/src/app/pages/pages.component.ts +++ b/src/app/pages/pages.component.ts @@ -3,9 +3,7 @@ import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { BasicDataService } from '../services/basic-data-service'; import { OperateSpinServiceService } from '../services/operate-spin-service.service'; import { HttpClientService } from '../services/http-client.service'; - -import { ToastService } from '../components/toast/toast.service'; -import { ToastConfig, ToastType } from '../components/toast/toast-model'; +import { NzMessageService } from 'ng-zorro-antd'; import { filter } from 'rxjs/operators'; // import 'rxjs/add/operator/map'; @@ -196,7 +194,7 @@ export class PagesComponent implements OnInit { private basicDataService: BasicDataService, private operateSpinService: OperateSpinServiceService, private httpClient: HttpClientService, - private toastService: ToastService, + private message: NzMessageService ) { this.operateSpinService.spinSubject.subscribe( val => this.isSpinning = val @@ -259,8 +257,7 @@ export class PagesComponent implements OnInit { sessionStorageMsg.forEach(element => { sessionStorage.removeItem(element) }) - const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '退出系统成功!', 3000); - this.toastService.toast(toastCfg); + this.message.success('退出系统成功!'); this.router.navigate(['/login']); } ) diff --git a/src/app/services/http-client.service.ts b/src/app/services/http-client.service.ts index 4319033..ed5fd35 100644 --- a/src/app/services/http-client.service.ts +++ b/src/app/services/http-client.service.ts @@ -3,8 +3,7 @@ import { Router } from '@angular/router'; import { HttpClient, HttpRequest, HttpHeaders, HttpParams } from '@angular/common/http'; import { HttpObserve } from '@angular/common/http/src/client'; import { OperateSpinServiceService } from './operate-spin-service.service'; -import { ToastService } from '../components/toast/toast.service'; -import { ToastConfig, ToastType } from '../components/toast/toast-model'; +import { NzMessageService } from 'ng-zorro-antd'; import { Observable } from 'rxjs'; @@ -18,7 +17,7 @@ export class HttpClientService { private router: Router, private httpClient: HttpClient, private operateSpinServiceService: OperateSpinServiceService, - private toastService: ToastService, + private message: NzMessageService ) { } header: HttpHeaders = new HttpHeaders().set('x-requested-with', 'XMLHttpRequest') @@ -136,8 +135,7 @@ export class HttpClientService { }; case 500: { this.operateSpinServiceService.hideSpin(); - const toastCfg = new ToastConfig(ToastType.ERROR, '', '数据请求失败!', 5000); - this.toastService.toast(toastCfg); + this.message.error('数据请求失败!') break; } }