pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG]ProFormUploadButton多个图片同时上传部分图片一直显示文件上传中(60%概率出现)

Open caizhehao opened this issue 3 years ago • 3 comments

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

ProFormUploadButton多个图片同时上传部分图片一直显示文件上传中(60%概率出现)

📷 复现步骤

ProFormUploadButton多个图片同时上传部分图片一直显示文件上传中(60%概率出现),如下图 image

🏞 期望结果

期望可以同时正常上传图片

💻 复现代码

image

return ( <ProFormUploadButton label={label} name={name} accept=".png,.jpg" listType="picture-card" extra={extra} max={max} rules={[{ required: isRequired, message: rulesMessage }]} fieldProps={{ maxCount: max, multiple: true, beforeUpload: (file) => { const isLt10M = file.size / 1024 / 1024 < 10; if (!isLt10M) { message.error('图片大小不得超过10M'); return Upload.LIST_IGNORE; } return true; }, previewFile(file: any) { const { lastModified, name } = file; return Promise.resolve( ${cosApi.imgBaseUrl}/image/${lastModified}_${name}, ); }, customRequest: (options: any) => { uploadCosFile({ file: null, insertFn: null, options, type: true, }) .then(() => { // 这里即可取到cos存储图片地址 "https://" + res.Location }) .catch((err) => { message.error(${err}出错了!); }); }, }} initialValue={initialValue} /> );

© 版本信息

  • "@ant-design/pro-components": "^1.1.3",
  • "antd": "^4.20.7",
  • "@umijs/max": "^4.0.7",

🚑 其他信息

caizhehao avatar Jul 26 '22 13:07 caizhehao

补充:相同的代码在如下项目版本正常运行

  • "@ant-design/pro-descriptions": "^1.2.0",
  • "@ant-design/pro-form": "1.55.0",
  • "antd": "^4.12.0",
  • "umi": "^3.5.0",

caizhehao avatar Jul 26 '22 13:07 caizhehao

相同的问题,发现fileList的status更新没有触发列表的重新更新。

zjb19970804 avatar Aug 11 '22 16:08 zjb19970804

都17天了,还没有解决方法吗

caizhehao avatar Aug 12 '22 07:08 caizhehao

重新更新一下antd的版本就能解决这个问题了

chenshuai2144 avatar Dec 23 '22 09:12 chenshuai2144