|
发表于 2017-3-30 15:11:00
|
显示全部楼层
现在所有的报错都解决了,但是还是这样define(function(require) { var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var DocUtils = require('$UI/system/components/justep/docCommon/docUtil');
var officeViewer = require('$UI/system/components/justep/docCommon/officeViewer');
var $OV = officeViewer.$OV;
var OV = officeViewer.OV;
var biz = require('$UI/system/lib/biz');
require('$UI/system/components/justep/common/res');
var justep = require("$UI/system/lib/justep");
var Model = function() {
this.callParent();
};
window.onerror = null;
Model.prototype.dkLoad = function(row) {
debugger;
var url;
var fAttachment = row.val("fAttachment");
var jsonList = eval("(" + fAttachment + ")");
if (jsonList != null && jsonList.length > 0) {
for (var i = 0; i < jsonList.length; i++) {
var docID = jsonList["docID"];
var docName = jsonList["docName"];
var fileID = jsonList["fileID"];
var docPath = jsonList["docPath"];
url = DocUtils.InnerUtils.getdocServerAction({
"docPath" : docPath,
urlPattern : "/repository/file/view/" + fileID + "/last/content",
isFormAction : false,
context : this.getContext()
});
}
}
if (url) {
url = url.split('=')[1];
}
if(!$OV('ov').IsOfficeViewer()){ //判断Office控制是否已打开,若没有则新建控制
$OV('ov').CreateOfficeViewer('100%', '99%'); //新建office控制
}else{
$OV('ov').Close(); //关闭
}
$OV('ov').Toolbars = false; //去年控制工具栏
$OV('ov').Titlebar = false; //去掉控制标题栏
$OV("ov").HttpInit();
$OV("ov").HttpAddpostString("FileID", fileID);
$OV("ov").HttpAddpostString("FileExt", ".doc");
$OV("ov").HttpAddpostString("VersionID", "last");
$OV("ov").HttpAddpostString("PartType", "content");
$OV("ov").HttpOpenFileFromStream(url); //打开Word内容
var errorCode = $OV("ov").GetErrorCode();
if(errorCode!= 0){
alert("office文件打开异常 错误编码["+errorCode+"]");
}
if(this.OVP.partType == "revision" ) {
if($OV("ov").IsWordOpened()){
$OV("ov").ActiveDocument().ShowRevisions = true;
}
}else{
if($OV("ov").IsWordOpened()){
$OV("ov").ActiveDocument().AcceptAllRevisions();
}
}
$OV("ov").DisableHotKey(true);
$OV("ov").DisableViewRightClickMenu(true);
if (this.OVP.showField && $OV("ov").IsWordOpened()) {
$OV("ov").focus();
}
if (this.OVP.programID != "History"){
$OV("ov").DisableOfficeReviewingBar(false);
}
$OV("ov").ProtectDoc(2);
};
Model.prototype.windowReceiver1Receive = function(event) {
debugger;
var self = this;
var row = event.data;
self.dkLoad(row);
};
Model.prototype.load = function() {
$('#ov').attr('showToolbar',false);
$OV('ov').CreateOfficeViewer('100%','100%');
var param = justep.Base64.decode(decodeURIComponent((biz.Request.getParamsFromURL(location.href)["param"])));
this.officeViewerInit(JSON.parse(param));
};
Model.prototype.modelLoad = function(event){
this.load();
};
return Model;
});
|
-
|