From 9efee40ffd77ea4ab045c61e4bdd9eb58be82ec5 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Fri, 20 Apr 2018 16:15:49 +0800 Subject: [PATCH] test --- src/app/app.component.ts | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e8afd42..deb9587 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,10 @@ +import { element } from 'protractor'; import { LoginService } from '@business/services/http/login.service'; import { Component, HostBinding, OnInit } from '@angular/core'; -import { Router, NavigationEnd } from '@angular/router'; +import { Router, NavigationEnd, NavigationStart } from '@angular/router'; import { ThemesService, SettingsService, TitleService } from '@delon/theme'; -import { filter, map } from 'rxjs/operators'; - +import { filter } from 'rxjs/operators'; +import * as $ from 'jquery'; @Component({ selector: 'app-root', template: `<router-outlet></router-outlet>` @@ -19,16 +20,39 @@ private settings: SettingsService, private router: Router, private titleSrv: TitleService, - private loginService:LoginService) { + private loginService: LoginService) { } ngOnInit() { + this.router.events + .pipe(filter(evt => evt instanceof NavigationEnd)) + .subscribe(() => this.titleSrv.setTitle()); this.router.events.pipe( - filter(evt => evt instanceof NavigationEnd), - map(() => this.router.url) - ) - .subscribe(url => { - this.titleSrv.setTitleByUrl(url); - }); + filter(evt => evt instanceof NavigationStart) + ) + .subscribe(() => { + // ������������������������ + if ($('.ant-modal-close').length > 0) { + $('.ant-modal-close').click(); + } + // ������������������������ + if ($('.ant-select-open').length > 0) { + $('.ant-select-open').click(); + } + // ��������������������������������� + const cdkOverlayContainer = $('.cdk-overlay-container'); + if (cdkOverlayContainer != null && cdkOverlayContainer.children().length > 2) { + cdkOverlayContainer.children('div:first-child').next().nextAll().each( + function (index, el) { + if ($(el).hasClass('cdk-overlay-backdrop-showing')) { + $(el).remove(); + } else { + $(el).empty(); + } + } + ); + } + + }); } } -- Gitblit v1.8.0