fix: upload loading

This commit is contained in:
严志勇 2024-09-04 17:45:51 +08:00
parent 37aed537ce
commit d96e1ec75e

View File

@ -43,9 +43,6 @@ export const renderUpload = (params: Props) => {
console.log(error) console.log(error)
}) })
} }
}, []); }, []);
const attr = convertKeysToCamelCase(data.ui?.attr || {}); const attr = convertKeysToCamelCase(data.ui?.attr || {});
@ -82,6 +79,7 @@ export const renderUpload = (params: Props) => {
headers: { headers: {
authorization: 'authorization-text', authorization: 'authorization-text',
}, },
defaultFileList: fileList,
onChange(info) { onChange(info) {
setUploading(true); setUploading(true);
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
@ -104,7 +102,7 @@ export const renderUpload = (params: Props) => {
return ( return (
<div className='p-2 text-sm text-center'> <div className='p-2 text-sm text-center'>
<Upload fileList={fileList} onRemove={handleFileRemove} {...props} {...attr} multiple={data.is_list?true:false} accept={uploadType}> <Upload onRemove={handleFileRemove} {...props} {...attr} multiple={data.is_list?true:false} accept={uploadType}>
<Button loading={uploading} icon={<UploadOutlined />}> <Button loading={uploading} icon={<UploadOutlined />}>
{t('Upload_Data')} {t('Upload_Data')}
</Button> </Button>