Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
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
web_component
submodule
Commits
3ff1a860
Commit
3ff1a860
authored
Sep 08, 2020
by
zhuyangbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频组件
parent
638cdc29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
index.tsx
components/apolloTable/component/base/extra/upload/index.tsx
+7
-2
No files found.
components/apolloTable/component/base/extra/upload/index.tsx
View file @
3ff1a860
...
...
@@ -11,7 +11,9 @@ message.config({
});
const
UploadCom
=
(
props
)
=>
{
const
{
onChange
,
CDN_HOST
,
getFormat
,
setFormat
,
data
,
maxLength
,
disabled
}
=
props
;
const
{
onChange
,
CDN_HOST
,
getFormat
,
setFormat
,
data
,
maxLength
,
disabled
,
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'CDN_HOST'
,
'data'
]);
const
getFormatFileList
=
(
fileList
=
[])
=>
{
if
(
!
fileList
)
{
...
...
@@ -106,7 +108,7 @@ const UploadCom = (props) => {
const
previewFile
=
(
file
)
=>
{
return
new
Promise
((
res
,
rej
)
=>
{
const
obj
=
checkoutFileType
(
file
.
name
);
const
typeArr
=
file
.
name
.
match
(
/
\.[
a-zA-Z
]
+$/
);
const
typeArr
=
file
.
name
.
match
(
/
\.[
a-zA-Z
0-9
]
+$/
);
const
type
=
typeArr
&&
typeArr
[
0
]
?
typeArr
[
0
].
replace
(
'.'
,
''
)
:
''
;
if
(
!
[
'png'
,
'gif'
,
'bmp'
,
'jpg'
,
'jpeg'
].
includes
(
type
))
{
res
(
obj
.
thumbUrl
);
...
...
@@ -125,6 +127,8 @@ const UploadCom = (props) => {
onSaveFileList
(
newFileList
);
};
const
onDownload
=
(
file
)
=>
{};
const
beforeUpload
=
async
()
=>
{
await
getToken
();
return
true
;
...
...
@@ -144,6 +148,7 @@ const UploadCom = (props) => {
onRemove=
{
onRemove
}
previewFile=
{
previewFile
}
onPreview=
{
onPreview
}
onDownload=
{
onDownload
}
showUploadList=
{
{
showPreviewIcon
:
true
,
showRemoveIcon
:
true
,
...
...
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