import { Vue } from "vue-facing-decorator"; export declare abstract class UploadBase extends Vue { /** * 请求头设置值 */ headers: { Authorization: string; }; /** * 上传按钮名称 */ buttonName: string; /** * 同步 默认异步上传 (待开发) */ sync: boolean; /** * 上传成功提示语 */ uploadSuccessMsg: string; /** * 上传失败提示语 */ uploadErrorMsg: string; /** * 删除成功提示语 */ removeSuccessMsg: string; /** * 上传文件集合 */ fileListProp: any[]; /** * 上传接口 */ uploadUrl: string; deleteUrl: string; /** * 最大上传数量 */ max: number; /** * 单位:MB 默认为10MB */ size: number; /** * 过滤后缀 以,分割 */ suffixes: string; /** * 选文件时是否可选多个 */ multiple: boolean; /** * 注:使用limit时要开启multiple * 多个上传时,一次最大上传数量 */ limit: number; /** * 是否展示查看图片的图标 */ showPreviewIcon: boolean; /** * 是否展示删除按钮 */ showRemoveIcon: boolean; /** * 是否展示下载按钮 */ showDownloadIcon: boolean; /** * 是否展示限制的文件类型 */ showSuffixes: boolean; showSuffixesHint: boolean; /** * 是否展示限制的文件类型 */ showMax: boolean; showMaxHint: boolean; /** * 是否展示上传按钮 */ showUploadButton: boolean; showButton: boolean; /** * 查看模式 */ viewMode: boolean; /** * 存储文件位置 */ directory: string; /** * 上传接口服务器地址url */ apiUrl: string; /** * 文件类型(弹出系统选择框的时候限制选择的文件) */ protected fileType: string; /** * 组件的文件集合 */ protected fileList: any[]; /** * 对外放开的是fileListProp属性,监听fileListProp属性,有新的值后赋值给fileList * 为什么要这么做,上传组件的fileList是(受控)的,所以只能组件内容修改他的值,如果从父组件传值 * 进来修改他的值,就会报错; * 如果首次赋值也需要处理则需要添加 {deep: true, immediate: true} */ onFileListChanged(val: any): void; abstract showMessage(message: string, type: 'success' | 'warning' | 'error' | 'info'): any; /** * 获取文件列表 */ get fileLists(): any[]; /** * 上传中 */ upLoading: boolean; /** * 预览可见模态框 */ previewVisible: boolean; /** * 打开pdf预览 */ showPreview: boolean; /** * 预览文件 */ previewFile: any; /** * 模态框图片 */ previewImage: any; /** * 照片墙模式 * showPreviewIcon 是否展示查看 * showRemoveIcon 是否展示删除 * hidePreviewIconInNonImage 上传文件时是否隐藏查看按钮 */ showUploadList: any; created(): void; get action(): string; /** * 关闭模态框 */ handleCancel(): void; /** * 展示图片模态框 */ handlePreview(file: any): Promise; /** * 上传时触发 */ handleChange(info: any): void; /** * 处理文件 */ processFiles(info: any): void; /** * 删除时触发 * 直接删除集合中的数据即可 * @param file */ handleRemove(file: any): void; download(file: any): void; preview(file: any): void; private downloadFile; /** * 上传前触发,用于校验格式和,文件大小 * @param file */ beforeUpload(file: any): Promise; }