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
795fb51d
Commit
795fb51d
authored
Sep 09, 2020
by
zhuyangbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片支持heic
parent
ad7a7b13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
index.tsx
components/apolloTable/component/base/extra/upload/index.tsx
+1
-1
preview.tsx
...nents/apolloTable/component/base/extra/upload/preview.tsx
+1
-3
utils.ts
components/apolloTable/component/base/extra/upload/utils.ts
+1
-1
No files found.
components/apolloTable/component/base/extra/upload/index.tsx
View file @
795fb51d
...
...
@@ -110,7 +110,7 @@ const UploadCom = (props) => {
const
obj
=
checkoutFileType
(
file
.
name
);
const
typeArr
=
file
.
name
.
match
(
/
\.[
a-zA-Z0-9
]
+$/
);
const
type
=
typeArr
&&
typeArr
[
0
]
?
typeArr
[
0
].
replace
(
'.'
,
''
)
:
''
;
if
(
!
[
'png'
,
'gif'
,
'bmp'
,
'jpg'
,
'jpeg'
].
includes
(
type
))
{
if
(
!
[
'png'
,
'gif'
,
'bmp'
,
'jpg'
,
'jpeg'
,
'heic'
].
includes
(
type
))
{
res
(
obj
.
thumbUrl
);
}
});
...
...
components/apolloTable/component/base/extra/upload/preview.tsx
View file @
795fb51d
...
...
@@ -10,14 +10,12 @@ export default class uploadDetail extends React.Component {
};
onPreview
=
(
url
:
string
,
name
:
string
)
=>
{
console
.
log
(
'name: '
,
name
);
console
.
log
(
'url: '
,
url
);
const
nameTypeArr
=
name
.
match
(
/
\.[
a-zA-Z0-9
]
+$/
);
const
urlTypeArr
=
url
.
match
(
/
\.[
a-zA-Z0-9
]
+$/
);
const
typeArr
=
nameTypeArr
||
urlTypeArr
;
let
type
=
typeArr
&&
typeArr
[
0
]
?
typeArr
[
0
].
replace
(
'.'
,
''
)
:
''
;
type
=
type
.
toLowerCase
();
if
([
'png'
,
'gif'
,
'bmp'
,
'jpg'
,
'jpeg'
].
includes
(
type
))
{
if
([
'png'
,
'gif'
,
'bmp'
,
'jpg'
,
'jpeg'
,
'heic'
].
includes
(
type
))
{
this
.
setState
({
showDialog
:
true
,
type
:
'image'
,
url
});
}
else
if
([
'doc'
,
'docx'
,
'document'
,
'xls'
,
'xlsx'
,
'ppt'
,
'pptx'
].
includes
(
type
))
{
this
.
setState
({
showDialog
:
true
,
type
:
'office'
,
url
});
...
...
components/apolloTable/component/base/extra/upload/utils.ts
View file @
795fb51d
...
...
@@ -4,7 +4,7 @@ export const checkoutFileType = (url = '') => {
const
typeArr
=
url
.
match
(
/
\.[
a-zA-Z0-9
]
+$/
);
let
type
=
typeArr
&&
typeArr
[
0
]
?
typeArr
[
0
].
replace
(
'.'
,
''
)
:
''
;
type
=
type
.
toLowerCase
();
if
(
type
===
'png'
||
type
===
'jpg'
||
type
===
'gif'
||
type
===
'bmp'
||
type
===
'jpeg'
)
{
if
(
type
===
'png'
||
type
===
'jpg'
||
type
===
'gif'
||
type
===
'bmp'
||
type
===
'jpeg'
||
type
===
'heic'
)
{
return
{
thumbUrl
:
`
${
url
}
?imageView2/1/w/120/h/120`
,
fileType
:
type
};
}
return
fileType
[
type
]
?
fileType
[
type
]
:
fileType
.
other
;
...
...
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