mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
调整autofill的位置
This commit is contained in:
parent
848fc02b41
commit
1b086a491f
@ -334,7 +334,6 @@ export default class ImageControl extends React.Component<
|
||||
|
||||
startUpload(retry: boolean = false) {
|
||||
if (this.state.uploading) {
|
||||
this.resolve && this.resolve(null);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -370,6 +369,7 @@ export default class ImageControl extends React.Component<
|
||||
}
|
||||
|
||||
tick() {
|
||||
const {multiple, autoFill, onBulkChange} = this.props;
|
||||
if (this.current || !this.state.uploading) {
|
||||
return;
|
||||
}
|
||||
@ -429,7 +429,16 @@ export default class ImageControl extends React.Component<
|
||||
{
|
||||
files: this.files = files
|
||||
},
|
||||
this.tick
|
||||
() => {
|
||||
const sendTo =
|
||||
!multiple &&
|
||||
autoFill &&
|
||||
!isEmpty(autoFill) &&
|
||||
dataMapping(autoFill, obj || {});
|
||||
sendTo && onBulkChange(sendTo);
|
||||
|
||||
this.tick();
|
||||
}
|
||||
);
|
||||
},
|
||||
progress => {
|
||||
@ -778,13 +787,6 @@ export default class ImageControl extends React.Component<
|
||||
};
|
||||
obj.value = obj.value || obj.url;
|
||||
|
||||
const sendTo =
|
||||
!multiple &&
|
||||
autoFill &&
|
||||
!isEmpty(autoFill) &&
|
||||
dataMapping(autoFill, obj);
|
||||
sendTo && onBulkChange(sendTo);
|
||||
|
||||
cb(null, file, obj);
|
||||
})
|
||||
.catch(error => cb(error.message || __('上传失败,请重试'), file));
|
||||
|
Loading…
Reference in New Issue
Block a user