Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
a9b0e9e2
Commit
a9b0e9e2
authored
Jun 11, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/zahngleyuan/20210607/cloud-cass-remodel' into dev
parents
3f881d0e
da36abd7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
src/modules/resource-disk/components/FolderList.jsx
+9
-10
src/modules/resource-disk/modal/PreviewFileModal.jsx
+2
-3
src/modules/resource-disk/modal/PreviewFileModal.less
+3
-0
No files found.
src/modules/resource-disk/components/FolderList.jsx
View file @
a9b0e9e2
...
...
@@ -122,7 +122,7 @@ class FolderList extends React.Component {
break
;
}
}
getYoZoSign
=
(
data
,
type
)
=>
{
getYoZoSign
=
(
data
,
type
,
folderName
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
uploadParams
;
if
(
type
===
"UPLOAD"
){
...
...
@@ -135,7 +135,8 @@ class FolderList extends React.Component {
uploadParams
=
{
fileVersionId
:
data
,
instId
:
window
.
currentUserInstInfo
.
instId
,
yoZoTypeEnum
:
'VIEW'
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
folderName
}
}
Service
.
Apollo
(
'public/apollo/getYoZoSign'
,
uploadParams
).
then
(
res
=>
{
...
...
@@ -157,11 +158,11 @@ class FolderList extends React.Component {
}
// 预览文件
handleScanFile
=
async
(
folder
)
=>
{
const
{
folderFormat
,
folderSize
,
ossUrl
,
rights
,
fileVersionId
,
id
}
=
folder
;
const
{
folderFormat
,
folderSize
,
ossUrl
,
rights
,
fileVersionId
,
id
,
folderName
}
=
folder
;
const
{
currentRootDisk
}
=
this
.
props
;
//如果是公共文件且只有查看的权限的用户的预览对接的三方是永中
const
that
=
this
;
if
(
currentRootDisk
.
disk
===
"COMMON"
&&
rights
===
"LOOK"
){
if
(
currentRootDisk
.
disk
===
"COMMON"
){
switch
(
folderFormat
)
{
case
'PDF'
:
case
'WORD'
:
...
...
@@ -183,8 +184,8 @@ class FolderList extends React.Component {
that
.
saveYoZoFileVersionId
(
response
.
data
.
data
.
fileVersionId
,
id
);
const
{
previewing
}
=
that
.
state
;
if
(
previewing
){
const
previewSign
=
await
that
.
getYoZoSign
(
response
.
data
.
data
.
fileVersionId
,
"VIEW"
);
const
url
=
`https://eic.yozocloud.cn/api/view/file?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
`
const
previewSign
=
await
that
.
getYoZoSign
(
response
.
data
.
data
.
fileVersionId
,
"VIEW"
,
folderName
);
const
url
=
`https://eic.yozocloud.cn/api/view/file?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
that
.
setState
({
previewStatus
:
'UPLOAD_SUCCESS'
,
url
...
...
@@ -193,8 +194,8 @@ class FolderList extends React.Component {
})
})
}
else
{
const
previewSign
=
await
that
.
getYoZoSign
(
fileVersionId
,
"VIEW"
);
const
url
=
`http://eic.yozocloud.cn/api/view/file?fileVersionId=
${
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
`
const
previewSign
=
await
that
.
getYoZoSign
(
fileVersionId
,
"VIEW"
,
folderName
);
const
url
=
`http://eic.yozocloud.cn/api/view/file?fileVersionId=
${
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
...
...
@@ -278,8 +279,6 @@ class FolderList extends React.Component {
this
.
handleDataDot
(
folderFormat
);
}
cancelPreview
=
()
=>
{
const
rightDom
=
document
.
querySelector
(
'.right-container'
);
rightDom
.
style
.
zIndex
=
1
;
this
.
setState
({
previewing
:
false
,
showPreviewModal
:
false
,
...
...
src/modules/resource-disk/modal/PreviewFileModal.jsx
View file @
a9b0e9e2
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
"./PreviewFileModal.less"
;
import
{
Spin
}
from
'antd'
class
PreviewFileModal
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -26,7 +25,7 @@ class PreviewFileModal extends React.Component {
<
div
className=
"preview-modal-content"
>
<
div
className=
"load-img-box"
>
{
previewStatus
===
"UPLOAD"
&&
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/3j32ashQst.png"
></
img
>
<
Spin
size=
"large"
/
>
}
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"
></
img
>
...
...
src/modules/resource-disk/modal/PreviewFileModal.less
View file @
a9b0e9e2
...
...
@@ -15,6 +15,9 @@
text-align:center;
width:266px;
height:174px;
.ant-spin-dot-item{
background-color: #FFF;
}
.load-img-box{
.load-img{
width:44px;
...
...
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