更新版本库
This commit is contained in:
@ -1,24 +1,35 @@
|
||||
var ntko;//控件对象
|
||||
|
||||
//初始化去打开文档
|
||||
function init(cmd,code,type){
|
||||
ntko = document.getElementById("TANGER_OCX");
|
||||
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(type=="creat"){
|
||||
ntko.CreateNew("Word.Document");
|
||||
}else{//读取
|
||||
ntko.BeginOpenFromURL("/api/ebtp-mall-attachment/v1/download/"+code);//获取文件
|
||||
}
|
||||
if (cmd != "false"){
|
||||
ntko.SetReadOnly(true);//只读
|
||||
}else{
|
||||
ntko.SetReadOnly(false);//可编辑
|
||||
}
|
||||
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;
|
||||
@ -28,3 +39,4 @@ function init(cmd,code,type){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user