Commit a9b0e9e2 by zhangleyuan

Merge branch 'feature/zahngleyuan/20210607/cloud-cass-remodel' into dev

parents 3f881d0e da36abd7
......@@ -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,
......
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>
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment