Files
fe_service_ebtp_frontend/public/webofficeIeComponent.html

210 lines
6.1 KiB
HTML
Raw Permalink Normal View History

2022-03-10 14:24:13 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>招标采购中心 | 文档控件编辑器</title>
<script type="text/javascript" src="officecontrol/jquery.js"></script>
<script type="text/javascript" src="officecontrol/ntko.20220624.js"></script>
<link href="officecontrol/ntkoStyle.css" rel="stylesheet" type="text/css"/>
2022-03-10 14:24:13 +08:00
<script type="text/javascript">
var cmd; //命令类型
var DocfileCode;//doc id
var PDFfileCode;//pdf id
var HTMLfileCode;//HTML id
var readonly;//是否可编辑
var savePDF;//是否保存 pdf
var saveHTML;//是否保存 html
2022-04-01 20:06:34 +08:00
var fileName;//weboffice文件名
2022-03-10 14:24:13 +08:00
var datatext;
var datavalue;
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
//IE下关闭前触发调用的message
function closePostMessage() {
window.opener.postMessage({'type': 'FROM_NTKO_CLOSE','text': getQueryString('varNtkoGUID')}, '*')
}
</script>
<style type="text/css">
.elementPosition {
margin: 10px auto 8px;
width: 1200px;
height: 32px;
text-align: right;
}
.btnStyle {
margin-left: 5px;
padding: 0 15px;
height: 32px;
line-height: 30px;
text-align: center;
border-radius: 2px;
font-size: 14px;
cursor: pointer;
}
.btnStyle01 {
background: #014F8F;
2022-03-10 14:24:13 +08:00
color: #fff;
border: 1px solid #014F8F;
2022-03-10 14:24:13 +08:00
}
.btnStyle02 {
background: #fff;
color: #262626;
border: 1px solid #d9d9d9;
}
.btnStyle02:hover {
background: #fff;
color: #014F8F;
border: 1px solid #014F8F;
2022-03-10 14:24:13 +08:00
}
</style>
</head>
<!--AfterPublishAsPDFToURL-->
<body onload="readonly=getQueryString('readonly');
DocfileCode=getQueryString('DocfileCode');
PDFfileCode=getQueryString('PDFfileCode');
savePDF=getQueryString('savePDF');
HTMLfileCode=getQueryString('HTMLfileCode');
saveHTML=getQueryString('saveHTML');
fileName=decodeURI(getQueryString('fileName'));
2022-03-10 14:24:13 +08:00
init(readonly,DocfileCode);"
onbeforeunload="closePostMessage()"
>
<script language="JScript" for="TANGER_OCX" event="OnCustomButtonOnMenuCmd(btnPos,btnCaption,btnCmdid)">
</script>
<script language="JScript" for="TANGER_OCX" event="AfterOpenFromURL(doc, statusCode)">
if (readonly != "false") {
ntko.SetReadOnly(true);//只读
} else {
ntko.SetReadOnly(false);//可编辑
}
</script>
<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(File, Document)">
</script>
<div style="
background-color: #FFF;
2022-03-10 14:24:13 +08:00
color:white;
height: 56px;
line-height: 56px;
display: flex;
position: relative;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
2022-03-10 14:24:13 +08:00
">
<div style="font-size: 16px; font-weight: 600; color: #014F8F;">
2022-03-10 14:24:13 +08:00
<img src="logo.svg" style="height: 30px; position: absolute; top: 13px; margin-left: 20px; margin-right: 10px;"/>
<span style="position: absolute; left: 70px; font-size: 16px; font-weight: 600; display: inline-block;">中远海运集团采购信息系统 招标采购中心</span>
2022-03-10 14:24:13 +08:00
</div>
</div>
<div class="elementPosition">
<button type="button" class="btnStyle btnStyle02" onclick="generalProp(1)">打开</button>
2022-04-01 20:06:34 +08:00
<button type="button" class="btnStyle btnStyle02" onclick="generalProp(2)">另存为</button>
2022-03-10 14:24:13 +08:00
<button type="button" class="btnStyle btnStyle02" onclick="generalProp(4)">打印</button>
<button type="button" class="btnStyle btnStyle01" id="saveBTN" style="display:none;" onclick="uploadMsg()" >保存</button>
<button type="button" class="btnStyle btnStyle02" onclick="closeBTN()">关闭</button>
</div>
<script type="text/javascript">
function closeBTN() {
var ret2 = confirm("您是否关闭当前页面?")
if (ret2) {
window.open('', '_parent', '');
window.close();
}
}
2022-04-01 20:06:34 +08:00
//调用文档通用属性方法 1-打开 2-保存(另存为) 4-打印
2022-03-10 14:24:13 +08:00
function generalProp(param) {
var name = DocfileCode;
if(fileName != null) {
name = fileName;
}
TANGER_OCX.WebFileName = name + ".doc";
2022-04-01 20:06:34 +08:00
TANGER_OCX.ShowDialog(param);
2022-03-10 14:24:13 +08:00
}
function uploadMsg() {
2022-04-01 20:06:34 +08:00
var docName = DocfileCode;
if(fileName != null) {
docName = fileName;
}
var docMsg = ntkoUpload("Doc",DocfileCode,docName + ".doc");
2022-03-10 14:24:13 +08:00
var msg1 = JSON.parse(docMsg);
if (msg1.success) {
var retMsg = DocfileCode;
window.opener.postMessage({type: 'FROM_RETURN_DOC',text: retMsg}, "*")
if (saveHTML != "true" && savePDF != "true") {
uploadSuccess();
}
}
if (saveHTML == "true") {
2022-04-01 20:06:34 +08:00
var htmlName = HTMLfileCode;
if(fileName != null) {
htmlName = fileName;
}
var htmlMsg = ntkoUpload("HTML",HTMLfileCode,htmlName + ".html");
2022-03-10 14:24:13 +08:00
var msg2 = JSON.parse(htmlMsg);
if (msg2.success == true) {
var retMsg = HTMLfileCode;
window.opener.postMessage({type: 'FROM_RETURN_HTML',text: retMsg}, "*")
}
if (savePDF != "true") {
uploadSuccess();
}
}
if (savePDF == "true") {
2022-04-01 20:06:34 +08:00
ntkoUpload("PDF",PDFfileCode,PDFfileCode + ".pdf");
2022-03-10 14:24:13 +08:00
}
}
function uploadSuccess() {
var ret1 = confirm("已保存成功,是否关闭页面?")
if (ret1) {
window.open('', '_parent', '');
window.close();
}
}
</script>
<script language="JScript" for="TANGER_OCX" event="AfterPublishAsPDFToURL(ret,code)">
var msg = JSON.parse(ret);
if (msg.success == true) {
2022-04-01 20:06:34 +08:00
var pdfName = PDFfileCode;
if(fileName != null) {
pdfName = fileName;
}
var res = ntkoUpdateFile(PDFfileCode, pdfName);
if(res) {
var retMsg = PDFfileCode;
window.opener.postMessage({type: 'FROM_RETURN_PDF',text: retMsg}, "*")
uploadSuccess();
}
2022-03-10 14:24:13 +08:00
}
</script>
<div class="divBody">
<script type="text/javascript" src="officecontrol/ntkoofficecontrol.min.20220624.js"></script>
2022-03-10 14:24:13 +08:00
</div>
</body>
</html>