import { Component, OnInit, ViewContainerRef } from '@angular/core'; import { NzModalService } from 'ng-zorro-antd/modal'; import { Observable, fromEvent } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component'; @Component({ selector: 'app-audit-ing', templateUrl: './audit-ing.component.html', styleUrls: ['./audit-ing.component.scss'] }) export class AuditIngComponent implements OnInit { constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } tableSpin = false list = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] tableScrollHeight ngOnInit(): void { this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' // 页面监听 fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' }); } dispose(item) { console.log('item', item) const modal = this.modal.create({ nzContent: AuditDisposeComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 600, nzBodyStyle: { 'border': '1px solid #91CCFF', 'border-radius': '0px', 'padding': '7px', 'box-shadow': '0 0 8px 0 #fff', 'background-image': 'linear-gradient(#003665, #000f25)' }, nzComponentParams: { data: item }, nzFooter: null, nzClosable: false, nzOnOk: async () => { } }); const instance = modal.getContentComponent(); modal.afterClose.subscribe(result => { }); } }