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
df301fc6
Commit
df301fc6
authored
Jun 11, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:设置永中预览页面标题
parent
08b1b5a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
src/modules/resource-disk/components/FolderList.jsx
+3
-5
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 @
df301fc6
...
@@ -156,7 +156,7 @@ class FolderList extends React.Component {
...
@@ -156,7 +156,7 @@ class FolderList extends React.Component {
}
}
// 预览文件
// 预览文件
handleScanFile
=
async
(
folder
)
=>
{
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
{
currentRootDisk
}
=
this
.
props
;
//如果是公共文件且只有查看的权限的用户的预览对接的三方是永中
//如果是公共文件且只有查看的权限的用户的预览对接的三方是永中
const
that
=
this
;
const
that
=
this
;
...
@@ -183,7 +183,7 @@ class FolderList extends React.Component {
...
@@ -183,7 +183,7 @@ class FolderList extends React.Component {
const
{
previewing
}
=
that
.
state
;
const
{
previewing
}
=
that
.
state
;
if
(
previewing
){
if
(
previewing
){
const
previewSign
=
await
that
.
getYoZoSign
(
response
.
data
.
data
.
fileVersionId
,
"VIEW"
);
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
url
=
`https://eic.yozocloud.cn/api/view/file?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
that
.
setState
({
that
.
setState
({
previewStatus
:
'UPLOAD_SUCCESS'
,
previewStatus
:
'UPLOAD_SUCCESS'
,
url
url
...
@@ -193,7 +193,7 @@ class FolderList extends React.Component {
...
@@ -193,7 +193,7 @@ class FolderList extends React.Component {
})
})
}
else
{
}
else
{
const
previewSign
=
await
that
.
getYoZoSign
(
fileVersionId
,
"VIEW"
);
const
previewSign
=
await
that
.
getYoZoSign
(
fileVersionId
,
"VIEW"
);
const
url
=
`http://eic.yozocloud.cn/api/view/file?fileVersionId=
${
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
`
const
url
=
`http://eic.yozocloud.cn/api/view/file?fileVersionId=
${
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
a
=
document
.
createElement
(
'a'
);
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
a
.
setAttribute
(
'href'
,
url
);
...
@@ -277,8 +277,6 @@ class FolderList extends React.Component {
...
@@ -277,8 +277,6 @@ class FolderList extends React.Component {
this
.
handleDataDot
(
folderFormat
);
this
.
handleDataDot
(
folderFormat
);
}
}
cancelPreview
=
()
=>
{
cancelPreview
=
()
=>
{
const
rightDom
=
document
.
querySelector
(
'.right-container'
);
rightDom
.
style
.
zIndex
=
1
;
this
.
setState
({
this
.
setState
({
previewing
:
false
,
previewing
:
false
,
showPreviewModal
:
false
,
showPreviewModal
:
false
,
...
...
src/modules/resource-disk/modal/PreviewFileModal.jsx
View file @
df301fc6
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
"./PreviewFileModal.less"
;
import
"./PreviewFileModal.less"
;
import
{
Spin
}
from
'antd'
class
PreviewFileModal
extends
React
.
Component
{
class
PreviewFileModal
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
...
@@ -26,7 +25,7 @@ class PreviewFileModal extends React.Component {
...
@@ -26,7 +25,7 @@ class PreviewFileModal extends React.Component {
<
div
className=
"preview-modal-content"
>
<
div
className=
"preview-modal-content"
>
<
div
className=
"load-img-box"
>
<
div
className=
"load-img-box"
>
{
previewStatus
===
"UPLOAD"
&&
{
previewStatus
===
"UPLOAD"
&&
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/3j32ashQst.png"
></
img
>
<
Spin
size=
"large"
/
>
}
}
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"
></
img
>
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"
></
img
>
...
...
src/modules/resource-disk/modal/PreviewFileModal.less
View file @
df301fc6
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
text-align:center;
text-align:center;
width:266px;
width:266px;
height:174px;
height:174px;
.ant-spin-dot-item{
background-color: #FFF;
}
.load-img-box{
.load-img-box{
.load-img{
.load-img{
width:44px;
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