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
2085ada3
Commit
2085ada3
authored
Jun 24, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:永中优化
parent
ffe5a5f7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
136 deletions
+27
-136
src/modules/course-manage/modal/ManageCoursewareModal.jsx
+25
-1
src/modules/prepare-lesson/components/FolderList.jsx
+0
-0
src/modules/prepare-lesson/components/FolderManage.jsx
+0
-22
src/modules/resource-disk/components/FolderList.jsx
+2
-2
src/modules/resource-disk/modal/PreviewFileModal.jsx
+0
-57
src/modules/resource-disk/modal/PreviewFileModal.less
+0
-54
No files found.
src/modules/course-manage/modal/ManageCoursewareModal.jsx
View file @
2085ada3
...
...
@@ -170,7 +170,7 @@ class ManageCoursewareModal extends React.Component {
}
// 预览文件
handleScanFile
(
item
)
{
handleScanFile
=
async
(
item
)
=>
{
if
(
!
item
.
srcDocUrl
)
return
null
;
const
suffix
=
_
.
last
(
item
.
fileName
.
split
(
'.'
)).
toLowerCase
();
...
...
@@ -209,6 +209,8 @@ class ManageCoursewareModal extends React.Component {
// const scanUrl = "https://view.officeapps.live.com/op/view.aspx?src=" + encodeURIComponent(item.srcDocUrl);
// window.open(scanUrl, "_blank");
// }
if
(
!
item
.
fileVersionId
){
this
.
setState
({
previewing
:
true
,
showPreviewModal
:
true
,
...
...
@@ -221,6 +223,12 @@ class ManageCoursewareModal extends React.Component {
}
const
uploadSign
=
await
BaseService
.
getYoZoSign
(
uploadParams
);
BaseService
.
yoZoUpload
(
item
.
srcDocUrl
,
YZ_APPId
,
uploadSign
).
then
(
async
function
(
response
){
const
saveParams
=
{
fileVersionId
:
response
.
data
.
data
.
fileVersionId
,
folderId
:
item
.
folderId
,
instId
:
User
.
getStoreId
(),
}
BaseService
.
saveYoZoFileVersionId
(
saveParams
);
const
{
previewing
}
=
that
.
state
;
if
(
previewing
){
const
previewParams
=
{
...
...
@@ -238,6 +246,22 @@ class ManageCoursewareModal extends React.Component {
}
})
})
}
else
{
const
previewParams
=
{
fileVersionId
:
item
.
fileVersionId
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
item
.
fileName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
item
.
fileVersionId
}
&appId=
${
YZ_APPId
}
&sign=
${
previewSign
}
&htmlTitle=
${
item
.
fileNam
}
`
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
a
.
setAttribute
(
'target'
,
'_blank'
);
a
.
click
();
document
.
body
.
removeChild
(
a
)
}
break
;
case
"JPG"
:
case
"PNG"
:
...
...
src/modules/prepare-lesson/components/FolderList.jsx
deleted
100644 → 0
View file @
ffe5a5f7
This diff is collapsed.
Click to expand it.
src/modules/prepare-lesson/components/FolderManage.jsx
View file @
2085ada3
...
...
@@ -13,7 +13,6 @@ import { Spin, message } from 'antd';
import
User
from
'@/common/js/user'
;
import
OperateArea
from
'./OperateArea'
;
import
FolderList
from
'./FolderList'
;
import
{
DISK_MAP
,
suffixMap
}
from
"@/common/constants/academic/lessonEnum"
;
...
...
@@ -301,27 +300,6 @@ class FolderManage extends React.Component {
onChangeFolderPath=
{
this
.
handleChangeFolderPath
}
onRefresh=
{
this
.
handleFetchFolderList
}
/>
{
/* 文件夹列表 */
}
<
FolderList
query=
{
query
}
totalCount=
{
totalCount
}
balance=
{
balance
}
showResultPage=
{
showResultPage
}
currentRootDisk=
{
currentRootDisk
}
hasManagementAuthority=
{
hasManagementAuthority
}
folderList=
{
folderList
}
folderPathList=
{
folderPathList
}
selectedFileIds=
{
selectedFileIds
}
onChangeRow=
{
this
.
handleChangeRow
}
onChangeFolderPath=
{
this
.
handleChangeFolderPath
}
onMove=
{
this
.
handleMove
}
onUpload=
{
this
.
handleUploadDone
}
onChangePage=
{
this
.
handleChangePage
}
onRefresh=
{
this
.
handleFetchFolderList
}
/>
</
div
>
</
Spin
>
...
...
src/modules/resource-disk/components/FolderList.jsx
View file @
2085ada3
...
...
@@ -199,7 +199,7 @@ class FolderList extends React.Component {
htmlTitle
:
folderName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
app
Id
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
YZ_APP
Id
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
that
.
setState
({
previewStatus
:
'UPLOAD_SUCCESS'
,
url
...
...
@@ -216,7 +216,7 @@ class FolderList extends React.Component {
htmlTitle
:
folderName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
fileVersionId
}
&appId=
${
app
Id
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
fileVersionId
}
&appId=
${
YZ_APP
Id
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
...
...
src/modules/resource-disk/modal/PreviewFileModal.jsx
deleted
100644 → 0
View file @
ffe5a5f7
import
React
from
'react'
;
import
"./PreviewFileModal.less"
;
import
{
Spin
}
from
'antd'
class
PreviewFileModal
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
cancelPreView
=
()
=>
{
this
.
props
.
onCancel
();
}
toPreView
=
(
url
)
=>
{
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
a
.
setAttribute
(
'target'
,
'_blank'
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
this
.
props
.
onCancel
();
}
render
()
{
const
{
previewStatus
,
url
}
=
this
.
props
return
(
<
div
className=
"preview-modal"
>
<
div
className=
"preview-modal-content"
>
<
div
className=
"load-img-box"
>
{
previewStatus
===
"UPLOAD"
&&
<
Spin
size=
"large"
/>
}
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
<
img
className=
"load-img"
src=
"https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"
></
img
>
}
</
div
>
<
div
className=
"load-text-box"
>
{
previewStatus
===
"UPLOAD"
&&
<
div
className=
"load-text-box-title"
>
预览生成中
</
div
>
}
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
<
div
className=
"load-text-box-title"
>
预览生成成功
</
div
>
}
</
div
>
<
div
className=
"operate"
>
<
span
className=
"btn cancel-preview-btn"
onClick=
{
()
=>
this
.
cancelPreView
()
}
>
取消预览
</
span
>
{
previewStatus
===
"UPLOAD"
&&
<
span
className=
"btn to-preview-btn__disabled to-preview-btn"
>
去查看
</
span
>
}
{
previewStatus
===
"UPLOAD_SUCCESS"
&&
<
span
className=
"btn to-preview-btn"
onClick=
{
()
=>
this
.
toPreView
(
url
)
}
>
去查看
</
span
>
}
</
div
>
</
div
>
</
div
>
);
}
}
export
default
PreviewFileModal
;
src/modules/resource-disk/modal/PreviewFileModal.less
deleted
100644 → 0
View file @
ffe5a5f7
.preview-modal{
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 102;
height: 100%;
background: rgba(0, 0, 0, 0.7);
.preview-modal-content{
position:absolute;
left:calc(50% - 133px);
top:calc(50% - 87px);
color:#FFF;
text-align:center;
width:266px;
height:174px;
.ant-spin-dot-item{
background-color: #FFF;
}
.load-img-box{
.load-img{
width:44px;
height:44px;
}
}
.load-text-box{
margin-top:23px;
font-size:16px;
color:#FFF;
.load-text-box-title{
margin-bottom:8px;
}
}
.operate{
margin-top:24px;
.btn {
padding:5px 12px;
border:1px solid #E8E8E8;
border-radius:2px;
}
.cancel-preview-btn{
margin-right:8px;
}
.to-preview-btn__disabled{
border:1px solid #E8E8E8;
opacity: 0.4;
}
}
}
}
\ No newline at end of file
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