update officeweb.ftl
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>${file.name}预览</title>
|
<title>${file.name}预览</title>
|
||||||
<link rel='stylesheet' href='xlsx/plugins/css/pluginsCss.css' />
|
<link rel='stylesheet' href='xlsx/plugins/css/pluginsCss.css' />
|
||||||
@ -11,13 +11,13 @@
|
|||||||
<script src="xlsx/luckysheet.umd.js"></script>
|
<script src="xlsx/luckysheet.umd.js"></script>
|
||||||
<script src="js/watermark.js" type="text/javascript"></script>
|
<script src="js/watermark.js" type="text/javascript"></script>
|
||||||
<script src="js/base64.min.js" type="text/javascript"></script>
|
<script src="js/base64.min.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<#if pdfUrl?contains("http://") || pdfUrl?contains("https://") || pdfUrl?contains("ftp://")>
|
<#if pdfUrl?contains("http://") || pdfUrl?contains("https://") || pdfUrl?contains("ftp://")>
|
||||||
<#assign finalUrl="${pdfUrl}">
|
<#assign finalUrl="${pdfUrl}">
|
||||||
<#else>
|
<#else>
|
||||||
<#assign finalUrl="${baseUrl}${pdfUrl}">
|
<#assign finalUrl="${baseUrl}${pdfUrl}">
|
||||||
</#if>
|
</#if>
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* 初始化水印
|
* 初始化水印
|
||||||
*/
|
*/
|
||||||
@ -57,30 +57,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<body>
|
<body>
|
||||||
<div id="lucky-mask-demo" style="position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px; background: rgba(255, 255, 255, 0.8); text-align: center;font-size: 40px;align-items:center;justify-content: center;display: none;">加载中</div>
|
<div id="lucky-mask-demo" style="position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px; background: rgba(255, 255, 255, 0.8); text-align: center;font-size: 40px;align-items:center;justify-content: center;display: none;">加载中</div>
|
||||||
<p style="text-align:center;">
|
<p style="text-align:center;">
|
||||||
<div id="button-area">
|
<div id="button-area">
|
||||||
<label><button onclick="tiaozhuan()">跳转HTML预览</button></label>
|
<label><button onclick="tiaozhuan()">跳转HTML预览</button></label>
|
||||||
<button id="confirm-button" onclick="print()">打印</button>
|
<button id="confirm-button" onclick="print()">打印</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 20px;bottom: 0px;outline: none;"></div>
|
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 20px;bottom: 0px;outline: none;"></div>
|
||||||
|
|
||||||
<script src="xlsx/luckyexcel.umd.js"></script>
|
<script src="xlsx/luckyexcel.umd.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function tiaozhuan(){
|
function tiaozhuan(){
|
||||||
var test = window.location.href;
|
var test = window.location.href;
|
||||||
test = test.replace(new RegExp("&officePreviewType=xlsx",("gm")),"");
|
test = test.replace(new RegExp("&officePreviewType=xlsx",("gm")),"");
|
||||||
test = test+'&officePreviewType=html';
|
test = test+'&officePreviewType=html';
|
||||||
window.location.href=test;
|
window.location.href=test;
|
||||||
}
|
}
|
||||||
var url = '${finalUrl}';
|
var url = '${finalUrl}';
|
||||||
var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
|
var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
|
||||||
if (!url.startsWith(baseUrl)) {
|
if (!url.startsWith(baseUrl)) {
|
||||||
url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
|
url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
|
||||||
}
|
}
|
||||||
let mask = document.getElementById("lucky-mask-demo");
|
let mask = document.getElementById("lucky-mask-demo");
|
||||||
|
|
||||||
function loadText() {
|
function loadText() {
|
||||||
initWaterMark(); // 是否显示水印
|
initWaterMark(); // 是否显示水印
|
||||||
var value = url;
|
var value = url;
|
||||||
@ -94,7 +93,6 @@
|
|||||||
alert("读取excel文件内容失败!");
|
alert("读取excel文件内容失败!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// console.log(exportJson.sheets);
|
|
||||||
mask.style.display = "none";
|
mask.style.display = "none";
|
||||||
window.luckysheet.destroy();
|
window.luckysheet.destroy();
|
||||||
window.luckysheet.create({
|
window.luckysheet.create({
|
||||||
@ -102,12 +100,8 @@
|
|||||||
lang: "zh",
|
lang: "zh",
|
||||||
showtoolbarConfig:{
|
showtoolbarConfig:{
|
||||||
image: true,
|
image: true,
|
||||||
print: false,
|
print: false, //关闭打印按钮 启用也不能用 等以后看情况而定
|
||||||
},
|
exportXlsx: false, //关闭导出按钮 启用也不能用 等以后看情况而定
|
||||||
hook:{
|
|
||||||
onTogglePager:function(range){
|
|
||||||
// range.data = exportJson.sheets
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
allowCopy: true, // 是否允许拷贝
|
allowCopy: true, // 是否允许拷贝
|
||||||
@ -125,9 +119,15 @@
|
|||||||
showColumnBar: false, // 是否显示列号区域
|
showColumnBar: false, // 是否显示列号区域
|
||||||
sheetFormulaBar: false, // 是否显示公式栏
|
sheetFormulaBar: false, // 是否显示公式栏
|
||||||
enableAddBackTop: true,//返回头部按钮
|
enableAddBackTop: true,//返回头部按钮
|
||||||
|
forceCalculation: false, //下面是导出插件 默认关闭
|
||||||
|
enableAddRow: false, // 允许增加行
|
||||||
|
plugins: [{ name: 'chart' }, { name: 'exportXlsx', config: { url: 'luckyToXlsx' } }, {
|
||||||
|
name: 'print', config: {
|
||||||
|
license: ''
|
||||||
|
}
|
||||||
|
}],
|
||||||
data:exportJson.sheets,
|
data:exportJson.sheets,
|
||||||
title:exportJson.info.name,
|
title:exportJson.info.name,
|
||||||
plugins: ['chart'],
|
|
||||||
userInfo:exportJson.info.name.creator
|
userInfo:exportJson.info.name.creator
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -140,6 +140,6 @@
|
|||||||
document.querySelector('#print-area').style.display = 'block';
|
document.querySelector('#print-area').style.display = 'block';
|
||||||
document.querySelector('#button-area').style.display = 'none';
|
document.querySelector('#button-area').style.display = 'none';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user