import { IBaseForm } from '../baseForm' import { paramsInterfaceValidKey } from '../../../script/index' export interface UploadInterface extends IBaseForm { api: string data?: Function tipBtnClick?: Function headers?: object name?: string method?: string multiple?: boolean showFileList?: boolean drag?: boolean // 是否启用拖拽上传 accept?: string listType?: string autoUpload?: boolean limit?: number preview?: Function remove?: Function error?: Function success?: Function trigger?: string isDrag?: boolean tip?: string on?: Function showClear?: boolean isReplace?: boolean showTipBtn?: Function tipBtnText?: string } export class UploadConfig implements UploadInterface { type = 'infoUpload' label = '' model = '' api = '' headers: object = {} name = '' method = 'post' multiple = false showFileList = false drag = false accept = '' listType = '' autoUpload = false limit = 10 trigger = '' tip = '' showClear = true isReplace = false tipBtnText = '' constructor (params: UploadInterface) { paramsInterfaceValidKey(this, params) } showTipBtn = (): boolean => false on = (): void => { } preview = (): void => { } remove = (): void => { } error = (): void => { } data = (): object => ({}) tipBtnClick = () => {} }