From 64c930bec1b013ac6e19af9ec30db9eff6110206 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Tue, 27 Feb 2018 15:08:12 +0800 Subject: [PATCH] ng-alian主题系统跳转页面 多余蒙版关闭 --- src/app/app.component.ts | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e8afd42..efcceed 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 * as $ from 'jquery'; @Component({ selector: 'app-root', template: `<router-outlet></router-outlet>` @@ -30,5 +31,31 @@ .subscribe(url => { this.titleSrv.setTitleByUrl(url); }); + this.router.events.pipe( + filter(evt => evt instanceof NavigationStart) + ) + .subscribe(() => { + // ��������������������������������� + let cdkOverlayContainer = $('.cdk-overlay-container'); + if(cdkOverlayContainer!=null&&cdkOverlayContainer.children().length>1){ + cdkOverlayContainer.children('div:first-child').nextAll().each( + function(index,element){ + if($(element).hasClass('cdk-overlay-backdrop-showing')){ + $(element).remove(); + }else{ + $(element).empty(); + } + } + ); + } + // ������������������������ + if($('.ant-modal-close').length>0){ + $('.ant-modal-close').click(); + } + // ������������������������ + if($('.ant-select-open').length>0){ + $('.ant-select-open').click(); + } + }); } } -- Gitblit v1.8.0