import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { VideoUploadService } from '../vod/video-upload.service'; import { YxFileCenterLibService } from '../yx-file-center-lib.service'; import { NzNotificationService } from "ng-zorro-antd/notification"; import { Observable, Subscription } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { FileLibConfig } from '../file-lib-config'; import { NzUploadComponent } from "ng-zorro-antd/upload"; /** * 阿里云OSS文件上传 * @author zxx * @date 2020/5/22 0022 */ export declare class FileUploadComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy { private http; private fileLibConfig; private message; private videoUploadService; private yxFileCenterLibService; uploader: any; btnId: string; container: ElementRef; yxUpload: NzUploadComponent; aclp: number; unZip: number; manyFile: boolean; site: number; showButton: boolean; fileTypeName: string; drag: boolean; showFileSuffix: boolean; fileList: any[]; type: string[]; showUploadList: boolean; uploadLoading: boolean; fileTypeArr: { all: { name: string; suffix: string; type: string; }; image: { name: string; suffix: string; type: string; }; audio: { type: string; name: string; suffix: string; }; video: { name: string; suffix: string; type: string; }; word: { name: string; suffix: string; type: string; }; excel: { name: string; suffix: string; type: string; }; ppt: { name: string; suffix: string; type: string; }; pdf: { type: string; name: string; suffix: string; }; txt: { type: string; name: string; suffix: string; }; zip: { name: string; suffix: string; type: string; }; vr: { name: string; suffix: string; type: string; }; mm: { name: string; suffix: string; type: string; }; zipOnly: { name: string; suffix: string; type: string; }; }; fileType: string; fileSuffix: string; uploadXHR: any; progressSubscription: Subscription; uploadSubscription: Subscription; uploaderFileInfo: any; fileChange: EventEmitter; constructor(http: HttpClient, fileLibConfig: FileLibConfig, message: NzNotificationService, videoUploadService: VideoUploadService, yxFileCenterLibService: YxFileCenterLibService); ngOnInit(): void; /** * ngOnChanges */ ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** * 监听选择文件事件 */ customUpload: (item: any) => void; ngAfterViewInit(): void; /** * 自定义上传按钮上传文件 */ customUploadButton(): void; /** * 上传验证 */ beforeUpload: (file: File) => Observable; /** * 移除文件 */ removeFile: (file: any) => boolean; /** * 文件已存在,禁止上传 */ fileExist(): void; /** * 上传按钮文本和上传类型限制 */ toBtnText(): void; /** * 根据传入的文件类型转为文件后缀用于oss上传验证 */ toFileSuffix(): string; }