1,优化URL报错,2,更新OFD组件 3,美化Excel 4,文本方法关闭字节流 5,新增多种类型文件预览 (#419)
1,优化URL报错
2,更新OFD组件
3,美化Excel
4,文本方法关闭字节流
5,新增xmind、eml、epub、"obj", "3ds", "stl", "ply", "off", "3dm", "fbx", "dae", "wrl", "3mf", "ifc","glb","o3dv","gltf","stp","bim","fcstd","step","iges","brep"格式
Co-authored-by: gaoxiongzaq <admin@cxcp.com>
2022-12-28 10:17:06 +08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title>${file.name}文件预览</title>
|
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
|
|
|
|
<#include "*/commonHeader.ftl">
|
2023-01-11 13:26:18 +08:00
|
|
|
<script src="js/base64.min.js" type="text/javascript"></script>
|
1,优化URL报错,2,更新OFD组件 3,美化Excel 4,文本方法关闭字节流 5,新增多种类型文件预览 (#419)
1,优化URL报错
2,更新OFD组件
3,美化Excel
4,文本方法关闭字节流
5,新增xmind、eml、epub、"obj", "3ds", "stl", "ply", "off", "3dm", "fbx", "dae", "wrl", "3mf", "ifc","glb","o3dv","gltf","stp","bim","fcstd","step","iges","brep"格式
Co-authored-by: gaoxiongzaq <admin@cxcp.com>
2022-12-28 10:17:06 +08:00
|
|
|
<#if currentUrl?contains("http://") || currentUrl?contains("https://")>
|
|
|
|
|
<#assign finalUrl="${currentUrl}">
|
|
|
|
|
<#elseif currentUrl?contains("ftp://") >
|
|
|
|
|
<#assign finalUrl="${currentUrl}">
|
|
|
|
|
<#else>
|
|
|
|
|
<#assign finalUrl="${baseUrl}${currentUrl}">
|
|
|
|
|
</#if>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div id="mount">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="xmind/xmind.js"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var url = '${finalUrl}';
|
|
|
|
|
var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
|
|
|
|
|
if (!url.startsWith(baseUrl)) {
|
|
|
|
|
url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
|
|
|
|
|
}
|
|
|
|
|
const init = async () => {
|
|
|
|
|
var windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
|
|
|
var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
|
|
windowWidth = windowWidth-30;
|
|
|
|
|
windowHeight = windowHeight-30;
|
|
|
|
|
windowWidth =windowWidth+"px";
|
|
|
|
|
windowHeight =windowHeight+"px";
|
|
|
|
|
const res = await fetch(url)
|
|
|
|
|
const viewer = new XMindEmbedViewer({
|
|
|
|
|
el: '#mount',
|
|
|
|
|
file: await res.arrayBuffer(),
|
|
|
|
|
styles: {
|
|
|
|
|
'height': windowHeight,
|
|
|
|
|
'width': windowWidth
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
init()
|
|
|
|
|
/*初始化水印*/
|
|
|
|
|
if (!!window.ActiveXObject || "ActiveXObject" in window)
|
|
|
|
|
{
|
|
|
|
|
}else{
|
|
|
|
|
initWaterMark();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|