Files
fe_service_ebtp_frontend/public/ntko.js
2022-03-10 14:24:13 +08:00

42 lines
1.4 KiB
JavaScript

var ntko;//控件对象
//初始化去打开文档
function init(readonly, DocfileCode) {
ntko = document.getElementById("TANGER_OCX");
ntko.Menubar = false;//隐藏窗体左上侧文件菜单
ntko.TitleBar=false;//隐藏窗体左上图标
$.ajax({
url: "/api/core-service-ebtp-updownload/v1/attachment/find/bid/" + DocfileCode,
type: "get",
dataType: 'json',
traditional: true,
success: function (result) {
if (window.navigator.platform == "Win64") {
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.2.0", "officecontrol/ntkooledocallx64.cab", 51, true);
} else {
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.2.0", "officecontrol/ntkooledocall.cab", 51, true);//版增加对于PDF文件的支持
}
if (result.length > 0) {
ntko.BeginOpenFromURL("/api/core-service-ebtp-updownload/v1/attachment/download/bid/" + DocfileCode);
} else {
ntko.CreateNew("Word.Document");
}
/*展示保存按钮*/
if (readonly == "false") {
$("#saveBTN").show();
}
ntko.Menubar = true;//展示窗体左上侧文件菜单
ntko.IsUseOfficeConvertDocToPDF = true;
ntko.CustomToolBar=false;
ntko.FileSave=false;
},
error: function () {
alert("请求文档中心失败,请您关闭当前编辑器,重新打开。")
}
});
}