Files
fe_service_ebtp_frontend/public/ntko.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

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