提交 9165085d 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'feature/add-jg' into 'wrdp'

增加金格iWebOffice控件

See merge request o2oa/o2oa!4211

(cherry picked from commit 5f6ced16)

d9a4d6b2 增加金格控件
4d17fad3 增加金格控件
bf699a1e 增加金格控件
88e8f07e 增加金格控件
上级 fcd6c795
{
"copyright": "金格科技iWebOffice2015智能文档中间件[演示版];V5.0S0xGAAEAAAAAAAAAEAAAAJ0BAACgAQAALAAAAFgHOIQT3Ejo2JZMmSVxBkTixI2YkNh+cy/HGFlQ3HNIRG8j2V9vAnBWM8B384zkV79hltghTpDkba9QJTjGCDkylzhl3rian7v/AFF5DXQ7HdoXpN2imHbGHf8ieQNf672v38ODXJum7VaWv4P3DXzlzdnmzoaTTukFl+3ntFH29dQSjC94c4v0npn9rnXK5OsjJGR5mVGJJd6GWjE9rP3fo+kWCBYzb+bhn2sL+SKoyFjUuSptNHsOn3nRKrXyqkRd+QaHR/MDuKd1kEbUpRqCz9CjgfZFX00Zaz2l6ChA6LmdMMjjECalHZQA9WuxAc7cynGbvNfEgi277ahRpSZHmjKY5s18dJM/t9gdatg5b/dCqnUEn0+HS511XaM3xvy4DCVnD1n8xC9I5w+16NGrtTMiMSZFpc3QJphdShC0j+1l/ZyVj33YM31JmuxkI5SDL2CAfMUNsioseUfpOKvpxdcA7nmwlKrpxNetm9Bq0kwJn/jUU2bQa2c+bPRX82JcmFUwAz0ctOQ+Tyi+MoRpATEYW35KZtWepeDTGHJRfaJR81x8dVU0Lp1TuxtQiw==",
"version": "12,7,0,828",
"clsid": "D89F482C-5045-4DB5-8C53-D2C9EE71D025",
"codeBase": "../o2_lib/iWebOffice/iWebOffice2015.cab",
"version64" : "12,5,0,652",
"clsid64" : "D89F482C-5045-4DB5-8C53-D2C9EE71D024",
"codeBase64": "../o2_lib/iWebOffice/iWebOffice2015.cab"
}
......@@ -207,6 +207,11 @@
"text": MWF.xApplication.process.FormDesigner.LP.modules.office,
"className": "Office"
},
"iWebOffice": {
"icon": "office.png",
"text": "iWebOffice",
"className": "IWebOffice"
},
"statementSelector": {
"icon": "statementSelector.png",
"text": MWF.xApplication.process.FormDesigner.LP.modules.statementSelector,
......
MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
MWF.xApplication.process.FormDesigner.Module.IWebOffice = MWF.FCIWebOffice = new Class({
Extends: MWF.FC$Element,
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/IWebOffice/office.html"
},
initialize: function(form, options){
this.setOptions(options);
this.path = "../x_component_process_FormDesigner/Module/IWebOffice/";
this.cssPath = "../x_component_process_FormDesigner/Module/IWebOffice/"+this.options.style+"/css.wcss";
this._loadCss();
this.moduleType = "element";
this.moduleName = "iWebOffice";
this.form = form;
this.container = null;
this.containerNode = null;
},
_createMoveNode: function(){
this.moveNode = new Element("div", {
"MWFType": "iWebOffice",
"id": this.json.id,
"styles": this.css.moduleNodeMove,
"events": {
"selectstart": function(){
return false;
}
}
}).inject(this.form.container);
},
_createNode: function(){
this.node = this.moveNode.clone(true, true);
this.node.setStyles(this.css.moduleNode);
this.node.set("id", this.json.id);
this.node.addEvent("selectstart", function(){
return false;
});
this.iconNode = new Element("div", {
"styles": this.css.iconNode
}).inject(this.node);
var icon = new Element("div", {
"styles": this.css.iconNodeIcon
}).inject(this.iconNode);
var text = new Element("div", {
"styles": this.css.iconNodeText,
"text": "IWebOffice"
}).inject(this.iconNode);
this.setIcon();
},
_loadNodeStyles: function(){
this.iconNode = this.node.getElement("div").setStyles(this.css.iconNode);
this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
this.setIcon();
},
setIconNode: function(img, txt, color, width){
if (this.iconNode){
this.iconNode.setStyle("width", width);
var icon = this.iconNode.getFirst();
var text = this.iconNode.getLast();
icon.setStyle("background-image", "url("+this.path+this.options.style+"/icon/"+img+".png)");
text.set("text", txt);
text.setStyles({
"color": color,
"width": width-34
});
}
},
setIcon: function(){
if (this.json.officeType=="word"){
this.setIconNode("word", "Word", "#2b5797", 90);
}
if (this.json.officeType=="excel"){
this.setIconNode("excel", "Excel", "#1e7145", 86);
}
if (this.json.officeType=="ppt"){
this.setIconNode("ppt", "PowerPoint", "#d04525", 130);
}
if (this.json.officeType=="other"){
this.setIconNode("office", "Office", "#f36523", 96);
}
},
_setEditStyle_custom: function(name){
if (name=="officeType"){
this.setIcon();
}
}
});
{
"moduleNodeMove": {
"border": "2px dashed #ffa200",
"height": "22px",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"display": "block",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "absolute",
"z-index": 10002,
"opacity": 0.7,
"width": "100px",
"cursor": "move",
"background-color": "#EEE"
},
"moduleNodeShow": {
"border": "1px dashed #333",
"height": "2px",
"cursor": "pointer",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"display": "block",
"top": "auto",
"left": "auto",
"width": "auto",
"opacity": 0.5,
"background": "#ffa200"
},
"moduleNode": {
"border": "1px dashed #333",
"min-height": "300px",
"cursor": "pointer",
"line-height": "22px",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"display": "block",
"top": "auto",
"left": "auto",
"width": "auto",
"opacity": 1,
"background-color": "#ffffff"
},
"iconNode": {
"width": "100px",
"height": "34px",
"color": "#999",
"font-size": "12px",
"margin": "auto",
"margin-top": "36px",
// "background": "#FFF",
"position": "static",
"float": "none"
},
"iconNodeIcon":{
"width": "34px",
"height": "34px",
"background": "url("+"../x_component_process_FormDesigner/Module/Office/default/icon/office.png) 5px center no-repeat",
"float": "left"
},
"iconNodeText":{
"line-height": "34px",
"height": "34px",
"width": "66px",
"float": "right",
"font-family": "Gadugi",
"font-weight": "bold",
"font-size": "16px",
"color": "#f36523"
}
}
\ No newline at end of file
<div style="background-color: #FFF; overflow: hidden">
<div title="{{$.lp.base}}" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle" colspan="2"><div style="text-align:center; color: red;">{{$.lp.ieOnly}}</div></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.id}}:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.name}}:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.description}}:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.readonly}}:</td>
<td class="editTableValue">
<input type="radio" name="isReadonly" value="true" text{($.isReadonly)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isReadonly" value="false" text{(!$.isReadonly)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.delayedLoading}}:</td>
<td class="editTableValue">
<input type="radio" name="isNotLoadNow" value="true" text{($.isNotLoadNow)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isNotLoadNow" value="false" text{(!$.isNotLoadNow)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableValue" colspan="2">
<b>{{$.lp.showSummary}}:</b>
<input type="radio" name="isShowSummary" value="true" text{($.isShowSummary!==false)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isShowSummary" value="false" text{($.isShowSummary===false)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="{{$.lp.style}}"></div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.type}}:</td>
<td class="editTableValue">
<input class="editTableRadio" onclick="if (this.checked) $('officeTemplateArea').setStyle('display', 'none'); " name="officeType" text{($.officeType=='word')?'checked':''} type="radio" value="word"/>Word<br/>
<input class="editTableRadio" onclick="if (this.checked) $('officeTemplateArea').setStyle('display', 'none'); " name="officeType" text{($.officeType=='excel')?'checked':''} type="radio" value="excel"/>Excel<br/>
<input class="editTableRadio" onclick="if (this.checked) $('officeTemplateArea').setStyle('display', 'none'); " name="officeType" text{($.officeType=='ppt')?'checked':''} type="radio" value="ppt"/>PowerPoint<br/>
<input class="editTableRadio" onclick="if (this.checked) $('officeTemplateArea').setStyle('display', 'block'); " name="officeType" text{($.officeType=='other')?'checked':''} type="radio" value="other"/>{{$.lp.byTemplate}}
</td>
</tr>
</table>
<div id="officeTemplateArea" title="src" style="display: text{($.officeType=='other')?'block':'none'}">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.templatePath}}:</td>
<td class="editTableValue">
<input type="text" name="template" value="text{$.template}" class="editTableInput"/>
</td>
</tr>
</table>
</div>
<div class="MWFScriptArea" name="readScript" title="{{$.lp.readonlyCondition}} (S)"></div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<!-- <tr>-->
<!-- <td class="editTableTitle">{{$.lp.userTitle}}:</td>-->
<!-- <td class="editTableValue"><input type="text" name="productCaption" value="text{$.productCaption}" class="editTableInput"/></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="editTableTitle">{{$.lp.userId}}:</td>-->
<!-- <td class="editTableValue"><input type="text" name="productKey" value="text{$.productKey}" class="editTableInput"/></td>-->
<!-- </tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">授权标题:</td>-->
<!--<td class="editTableValue"><input type="text" name="makerCaption" value="text{$.makerCaption}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">授权标识:</td>-->
<!--<td class="editTableValue"><input type="text" name="makerKey" value="text{$.makerKey}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">控件版本:</td>-->
<!--<td class="editTableValue"><input type="text" name="version" value="text{$.version}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">classid:</td>-->
<!--<td class="editTableValue"><input type="text" name="clsid" value="text{$.clsid}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">控件路径:</td>-->
<!--<td class="editTableValue"><input type="text" name="codeBase" value="text{$.codeBase}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">classid64位:</td>-->
<!--<td class="editTableValue"><input type="text" name="clsid64" value="text{$.clsid64}" class="editTableInput"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="editTableTitle">控件路径64位:</td>-->
<!--<td class="editTableValue"><input type="text" name="codeBase64" value="text{$.codeBase64}" class="editTableInput"/></td>-->
<!--</tr>-->
</table>
</div>
<div title="{{$.lp.edit}}" class="MWFTab">
<div style="height: 28px; font-weight: bold; line-height:28px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">{{$.lp.toolbar}}</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.tools}}</td>
<td class="editTableValue">
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('new')!=-1)?'checked':''} type="checkbox" value="new"/>{{$.lp.newDoc}}
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('open')!=-1)?'checked':''} type="checkbox" value="open"/>{{$.lp.openLocal}}
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('save')!=-1)?'checked':''} type="checkbox" value="save"/>{{$.lp.saveLocal}}
<br/>
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('revisions')!=-1)?'checked':''} type="checkbox" value="revisions"/>{{$.lp.traceSwitch}}
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('toolbar')!=-1)?'checked':''} type="checkbox" value="toolbar"/>{{$.lp.toolbarSwitch}}
<input class="editTableRadio" name="menuEditButtons" text{(($.menuEditButtons) && $.menuEditButtons.indexOf('preview')!=-1)?'checked':''} type="checkbox" value="preview"/>{{$.lp.printPreview}}
</td>
</tr>
</table>
<div style="height: 28px; font-weight: bold; line-height:28px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">{{$.lp.attribute}}:</div>
<!--<div style="background-color: #eeeeee; height: 24px; line-height: 24px; text-align: center;">界面相关</div>-->
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.showMenuBar}}:</b>
<input class="editTableRadio" name="iWebOfficeEditProperties.Menubar" text{($.iWebOfficeEditProperties.Menubar=='1')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeEditProperties.Menubar" text{($.iWebOfficeEditProperties.Menubar!='1')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.showToolBar}}:</b>
<input class="editTableRadio" name="iWebOfficeEditProperties.ToolBars" text{($.iWebOfficeEditProperties.ToolBars!='0')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeEditProperties.ToolBars" text{($.iWebOfficeEditProperties.ToolBars=='0')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.noCopy}}:</b>
<input class="editTableRadio" name="iWebOfficeEditProperties.IsNoCopy" text{($.iWebOfficeEditProperties.IsNoCopy=='1')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeEditProperties.IsNoCopy" text{($.iWebOfficeEditProperties.IsNoCopy!='1')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.keepTraces}}:</b>
<input class="editTableRadio" name="trackRevisions" text{($.trackRevisions=='1')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="trackRevisions" text{($.trackRevisions!='1')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
</table>
<div class="MWFMaplist" name="editProperties" title="{{$.lp.otherAttr}}"></div>
</div>
<div title="{{$.lp.read}}" class="MWFTab">
<div style="height: 28px; font-weight: bold; line-height:28px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">{{$.lp.toolbar}}</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.toolbar}}</td>
<td class="editTableValue">
<input class="editTableRadio" name="menuReadButtons" text{(($.menuReadButtons) && $.menuReadButtons.indexOf('revisions')!=-1)?'checked':''} type="checkbox" value="revisions"/>{{$.lp.traceSwitch}}
<input class="editTableRadio" name="menuReadButtons" text{(($.menuReadButtons) && $.menuReadButtons.indexOf('toolbar')!=-1)?'checked':''} type="checkbox" value="toolbar"/>{{$.lp.toolbarSwitch}}
<input class="editTableRadio" name="menuReadButtons" text{(($.menuReadButtons) && $.menuReadButtons.indexOf('preview')!=-1)?'checked':''} type="checkbox" value="preview"/>{{$.lp.printPreview}}
</td>
</tr>
</table>
<!--<div style="background-color: #eeeeee; height: 24px; line-height: 24px; text-align: center;">界面相关</div>-->
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.showMenuBar}}:</b>
<input class="editTableRadio" name="iWebOfficeReadProperties.Menubar" text{($.iWebOfficeReadProperties.Menubar=='1')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeReadProperties.Menubar" text{($.iWebOfficeReadProperties.Menubar!='1')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.showToolBar}}:</b>
<input class="editTableRadio" name="iWebOfficeReadProperties.ToolBars" text{($.iWebOfficeReadProperties.ToolBars!='0')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeReadProperties.ToolBars" text{($.iWebOfficeReadProperties.ToolBars=='0')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
<tr><td class="editTableValue" colspan="2">
<b>{{$.lp.noCopy}}:</b>
<input class="editTableRadio" name="iWebOfficeReadProperties.IsNoCopy" text{($.iWebOfficeReadProperties.IsNoCopy=='1')?'checked':''} type="radio" value="1"/>{{$.lp.yes}}
<input class="editTableRadio" name="iWebOfficeReadProperties.IsNoCopy" text{($.iWebOfficeReadProperties.IsNoCopy!='1')?'checked':''} type="radio" value="0"/>{{$.lp.no}}
</td></tr>
</table>
<div class="MWFMaplist" name="readProperties" title="{{$.lp.otherAttr}}"></div>
</div>
<div title="{{$.lp.event}}" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="HTML" class="MWFTab">
<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
{
"id": "",
"name": "",
"type": "IWebOffice",
"description": "",
"officeType": "word",
"template": "",
"isNotLoadNow": false,
"trackRevisions" : "0",
"script": {
"code": "",
"html": ""
},
"iWebOfficeEditProperties": {
"Menubar": "0",
"ToolBars": "1",
"IsNoCopy": "0"
},
"iWebOfficeReadProperties": {
"Menubar": "0",
"ToolBars": "0",
"IsNoCopy": "0"
},
"menuReadButtons": ["revisions","fullscreen","preview"],
"menuEditButtons": ["revisions","fullscreen","toolbar","preview"],
"events": {
"afterOpen": {
"code": "",
"html": ""
},
"afterCreate": {
"code": "",
"html": ""
},
"beforeSave": {
"code": "",
"html": ""
},
"afterSave": {
"code": "",
"html": ""
}
},
"properties": {},
"class": "",
"styles": {},
"container": ""
}
......@@ -26,7 +26,7 @@ MWF.xDesktop.requireApp("process.FormDesigner", "Module.Datagrid", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Datatable", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Datatemplate", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Subform", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.ViewSelector", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.ViewSelector", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.View", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Stat", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Html", null, false);
......@@ -39,6 +39,7 @@ MWF.xDesktop.requireApp("process.FormDesigner", "Module.Iframe", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Documenteditor", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Htmleditor", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Office", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.IWebOffice", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Attachment", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Orgfield", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Org", null, false);
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
MWF.xApplication.process.Xform.IWebOffice = MWF.APPIWebOffice = new Class({
Extends: MWF.APP$Module,
options:{
"copyright": "金格科技iWebOffice2015智能文档中间件[演示版];V5.0S0xGAAEAAAAAAAAAEAAAAJ0BAACgAQAALAAAAFgHOIQT3Ejo2JZMmSVxBkTixI2YkNh+cy/HGFlQ3HNIRG8j2V9vAnBWM8B384zkV79hltghTpDkba9QJTjGCDkylzhl3rian7v/AFF5DXQ7HdoXpN2imHbGHf8ieQNf672v38ODXJum7VaWv4P3DXzlzdnmzoaTTukFl+3ntFH29dQSjC94c4v0npn9rnXK5OsjJGR5mVGJJd6GWjE9rP3fo+kWCBYzb+bhn2sL+SKoyFjUuSptNHsOn3nRKrXyqkRd+QaHR/MDuKd1kEbUpRqCz9CjgfZFX00Zaz2l6ChA6LmdMMjjECalHZQA9WuxAc7cynGbvNfEgi277ahRpSZHmjKY5s18dJM/t9gdatg5b/dCqnUEn0+HS511XaM3xvy4DCVnD1n8xC9I5w+16NGrtTMiMSZFpc3QJphdShC0j+1l/ZyVj33YM31JmuxkI5SDL2CAfMUNsioseUfpOKvpxdcA7nmwlKrpxNetm9Bq0kwJn/jUU2bQa2c+bPRX82JcmFUwAz0ctOQ+Tyi+MoRpATEYW35KZtWepeDTGHJRfaJR81x8dVU0Lp1TuxtQiw==",
"version": "12,7,0,828",
"clsid": "D89F482C-5045-4DB5-8C53-D2C9EE71D025",
"codeBase": "../o2_lib/iWebOffice/iWebOffice2015.cab",
"version64" : "12,5,0,652",
"clsid64" : "D89F482C-5045-4DB5-8C53-D2C9EE71D024",
"codeBase64": "../o2_lib/iWebOffice/iWebOffice2015.cab",
"moduleEvents": [,
"afterOpen",
"afterCreate",
"beforeSave",
"afterSave"
]
},
initialize: function(node, json, form, options){
this.node = $(node);
this.node.store("module", this);
this.json = json;
this.form = form;
this.field = true;
this.openedAttachment = null;
},
_loadUserInterface: function(){
this.node.empty();
this.node.setStyles({
"min-height": "100px"
});
if (Browser.name==="ie"){
this.file = null;
if (!this.form.officeList) this.form.officeList=[];
this.form.officeList.push(this);
}
},
_afterLoaded: function(){
if (Browser.name==="ie"){
if(!layout.serviceAddressList["x_jg_assemble_control"]){
this.node.set("html","<h3><font color=red>please install weboffice !!!</font></h3>");
return false;
}else{
var host = layout.serviceAddressList["x_jg_assemble_control"].host;
var port = layout.serviceAddressList["x_jg_assemble_control"].port;
this.webUrl = layout.protocol + "//" + host + ":" + port + "/x_jg_assemble_control/IndexServlet";
}
this.action = o2.Actions.load("x_jg_assemble_control");
if (!this.json.isNotLoadNow){
this.data = this.getData();
if(this.data.documentId === ""){
this.createDocument(function (){
this.loadOffice();
}.bind(this));
}else {
this.documentId = this.data.documentId;
this.loadOffice();
}
}
if (!this.json.isNotLoadNow){
this.loadOffice();
}
}else {
//console.log(JSON.stringify(this.json))
this.node.set("html","<h3><font color=red>只支持ie浏览器!</font></h3>");
}
},
createDocument : function (callback){
this.action.ManageJGAction.create({"fileType":this.getFileType()}, function( json ){
this.fireEvent("afterCreate");
this.documentId = json.data.message;
this.setData();
if (callback) callback();
}.bind(this),null, false);
},
createNew : function (){
this.officeOCX.CreateFile();
},
getData: function(){
var data = {
"documentId" : ""
};
if(this.form.businessData.data[this.json.id]){
data.documentId = this.form.businessData.data[this.json.id].documentId;
}
return data;
},
setData: function(){
var data = {
"documentId" : this.documentId
};
this._setBusinessData(data);
},
loadOffice: function(){
if (!this.officeLoaded){
MWF.getJSON("../o2_lib/iWebOffice/config.json", function(json){
this.officeConfig = json;
}.bind(this), false);
this.loadOfficeContorl();
this.officeLoaded = true;
}
},
defaultParam: function(readonly){
var o = {
"copyright": this.json.copyright || this.options.copyright
};
return o;
},
loadOfficeContorl: function(file){
if (this.node.getSize().y<800) this.node.setStyle("height", "800px");
if (!layout.desktop.offices) layout.desktop.offices = {};
layout.desktop.offices[this.getOfficeObjectId()] = this;
if (this.json.isReadonly){
this.readonly = true;
}else if (this.json.readScript && this.json.readScript.code){
var flag = this.form.Macro.exec(this.json.readScript.code, this);
if (flag){
this.readonly = true;
}
}
this.loadOfficeEditor();
},
loadOfficeSpacer: function(){
var size = this.node.getSize();
this.officeNode = new Element("div#officeNode", {
"styles": this.form.css.officeAreaNode
}).inject(this.node);
var y = size.y-40;
this.officeNode.setStyle("height", ""+y+"px");
this.form.app.addEvent("uncurrent", function(){
var display = this.officeNode.getStyle("display");
this.officeNode.store("officeDisplay", display);
this.officeNode.setStyle("display", "none");
}.bind(this));
this.form.app.addEvent("current", function(){
var display = this.officeNode.retrieve("officeDisplay");
if (display) this.officeNode.setStyle("display", display);
if (this.officeOCX) this.officeOCX.Activate(true);
}.bind(this));
this.form.app.addEvent("queryClose", function(){
this.fireEvent("queryClose");
var id = this.getOfficeObjectId();
layout.desktop.offices[id] = null;
delete layout.desktop.offices[id];
}.bind(this));
},
hide: function(){
if (this.officeNode.getStyle("display")!="none"){
var display = this.officeNode.getStyle("display");
this.officeNode.store("officeDisplay", display);
this.officeNode.setStyle("display", "none");
}
},
show: function(){
if ((layout.desktop.currentApp && layout.desktop.currentApp.appId===this.form.app.appId) || this.form.app.inBrowser){
var display = this.officeNode.retrieve("officeDisplay");
if (display) this.officeNode.setStyle("display", display);
if (this.officeOCX) this.officeOCX.Activate(true);
}
},
getFormId: function(){
var id = (!this.form.businessData.workCompleted) ? this.form.businessData.work.id : this.form.businessData.workCompleted.id;
return "form"+this.json.id+id;
},
getFileType: function(){
var ename = "docx";
switch (this.json.officeType){
case "word":
ename = "docx";
break;
case "excel":
ename = "xlsx";
break;
case "ppt":
ename = "pptx";
}
return ename;
},
getOfficeObjectId: function(){
var id = (!this.form.businessData.workCompleted) ? this.form.businessData.work.id : this.form.businessData.workCompleted.id;
return "WebOffice"+this.json.id+id;
},
loadOfficeEditor: function(){
if (!this.officeOCX){
this.loadOfficeSpacer();
this.node.setStyle("pisition", "absolute");
var codeBase = this.officeConfig.codeBase || this.json.codeBase || this.options.codeBase;
var version = this.officeConfig.version || this.json.version || this.options.version;
var classid = this.officeConfig.classid || this.json.clsid || this.options.clsid;
var codeBase64 = this.officeConfig.codeBase64 || this.json.codeBase64 || this.options.codeBase64;
var classid64 = this.officeConfig.classid64 || this.json.clsid64 || this.options.clsid64;
var objectHtml = "";
if(window.navigator.platform=="Win64"){
objectHtml = "<form id='"+this.getFormId()+"' style='height:100%'><OBJECT id=\""+this.getOfficeObjectId()+"\" " +
"style=\"HEIGHT: 99%; WIDTH: 100%\" " +
"codeBase=\""+codeBase64+"#version="+version+"\" " +
"classid=\"clsid:"+classid64+"\">";
}else{
objectHtml = "<form id='"+this.getFormId()+"' style='height:100%'><OBJECT id=\""+this.getOfficeObjectId()+"\" " +
"style=\"HEIGHT: 99%; WIDTH: 100%\" " +
"codeBase=\""+codeBase+"#version="+version+"\" " +
"classid=\"clsid:"+classid+"\">";
}
var pars = this.defaultParam();
pars = Object.merge(pars, this.json.ntkoEditProperties);
pars = Object.merge(pars, this.json.editProperties);
Object.each(pars, function(p, key){
objectHtml += "<PARAM NAME=\""+key+"\" value=\""+p+"\">";
});
objectHtml += "</OBJECT></form>";
this.officeNode.appendHTML(objectHtml);
this.officeForm = this.officeNode.getFirst();
}
setTimeout(function() {this.loadIwebOfficeEditor()}.bind(this), 3000);
},
loadIwebOfficeEditor : function (){
// this.officeOCX.EditType="1,1"; //EditType:编辑类型 方式一、方式二 <参考技术文档>
// //第一位可以为0,1,2,3 其中:0不可编辑;1可以编辑,无痕迹;2可以编辑,有痕迹,不能修订;3可以编辑,有痕迹,能修订;
// //第二位可以为0,1 其中:0不可批注,1可以批注。可以参考iWebOffice2009的EditType属性,详细参考技术白皮书
// //以下为自定义菜单↓
// this.officeOCX.AppendMenu("1","打开本地文件(&L)", png10);
// this.officeOCX.AppendMenu("2","保存本地文件(&S)", png2);
// this.officeOCX.AppendMenu("3","保存到服务器(&U)", png7);
// this.officeOCX.AppendMenu("7","-");
// this.officeOCX.AppendMenu("11","保存并退出(&E)", png4);
// this.officeOCX.AppendMenu("12","-");
// this.officeOCX.AppendMenu("13","打印文档(&P)", png13);
// //以上为自定义菜单↑
// //this.officeOCX.VersionFontColor = "bfdbff";
// this.officeOCX.AllowEmpty = true;
this.officeOCX = document.getElementById(this.getOfficeObjectId()).FuncExtModule;
this.officeOCX.WebUrl = this.webUrl; //WebUrl:系统服务器路径,与服务器文件交互操作,如保存、打开文档,重要文件
this.officeOCX.FileName = "文件正文.docx"; //FileName:文档名称
this.officeOCX.UserName = layout.desktop.session.user.name; //UserName:操作用户名,痕迹保留需要
this.officeOCX.RecordID = this.documentId;
this.officeOCX.FileType="." + this.getFileType(); //FileType:文档类型 .doc .xls .wps
if(this.readonly){
this.officeOCX.EditType="0,0";
}
this.officeOCX.ShowMenu = this.json.iWebOfficeEditProperties.Menubar; //控制整体菜单显示
this.officeOCX.ShowToolBar = this.json.iWebOfficeEditProperties.ToolBars; //ShowToolBar:是否显示工具栏:1显示,0不显示
this.officeOCX.ShowWindow = false; //控制显示打开或保存文档的进度窗口,默认不显示
this.officeOCX.MaxFileSize = 32 * 1024; //最大的文档大小控制,默认是8M,现在设置成4M。
this.officeOCX.Print="1";
this.officeOCX.WebOpen();
this.fireEvent("afterOpen");
this.loadMenu();
if(!this.readonly){
if(this.json.iWebOfficeEditProperties.IsNoCopy === "1"){
this.unableCopy();
}else {
this.enableCopy();
}
if(this.json.trackRevisions === "1"){
this.showRevision();
}else {
this.hideRevision();
}
}else {
if(this.json.iWebOfficeReadProperties.IsNoCopy === "1"){
this.unableCopy();
}else {
this.enableCopy();
}
}
},
setBookMark : function (name,value){
if (!this.officeOCX.WebSetBookMarks(name,value)){
//console.log("公文域内容设置失败");
//console.log(WebOffice.Status);
}else{
//alert("公文域内容设置成功");
//console.log(WebOffice.Status);
}
},
getBookMark : function (name){
return this.officeOCX.WebGetBookMarks(name);
},
openLocal : function (){
try{
this.officeOCX.WebOpenLocal();
}catch(e){this.officeOCX.Alert(e.description);}
},
saveLocal : function (){
try{
this.officeOCX.WebSaveLocal();
this.officeOCX.Alert("success");
}catch(e){
this.officeOCX.Alert(e.description);
}
},
savePdf : function (){
try{
if(this.officeOCX.WebSavePDF())
{
this.officeOCX.Alert("success");
}
else{
this.officeOCX.Alert("error");
}
} catch(e){
alert(e.description);
}
},
print : function (){
try{
var falg = this.officeOCX.WebOpenPrint();
//alert(falg);
}catch(e){alert(e.description);}
},
protect : function (){
try{
this.officeOCX.WebSetProtect(true,""); //""表示密码为空
}catch(e){this.officeOCX.Alert(e.description);}
},
unProtect : function (){
try{
this.officeOCX.WebSetProtect(false,""); //""表示密码为空
}catch(e){this.officeOCX.Alert(e.description);}
},
enableCopy : function (){
try{
this.officeOCX.CopyType=true;
}catch(e){this.officeOCX.Alert(e.description);}
},
unableCopy : function (){
try{
this.officeOCX.CopyType=false;
}catch(e){this.officeOCX.Alert(e.description);}
},
showRevision : function (){
this.officeOCX.WebShow(true);
},
hideRevision : function (){
this.officeOCX.WebShow(false);
},
acceptAllRevisions : function (){
this.officeOCX.WebObject.Application.ActiveDocument.AcceptAllRevisions();
var mCount = this.officeOCX.WebObject.Application.ActiveDocument.Revisions.Count;
if(mCount>0){
return false;
}else{
return true;
}
},
isEmpty : function(){
},
save: function(){
if (!this.readonly){
this.fireEvent("beforeSave");
var ret = this.officeOCX.WebSave(); //交互OfficeServer的OPTION="SAVEFILE"
if (ret){
//this.officeOCX.Alert(this.officeOCX.Status);
}else{
//alert(this.officeOCX.Status);
}
this.fireEvent("afterSave");
}
},
loadMenu: function(){
if (!this.isMenuLoad){
if (this.json.menuEditButtons && this.json.menuEditButtons.length){
this.menuNode = new Element("div", {"styles": this.form.css.officeMenuNode}).inject(this.node, "top");
MWF.require("MWF.widget.Toolbar", function(){
this.toolbarWidget = new MWF.widget.Toolbar(this.menuNode, {"style": "xform_blue_simple"}, this);
if (this.json.menuEditButtons.indexOf("new")!==-1){
this.newItem = this.createMenuAction("menu_new", "", "99.png");
}
if (this.json.menuEditButtons.indexOf("open")!==-1){
this.openItem = this.createMenuAction("menu_openfile", "", "77.png");
}
if (this.json.menuEditButtons.indexOf("save")!==-1){
this.saveItem = this.createMenuAction("menu_savefile", "", "67.png");
}
if (this.json.menuEditButtons.indexOf("revisions")!==-1){
var text = MWF.xApplication.process.Xform.LP.menu_revisions_show;
try {
if (this.officeOCX.ActiveDocument.ActiveWindow.View.RevisionsFilter.Markup !== 0){
text = MWF.xApplication.process.Xform.LP.menu_revisions_hide;
}
}catch(e){}
this.revisionsItem = this.createMenuAction("revisions", text, "76.png");
}
if (this.json.menuEditButtons.indexOf("toolbar")!==-1){
if (!this.readonly){
var text = MWF.xApplication.process.Xform.LP.menu_toolbar_show;
if (this.officeOCX.ToolBars){
text = MWF.xApplication.process.Xform.LP.menu_toolbar_hide;
}
this.toolbarItem = this.createMenuAction("toolbar", text, "91.png");
}
}
if (this.json.menuEditButtons.indexOf("preview")!==-1){
this.fullscreenItem = this.createMenuAction("menu_preview", "", "21.png");
}
this.toolbarWidget.load();
}.bind(this));
}
this.isMenuLoad = true;
}
},
createMenuAction: function(id, title, img){
var title = title || MWF.xApplication.process.Xform.LP[id];
return new Element("div", {
"MWFnodeid": id,
"MWFnodetype": "MWFToolBarButton",
"MWFButtonImage": this.form.path+""+this.form.options.style+"/actionbar/"+img,
"title": title,
"MWFButtonAction": "menuAction",
"MWFButtonText": title
}).inject(this.menuNode);
},
menuAction: function(button){
switch (button.buttonID){
case "menu_new":
this.createNew();
break;
case "menu_openfile":
this.openLocal();
break;
case "menu_savefile":
this.saveLocal();
break;
case "revisions":
this.toggleRevisions(button);
break;
case "toolbar":
// var text = (this.officeOCX.ToolBars) ? MWF.xApplication.process.Xform.LP.menu_toolbar_show : MWF.xApplication.process.Xform.LP.menu_toolbar_hide;
// button.setText(text);
// this.officeOCX.ToolBars = !this.officeOCX.ToolBars;
break;
case "menu_preview":
this.print();
break;
}
},
toggleRevisions: function(button){
var t = this.revisionsItem.get("text");
if (t===MWF.xApplication.process.Xform.LP.menu_revisions_show){
button.setText(MWF.xApplication.process.Xform.LP.menu_revisions_hide);
this.showRevision();
}else{
button.setText(MWF.xApplication.process.Xform.LP.menu_revisions_show);
this.hideRevision();
}
},
validationMode: function(){},
validation: function(){return true}
});
......@@ -30,6 +30,7 @@ MWF.xApplication.process.Xform.require = function(callback){
["process.Xform", "Iframe"],
["process.Xform", "Htmleditor"],
["process.Xform", "Office"],
["process.Xform", "IWebOffice"],
["process.Xform", "Attachment"],
["process.Xform", "Actionbar"],
["process.Xform", "Sidebar"],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册