|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ngOnInit() { | 
|---|
|  |  |  | this.router.events | 
|---|
|  |  |  | .pipe(filter(evt => evt instanceof NavigationEnd)) | 
|---|
|  |  |  | .subscribe(() => this.titleSrv.setTitle()); | 
|---|
|  |  |  | this.router.events.pipe( | 
|---|
|  |  |  | filter(evt => evt instanceof NavigationStart) | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | .pipe(filter(evt => evt instanceof NavigationEnd)) | 
|---|
|  |  |  | .subscribe(() => this.titleSrv.setTitle()); | 
|---|
|  |  |  | this.router.events.pipe( | 
|---|
|  |  |  | filter(evt => evt instanceof NavigationStart) | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | .subscribe(() => { | 
|---|
|  |  |  | // 删除多余透明蒙版中元素 | 
|---|
|  |  |  | const cdkOverlayContainer = $('.cdk-overlay-container'); | 
|---|
|  |  |  | if (cdkOverlayContainer != null && cdkOverlayContainer.children().length > 1) { | 
|---|
|  |  |  | cdkOverlayContainer.children('div:first-child').nextAll().each( | 
|---|
|  |  |  | function(index, el) { | 
|---|
|  |  |  | if ($(el).hasClass('cdk-overlay-backdrop-showing')) { | 
|---|
|  |  |  | $(el).remove(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | $(el).empty(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 关闭静态蒙版弹窗 | 
|---|
|  |  |  | if ($('.ant-modal-close').length > 0) { | 
|---|
|  |  |  | $('.ant-modal-close').click(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 下拉按钮模拟点击 | 
|---|
|  |  |  | if ($('.ant-select-open').length > 0) { | 
|---|
|  |  |  | // 关闭静态蒙版弹窗 | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|