Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
295f309b
Commit
295f309b
authored
Apr 20, 2021
by
王苓芝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件格式控制
parent
e2da9548
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
upload.jsx
src/pages/components/upload.jsx
+13
-6
index.jsx
src/pages/settleManage/uploadModal/index.jsx
+1
-1
No files found.
src/pages/components/upload.jsx
View file @
295f309b
import
{
Upload
,
Icon
,
Modal
,
notification
}
from
'
antd
'
;
import
{
Upload
,
Icon
,
Modal
,
message
}
from
'
antd
'
;
import
React
from
'
react
'
;
import
config
from
'
../../../config/env.config
'
;
import
{
qiniuToken
}
from
'
@/services/qiniu
'
;
...
...
@@ -22,6 +22,7 @@ class PicturesWall extends React.Component {
previewVisible
:
false
,
previewImage
:
''
,
fileList
:
[],
isValid
:
false
,
};
async
componentDidMount
()
{
...
...
@@ -45,14 +46,19 @@ class PicturesWall extends React.Component {
beforeUpload
=
file
=>
{
const
types
=
[
'
application/pdf
'
,
'
image/png
'
,
'
image/jpeg
'
];
if
(
types
.
indexOf
(
file
.
type
)
===
-
1
)
{
notification
.
error
(
'
输入格式有问题
'
);
return
false
;
this
.
setState
({
isValid
:
false
}
);
message
.
error
(
'
输入格式有问题
'
)
;
}
return
t
rue
;
return
t
ypes
.
indexOf
(
file
.
type
)
!==
-
1
;
};
handleChange
=
({
fileList
})
=>
{
this
.
setState
({
fileList
});
handleChange
=
info
=>
{
console
.
log
(
'
info
'
,
info
.
file
);
if
(
!
this
.
state
.
isValid
)
{
this
.
setState
({
fileList
:
[]
});
return
;
}
this
.
setState
({
fileList
:
info
.
fileList
});
};
customRequest
=
({
file
,
onError
,
onSuccess
})
=>
{
...
...
@@ -89,6 +95,7 @@ class PicturesWall extends React.Component {
render
()
{
const
{
previewVisible
,
previewImage
,
fileList
}
=
this
.
state
;
console
.
log
(
'
fileList---render
'
,
fileList
);
const
uploadButton
=
(
<
div
>
<
Icon
type=
"plus"
/>
...
...
src/pages/settleManage/uploadModal/index.jsx
View file @
295f309b
...
...
@@ -76,7 +76,7 @@ export default props => {
<
Modal
title=
"上传发票"
visible=
{
visible
}
footer=
{
null
}
onCancel=
{
props
.
onCancel
}
width=
"700px"
>
<
Tabs
defaultActiveKey=
"1"
className=
{
styles
.
tab
}
onChange=
{
changeTab
}
activeKey=
{
tabValue
}
>
<
TabPane
tab=
"上传凭证"
key=
"1"
>
<
UploadC
ref=
{
picUpload
}
accept=
".png,.jpg,.jpeg,.pdf"
/>
<
UploadC
ref=
{
picUpload
}
/>
</
TabPane
>
<
TabPane
tab=
"上传附件"
key=
"2"
>
<
a
...
...
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