Commit df6b39ab by zhaochengxiang

bug fix

parent eff880b4
...@@ -93,6 +93,11 @@ const FC = (props) => { ...@@ -93,6 +93,11 @@ const FC = (props) => {
const uploadProps = { const uploadProps = {
beforeUpload: file => { beforeUpload: file => {
if (uploading) {
showMessage('warn', '文件上传中,请稍后')
return
}
const isLt20M = file.size / 1024 / 1024 <= 100 const isLt20M = file.size / 1024 / 1024 <= 100
if (!isLt20M) { if (!isLt20M) {
showMessage('error', '上传文件限制最大100M') showMessage('error', '上传文件限制最大100M')
...@@ -143,7 +148,7 @@ const FC = (props) => { ...@@ -143,7 +148,7 @@ const FC = (props) => {
<div className='flex' style={{ padding: '8px 11px', justifyContent: 'space-between' }}> <div className='flex' style={{ padding: '8px 11px', justifyContent: 'space-between' }}>
<Space align='start'> <Space align='start'>
<Upload {...uploadProps }> <Upload {...uploadProps }>
<Button size='small' icon={<PlusOutlined />} /> <Button loading={uploading} size='small' icon={<PlusOutlined />} />
</Upload> </Upload>
<AttachesItem value={fileList} onChange={(val) => { setFileList(val) }} /> <AttachesItem value={fileList} onChange={(val) => { setFileList(val) }} />
</Space> </Space>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment