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
ffe5a5f7
Commit
ffe5a5f7
authored
Jun 22, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:永忠优化
parent
9e611ef6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
288 additions
and
97 deletions
+288
-97
src/bu-components/PreviewFileModal.jsx
+57
-0
src/bu-components/PreviewFileModal.less
+54
-0
src/data-source/aidTool/request-apis.ts
+2
-2
src/data-source/base/request-apis.ts
+14
-3
src/domains/basic-domain/baseService.ts
+18
-4
src/domains/basic-domain/constants.ts
+6
-1
src/modules/course-manage/modal/ManageCoursewareModal.jsx
+70
-27
src/modules/resource-disk/components/FolderList.jsx
+67
-60
No files found.
src/bu-components/PreviewFileModal.jsx
0 → 100644
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/bu-components/PreviewFileModal.less
0 → 100644
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
src/data-source/aidTool/request-apis.ts
View file @
ffe5a5f7
/*
* @Author: yuananting
* @Date: 2021-03-03 15:13:12
* @LastEditors:
fusanqiasng
* @LastEditTime: 2021-06-
16 09:57:18
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2021-06-
22 14:31:46
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
src/data-source/base/request-apis.ts
View file @
ffe5a5f7
/*
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors:
zhangleyuan
* @LastEditTime: 2021-0
4-09 14:28:09
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2021-0
6-22 14:56:34
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
Service
from
"@/common/js/service"
;
import
axios
from
'axios'
;
export
function
sendLoginAuthCode
(
params
:
object
)
{
return
Service
.
Hades
(
"anon/hades/sendLoginAuthCode"
,
params
);
}
...
...
@@ -47,6 +47,16 @@ export function getEnterpriseUser(params: object) {
export
function
getWXWorkLoginNoCheck
(
params
:
object
)
{
return
Service
.
Hades
(
'anon/hades/getWXWorkLoginNoCheck'
,
params
);
}
export
function
getYoZoSign
(
params
:
object
)
{
return
Service
.
Apollo
(
'public/apollo/getYoZoSign'
,
params
);
}
export
function
saveYoZoFileVersionId
(
params
:
object
)
{
return
Service
.
Apollo
(
'public/apollo/saveYoZoFileVersionId'
,
params
);
}
export
function
yoZoUpload
(
ossUrl
:
String
,
appId
:
String
,
uploadSign
:
String
){
return
axios
.
post
(
`https://dmc.yozocloud.cn/api/file/http?fileUrl=
${
ossUrl
}
&appId=
${
appId
}
&sign=
${
uploadSign
}
`
)
}
export
const
getOssClient
=
(
data
:
object
,
instId
:
string
,
...
...
@@ -63,3 +73,4 @@ export const getOssClient = (
});
}
src/domains/basic-domain/baseService.ts
View file @
ffe5a5f7
/*
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors:
zhangleyuan
* @LastEditTime: 2021-0
4-09 14:28:59
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2021-0
6-22 14:57:01
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
,
getLastedVersion
,
getEnterpriseUser
,
getWXWorkLoginNoCheck
}
from
'@/data-source/base/request-apis'
;
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
,
getLastedVersion
,
getEnterpriseUser
,
getWXWorkLoginNoCheck
,
getYoZoSign
,
saveYoZoFileVersionId
,
yoZoUpload
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
...
...
@@ -55,5 +55,18 @@ export default class StoreService {
static
getWXWorkLoginNoCheck
(
params
:
any
){
return
getWXWorkLoginNoCheck
(
params
);
}
static
getYoZoSign
(
params
:
any
){
return
new
Promise
((
resolve
)
=>
{
getYoZoSign
(
params
).
then
(
res
=>
{
const
{
result
=
[]
}
=
res
;
resolve
(
result
)
});
})
}
static
saveYoZoFileVersionId
(
params
:
any
){
return
saveYoZoFileVersionId
(
params
);
}
static
yoZoUpload
(
ossUrl
:
String
,
appId
:
String
,
uploadSign
:
String
){
return
yoZoUpload
(
ossUrl
,
appId
,
uploadSign
);
}
}
\ No newline at end of file
src/domains/basic-domain/constants.ts
View file @
ffe5a5f7
/*
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-06-
11 16:44:17
* @LastEditTime: 2021-06-
22 16:49:06
* @LastEditors: Please set LastEditors
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
...
...
@@ -26,6 +26,10 @@ const PATH_MAP: MapInterface = {
prod
:
'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html'
,
}
export
const
YZ_APPId
=
"yozoqvpO2Hvz8346"
;
export
const
YZ_PREVIEW_URL
:
string
=
'http://eic.yozocloud.cn/api/view/file'
export
const
OFFICE_PREVIEW_URL
:
string
=
'https://view.officeapps.live.com/op/view.aspx'
// axios headers config
export
const
TIME_OUT
:
number
=
20000
export
const
USER_TYPE
:
string
=
'B'
...
...
@@ -37,3 +41,4 @@ export const USER_PREFIX = 'store-live'
// host
export
const
BASIC_HOST
:
string
=
BASIC_HOST_MAP
[
ENV
]
export
const
PATH
:
string
=
PATH_MAP
[
ENV
]
src/modules/course-manage/modal/ManageCoursewareModal.jsx
View file @
ffe5a5f7
...
...
@@ -16,6 +16,9 @@ import { FileVerifyMap, FileTypeIcon } from '@/common/constants/academic/lessonE
import
ScanFileModal
from
'@/modules/prepare-lesson/modal/ScanFileModal'
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
Service
from
'@/common/js/service'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
PreviewFileModal
from
'@/bu-components/PreviewFileModal'
;
import
{
YZ_APPId
,
YZ_PREVIEW_URL
,
OFFICE_PREVIEW_URL
}
from
'@/domains/basic-domain/constants'
;
import
'./ManageCoursewareModal.less'
;
...
...
@@ -33,7 +36,10 @@ class ManageCoursewareModal extends React.Component {
scanFileModal
:
false
,
isLessonPermission
:
false
,
diskList
:
[],
// 机构可见的磁盘目录
selectedFileList
:
[]
selectedFileList
:
[],
showPreviewModal
:
false
,
//是否显示loading
previewing
:
false
,
//是否正在预览
previewStatus
:
'UPLOAD'
//预览文件的生成状态
}
}
...
...
@@ -170,11 +176,11 @@ class ManageCoursewareModal extends React.Component {
const
suffix
=
_
.
last
(
item
.
fileName
.
split
(
'.'
)).
toLowerCase
();
const
type
=
suffixType
[
suffix
]
const
fileType
=
FileVerifyMap
[
type
].
type
;
const
that
=
this
;
switch
(
fileType
)
{
case
"PDF"
:
window
.
open
(
item
.
srcDocUrl
,
"_blank"
);
break
;
//
window.open(item.srcDocUrl, "_blank");
//
break;
case
"Excel"
:
case
"EXCEL"
:
case
"PPT"
:
...
...
@@ -183,27 +189,56 @@ class ManageCoursewareModal extends React.Component {
case
"WORD"
:
case
"DOCX"
:
case
"DOC"
:
let
size
=
parseFloat
(
item
.
fileSize
.
replace
(
/M$|KB$/g
,
''
));
if
(
item
.
fileSize
.
includes
(
'KB'
))
{
size
=
0
;
}
if
(((
fileType
==
'word'
||
fileType
==
'PPT'
)
&&
size
>
10
)
||
((
fileType
==
'Excel'
)
&&
size
>
5
))
{
Modal
.
confirm
({
title
:
'抱歉,不能在线预览'
,
content
:
'由于文件较大,不支持在线预览,请下载后再查看'
,
icon
:
<
QuestionCircleOutlined
/>,
okText
:
"下载"
,
onOk
:()
=>
{
const
a
=
document
.
createElement
(
'a'
);
a
.
href
=
item
.
srcDocUrl
;
a
.
click
();
// let size = parseFloat(item.fileSize.replace(/M$|KB$/g, ''));
// if (item.fileSize.includes('KB')) {
// size = 0;
// }
// if (((fileType == 'word' || fileType == 'PPT') && size > 10) || ((fileType == 'Excel') && size > 5)) {
// Modal.confirm({
// title: '抱歉,不能在线预览',
// content: '由于文件较大,不支持在线预览,请下载后再查看',
// icon: <QuestionCircleOutlined />,
// okText:"下载",
// onOk:() => {
// const a = document.createElement('a');
// a.href = item.srcDocUrl;
// a.click();
// }
// });
// } else {
// const scanUrl = "https://view.officeapps.live.com/op/view.aspx?src=" + encodeURIComponent(item.srcDocUrl);
// window.open(scanUrl, "_blank");
// }
this
.
setState
({
previewing
:
true
,
showPreviewModal
:
true
,
previewStatus
:
'UPLOAD'
},
async
()
=>
{
const
uploadParams
=
{
fileUrl
:
item
.
srcDocUrl
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'UPLOAD'
}
});
}
else
{
const
scanUrl
=
"https://view.officeapps.live.com/op/view.aspx?src="
+
encodeURIComponent
(
item
.
srcDocUrl
);
window
.
open
(
scanUrl
,
"_blank"
);
}
break
;
const
uploadSign
=
await
BaseService
.
getYoZoSign
(
uploadParams
);
BaseService
.
yoZoUpload
(
item
.
srcDocUrl
,
YZ_APPId
,
uploadSign
).
then
(
async
function
(
response
){
const
{
previewing
}
=
that
.
state
;
if
(
previewing
){
const
previewParams
=
{
fileVersionId
:
response
.
data
.
data
.
fileVersionId
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
item
.
fileName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
YZ_APPId
}
&sign=
${
previewSign
}
&htmlTitle=
${
item
.
fileName
}
`
that
.
setState
({
previewStatus
:
'UPLOAD_SUCCESS'
,
url
})
}
})
})
break
;
case
"JPG"
:
case
"PNG"
:
case
"MP4"
:
...
...
@@ -214,8 +249,13 @@ class ManageCoursewareModal extends React.Component {
break
;
}
};
cancelPreview
=
()
=>
{
this
.
setState
({
previewing
:
false
,
showPreviewModal
:
false
,
previewStatus
:
'UPLOAD'
})
}
render
()
{
const
columns
=
[
{
...
...
@@ -299,7 +339,7 @@ class ManageCoursewareModal extends React.Component {
const
{
list
,
scanFileModal
,
editData
,
cancelObject
,
showSelectFileModal
,
selectedFileList
,
diskList
diskList
,
showPreviewModal
,
previewStatus
,
url
}
=
this
.
state
;
const
_list
=
_
.
reject
(
list
,
(
item
)
=>
cancelObject
[
item
.
id
]);
return
(
...
...
@@ -365,6 +405,9 @@ class ManageCoursewareModal extends React.Component {
}
}
onSelect=
{
this
.
handleAddFile
}
/>
{
showPreviewModal
&&
<
PreviewFileModal
onCancel=
{
()
=>
this
.
cancelPreview
()
}
previewStatus=
{
previewStatus
}
url=
{
url
}
/>
}
</
Modal
>
)
}
...
...
src/modules/resource-disk/components/FolderList.jsx
View file @
ffe5a5f7
...
...
@@ -21,9 +21,9 @@ import UploadProgressModal from '@/bu-components/UploadProgressModal';
import
SelectPrepareFileModal
from
'@/bu-components/SelectPrepareFileModal'
;
import
CopyFileModal
from
'@/bu-components/CopyFileModal'
;
import
ManagingMembersModal
from
'@/bu-components/ManagingMembersModal'
;
import
PreviewFileModal
from
'
../modal/PreviewFileModal'
import
PreviewFileModal
from
'
@/bu-components/PreviewFileModal'
;
import
{
YZ_APPId
,
YZ_PREVIEW_URL
,
OFFICE_PREVIEW_URL
}
from
'@/domains/basic-domain/constants'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
ScanFileModal
from
'../modal/ScanFileModal'
;
import
CreateFolderModal
from
'../modal/CreateFolderModal'
;
import
User
from
'@/common/js/user'
;
...
...
@@ -121,47 +121,47 @@ class FolderList extends React.Component {
break
;
}
}
getYoZoSign
=
(
data
,
type
,
folderName
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
uploadParams
;
if
(
type
===
"UPLOAD"
){
uploadParams
=
{
fileUrl
:
data
,
instId
:
window
.
currentUserInstInfo
.
instId
,
yoZoTypeEnum
:
'UPLOAD'
}
}
else
{
uploadParams
=
{
fileVersionId
:
data
,
instId
:
window
.
currentUserInstInfo
.
instId
,
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
folderName
}
}
Service
.
Apollo
(
'public/apollo/getYoZoSign'
,
uploadParams
).
then
(
res
=>
{
const
{
result
=
[]
}
=
res
;
resolve
(
result
)
});
})
}
//
getYoZoSign = (data,type,folderName)=>{
//
return new Promise((resolve) => {
//
let uploadParams;
//
if(type==="UPLOAD"){
//
uploadParams ={
//
fileUrl:data,
//
instId:window.currentUserInstInfo.instId,
//
yoZoTypeEnum:'UPLOAD'
//
}
//
}else{
//
uploadParams ={
//
fileVersionId:data,
//
instId:window.currentUserInstInfo.instId,
//
yoZoTypeEnum:'VIEW',
//
htmlTitle:folderName
//
}
//
}
//
Service.Apollo('public/apollo/getYoZoSign', uploadParams).then(res => {
//
const { result = [] } = res;
//
resolve(result)
//
});
//
})
//
}
saveYoZoFileVersionId
=
(
fileVersionId
,
folderId
)
=>
{
const
params
=
{
fileVersionId
,
folderId
,
instId
:
window
.
currentUserInstInfo
.
instId
,
}
Service
.
Apollo
(
'public/apollo/saveYoZoFileVersionId'
,
params
).
then
(
res
=>
{
//
saveYoZoFileVersionId = (fileVersionId,folderId)=>{
//
const params ={
//
fileVersionId,
//
folderId,
//
instId: window.currentUserInstInfo.instId,
//
}
//
Service.Apollo('public/apollo/saveYoZoFileVersionId', params).then(res => {
});
}
//
});
//
}
// 预览文件
handleScanFile
=
async
(
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"
&&
rights
===
"LOOK"
){
switch
(
folderFormat
)
{
case
'PDF'
:
case
'WORD'
:
...
...
@@ -177,24 +177,46 @@ class FolderList extends React.Component {
showPreviewModal
:
true
,
previewStatus
:
'UPLOAD'
},
async
()
=>
{
const
uploadSign
=
await
that
.
getYoZoSign
(
ossUrl
,
"UPLOAD"
);
axios
.
post
(
`https://dmc.yozocloud.cn/api/file/http?fileUrl=
${
ossUrl
}
&appId=
${
appId
}
&sign=
${
uploadSign
}
`
)
.
then
(
async
function
(
response
){
that
.
saveYoZoFileVersionId
(
response
.
data
.
data
.
fileVersionId
,
id
);
const
uploadParams
=
{
fileUrl
:
ossUrl
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'UPLOAD'
}
const
uploadSign
=
await
BaseService
.
getYoZoSign
(
uploadParams
);
BaseService
.
yoZoUpload
(
ossUrl
,
YZ_APPId
,
uploadSign
).
then
(
async
function
(
response
){
const
saveParams
=
{
fileVersionId
:
response
.
data
.
data
.
fileVersionId
,
folderId
:
id
,
instId
:
User
.
getStoreId
(),
}
BaseService
.
saveYoZoFileVersionId
(
saveParams
);
const
{
previewing
}
=
that
.
state
;
if
(
previewing
){
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
}
`
const
previewParams
=
{
fileVersionId
:
response
.
data
.
data
.
fileVersionId
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
folderName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
response
.
data
.
data
.
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
that
.
setState
({
previewStatus
:
'UPLOAD_SUCCESS'
,
url
})
}
})
})
}
else
{
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
previewParams
=
{
fileVersionId
,
instId
:
User
.
getStoreId
(),
yoZoTypeEnum
:
'VIEW'
,
htmlTitle
:
folderName
}
const
previewSign
=
await
BaseService
.
getYoZoSign
(
previewParams
);
const
url
=
`
${
YZ_PREVIEW_URL
}
?fileVersionId=
${
fileVersionId
}
&appId=
${
appId
}
&sign=
${
previewSign
}
&htmlTitle=
${
folderName
}
`
const
a
=
document
.
createElement
(
'a'
);
document
.
body
.
appendChild
(
a
);
a
.
setAttribute
(
'href'
,
url
);
...
...
@@ -234,7 +256,6 @@ class FolderList extends React.Component {
Modal
.
confirm
({
title
:
'抱歉,不能在线预览'
,
content
:
'由于文件较大,不支持在线预览,请下载后再查看'
,
// icon: <Icon type="question-circle" theme="filled" style={{ color: '#FF8534' }}></Icon>,
okText
:
"下载"
,
onOk
:
()
=>
{
const
a
=
document
.
createElement
(
'a'
);
...
...
@@ -244,21 +265,7 @@ class FolderList extends React.Component {
});
break
;
}
// if (folderFormat === 'EXCEL') {
// Modal.confirm({
// title: '抱歉,不能在线预览',
// content: ' 该文件类型不支持在线预览,请下载后再查看',
// // icon: <Icon type="question-circle" theme="filled" style={{ color: '#FF8534' }}></Icon>,
// okText: "下载",
// onOk: () => {
// const a = document.createElement('a');
// a.href = ossUrl;
// a.click();
// }
// });
// break;
// }
const
prefixUrl
=
"https://view.officeapps.live.com/op/view.aspx?src="
;
const
prefixUrl
=
`
${
OFFICE_PREVIEW_URL
}
?src=`
;
const
scanUrl
=
`
${
prefixUrl
}${
encodeURIComponent
(
ossUrl
)}
`
window
.
open
(
scanUrl
,
"_blank"
);
break
;
...
...
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