Finis the preview feature.

This commit is contained in:
lishuang
2020-06-13 00:44:56 +08:00
parent 34ef6e4ec9
commit cc8d2c8729
3 changed files with 28 additions and 40 deletions
+26 -36
View File
@@ -14,6 +14,7 @@ import NumberUtil from "../../util/NumberUtil";
import SafeUtil from "../../util/SafeUtil";
import ImagePreviewer from "../../../pages/widget/previewer/ImagePreviewer";
import BrowserPreviewer from "../../../pages/widget/previewer/BrowserPreviewer";
import MessageBoxUtil from "../../util/MessageBoxUtil";
export default class Matter extends BaseEntity {
puuid: string = "";
@@ -184,46 +185,35 @@ export default class Matter extends BaseEntity {
ImagePreviewer.showSinglePhoto(previewUrl)
} else if (that.isPdf()) {
} else if (that.isPdf() || that.isText() || that.isAudio() || that.isVideo()) {
BrowserPreviewer.show(that.name, previewUrl, that.size)
} else if (that.isDoc() || that.isPpt() || that.isXls()) {
MessageBoxUtil.warning("Office的预览还没做好")
// //如果是分享中的预览,直接就可以公有访问。
// if (shareMode) {
// Vue.$previewer.previewOffice(that.name, previewUrl, that.size)
// } else {
//
// //如果是共有文件 office文件的预览请求一次性链接。
// if (this.privacy) {
//
// let downloadToken = new DownloadToken()
// downloadToken.httpFetchDownloadToken(that.uuid, function () {
// Vue.$previewer.previewOffice(that.name, that.getPreviewUrl(downloadToken.uuid), that.size)
// })
// } else {
// Vue.$previewer.previewOffice(that.name, previewUrl, that.size)
// }
// }
} else {
window.open(this.getPreviewUrl())
}
// } else if (that.isDoc() || that.isPpt() || that.isXls()) {
//
// //如果是分享中的预览,直接就可以公有访问。
// if (shareMode) {
// Vue.$previewer.previewOffice(that.name, previewUrl, that.size)
// } else {
//
// //如果是共有文件 office文件的预览请求一次性链接。
// if (this.privacy) {
//
// let downloadToken = new DownloadToken()
// downloadToken.httpFetchDownloadToken(that.uuid, function () {
// Vue.$previewer.previewOffice(that.name, that.getPreviewUrl(downloadToken.uuid), that.size)
// })
// } else {
// Vue.$previewer.previewOffice(that.name, previewUrl, that.size)
// }
// }
//
//
// } else if (that.isText()) {
//
// Vue.$previewer.previewText(that.name, previewUrl, that.size)
//
// } else if (that.isAudio()) {
//
// Vue.$previewer.previewAudio(that.name, previewUrl, that.size)
//
// } else if (that.isVideo()) {
//
// Vue.$previewer.previewVideo(that.name, previewUrl, that.size)
//
// } else {
// window.open(this.getPreviewUrl())
// }
}
httpCreateDirectory(
@@ -7,8 +7,7 @@
left: 0;
z-index: 1000;
background: #333;
color: #eee;
background: white;
display: flex;
flex-direction: column;
@@ -19,7 +18,7 @@
text-align: center;
line-height: 40px;
font-size: 16px;
border-bottom: 1px solid #555;
border-bottom: 1px solid #eee;
.close {
float: right;
@@ -3,7 +3,6 @@ import React from "react";
import * as ReactDOM from 'react-dom';
import FileUtil from "../../../common/util/FileUtil";
import {CloseOutlined} from "@ant-design/icons";
import {Tooltip} from "antd";
interface IProps {
name: string