Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
10912935
Commit
10912935
authored
Jun 07, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 loading
parent
f7717d7d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
index.tsx
src/pages/member/components/QualitiesUpload/index.tsx
+15
-4
index.tsx
...pages/member/components/QualitiesUploadFormItem/index.tsx
+2
-2
No files found.
src/pages/member/components/QualitiesUpload/index.tsx
View file @
10912935
...
...
@@ -2,12 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2021-06-04 17:26:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-0
4 18:52:5
0
* @LastEditTime: 2021-06-0
7 16:20:4
0
* @Description: 资质上传组件
*/
import
React
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Upload
}
from
'antd'
;
import
{
PlusOutlined
,
FileOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
FileOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
UploadChangeParam
}
from
'antd/lib/upload'
;
import
styles
from
'./index.less'
;
...
...
@@ -20,12 +20,19 @@ const QualitiesUpload = (props) => {
mutators
,
// schema,
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
arrValue
=
value
?
[
value
]
:
[];
const
handleChange
=
(
info
:
UploadChangeParam
)
=>
{
const
{
file
}
=
info
;
const
{
response
=
{},
...
rest
}
=
file
;
if
(
file
.
status
===
'uploading'
)
{
setLoading
(
true
);
}
if
(
file
.
status
===
'done'
||
file
.
status
===
'error'
)
{
setLoading
(
false
);
}
mutators
.
change
({
...
rest
,
...(
response
.
data
||
{}),
...
...
@@ -69,7 +76,11 @@ const QualitiesUpload = (props) => {
fileList=
{
arrValue
}
onChange=
{
handleChange
}
>
{
arrValue
.
length
?
renderFile
()
:
uploadButton
}
{
!
loading
?
(
arrValue
.
length
?
renderFile
()
:
uploadButton
)
:
(
<
LoadingOutlined
/>
)
}
</
Upload
>
</
div
>
);
...
...
src/pages/member/components/QualitiesUploadFormItem/index.tsx
View file @
10912935
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-01 16:13:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-07 1
5:07:45
* @LastEditTime: 2021-06-07 1
6:18:24
* @Description: 资质证明上传组件
*/
import
React
from
'react'
;
...
...
@@ -35,7 +35,7 @@ const schema = new Schema({
action
:
'/api/file/file/upload/prefix'
,
data
:
{
fileType
:
UPLOAD_TYPE
,
prefix
:
'
member_qualifications_
'
,
prefix
:
''
,
},
accept
:
'.doc, .docx, .xls, .xlsx, .pot, .pps, .vsd, .wps, .dps, .pdf, .txt, .png, .jpg, .rar, .zip'
,
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment