Files
fe_service_ebtp_frontend/public/ntko.js
2021-01-16 11:29:42 +08:00

43 lines
1.3 KiB
JavaScript

var ntko;//控件对象
//初始化去打开文档
function init(readonly, DocfileCode) {
ntko = document.getElementById("TANGER_OCX");
$.ajax({
url: "http://125.32.114.204:8760/api/core-service-ebtp-updownload/v1/attachment/find/bid/"+DocfileCode ,
type: "get",
dataType : 'json',
traditional:true,
success: function (result) {
// [{"id":"0f8d98e4-379d-48fc-bd35-649a67256c6e","bid":"888888","filename":"888888.doc"}]
if (window.navigator.platform == "Win64") {
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.2.0", "/ntkooledocallx64.cab", 51, true);
} else {
ntko.AddDocTypePlugin(".pdf", "PDF.NtkoDocument", "4.0.2.0", "/ntkooledocall.cab", 51, true);//版增加对于PDF文件的支持
}
if (result.length>0) {
// @ts-ignore
ntko.BeginOpenFromURL("/api/core-service-ebtp-updownload/v1/attachment/download/bid/" + DocfileCode);
} else {
// @ts-ignore
ntko.CreateNew("Word.Document");
}
ntko.IsUseOfficeConvertDocToPDF=true;
}
//请求失败,包含具体的错误信息
});
// ntko.RibbonBars=false;//打开就啥工具都没有
// ntko.ToolBars=false;
// alert("RibbonBars1"+ntko.RibbonBars)
// alert("ToolBars1"+ntko.ToolBars)
}