图片在裁剪中表单提交,则自动把内容裁剪提交

This commit is contained in:
2betop 2020-02-28 12:39:53 +08:00
parent be462a25d2
commit 48dd654ce7
1 changed files with 5 additions and 2 deletions

View File

@ -569,8 +569,6 @@ export default class ImageControl extends React.Component<
}
return this.setState({
locked: true,
lockedReason: '请选择放弃或者应用',
cropFile: file
});
}
@ -853,6 +851,11 @@ export default class ImageControl extends React.Component<
validate(): any {
if (this.state.locked && this.state.lockedReason) {
return this.state.lockedReason;
} else if (this.state.cropFile) {
return new Promise(resolve => {
this.resolve = resolve;
this.handleCrop();
});
} else if (
this.state.uploading ||
this.files.some(item => item.state === 'pending')