mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
use launchUpload with reactComponent
This commit is contained in:
@@ -430,7 +430,7 @@ export default class Matter extends BaseEntity {
|
||||
}
|
||||
|
||||
//文件上传
|
||||
httpUpload(successCallback?: any, failureCallback?: any, processCallback?: any) {
|
||||
httpUpload(successCallback?: any, failureCallback?: any) {
|
||||
let that = this;
|
||||
|
||||
//验证是否装填好
|
||||
@@ -475,7 +475,7 @@ export default class Matter extends BaseEntity {
|
||||
that.errorMessage = response;
|
||||
that.clear();
|
||||
that.defaultErrorHandler(response);
|
||||
SafeUtil.safeCallback(failureCallback)(response);
|
||||
SafeUtil.safeCallback(failureCallback)();
|
||||
},
|
||||
function () {
|
||||
that.loading = false;
|
||||
@@ -499,7 +499,7 @@ export default class Matter extends BaseEntity {
|
||||
(deltaSize / (deltaTime / 1000)).toFixed(0)
|
||||
);
|
||||
}
|
||||
SafeUtil.safeCallback(processCallback)();
|
||||
that.updateUI();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
};
|
||||
|
||||
launchUpload = (file: any) => {
|
||||
const m = new Matter();
|
||||
const m = new Matter(this);
|
||||
m.dir = false;
|
||||
m.puuid = this.matter.uuid!;
|
||||
m.userUuid = this.user.uuid!;
|
||||
@@ -180,21 +180,12 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
}
|
||||
}
|
||||
m.file = file;
|
||||
|
||||
m.httpUpload(
|
||||
() => {
|
||||
this.refresh();
|
||||
},
|
||||
() => {
|
||||
this.updateUI();
|
||||
},
|
||||
() => {
|
||||
this.updateUI();
|
||||
}
|
||||
() => this.refresh(),
|
||||
() => this.updateUI()
|
||||
);
|
||||
|
||||
this.uploadMatters.push(m);
|
||||
this.updateUI();
|
||||
};
|
||||
|
||||
share = () => {
|
||||
|
||||
Reference in New Issue
Block a user