/**
 * 上传任务
 */ abstract class BaseTask { protected _file : File ; protected _retry : number = 0 ; protected _createDate : Date ; protected _startDate : Date ; protected _endDate : Date ; protected _key : string ; protected _progress : number = 0 ; protected _isSuccess : boolean = false ; protected _isFinish : boolean = false ; protected _result : Object ; protected _error : any ; constructor ( file ) { this . _file = file ; this . _createDate = new Date ( ) ; } public get file ( ) : File { return this . _file ; } public set file ( file ) { this . _file = file ; } get retry ( ) : number { return this . _retry ; } set retry ( value ) { this . _retry = value ; } get createDate ( ) : Date { return this . _createDate ; } set createDate ( value ) { this . _createDate = value ; } get startDate ( ) : Date { return this . _startDate ; } set startDate ( value ) { this . _startDate = value ; } get endDate ( ) : Date { return this . _endDate ; } set endDate ( value ) { this . _endDate = value ; } get isSuccess ( ) : boolean { return this . _isSuccess ; } set isSuccess ( value ) { this . _isSuccess = value ; } get progress ( ) : number { return this . _progress ; } set progress ( value ) { this . _progress = Math . min ( Math . max ( 0 , value ) , 100 ) ; } get result ( ) { return this . _result ; } set result ( value ) { this . _result = value ; } get error ( ) { return this . _error ; } set error ( value ) { this . _error = value ; } get key ( ) : string { return this . _key ; } set key ( value ) { this . _key = value ; } get isFinish ( ) : boolean { return this . _isFinish ; } set isFinish ( value ) { this . _isFinish = value ; } } export default BaseTask ;