提交 5b7c41d3 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'feature/portalDesigner_smartbi' into 'wrdp'

门户页面SmartBI组件增加

See merge request o2oa/o2oa!5570
MWF.xApplication.portal.PageDesigner.Module.SmartBI = MWF.PCSmartBI = new Class({
Extends: MWF.FCSmartBI,
Implements: [Options, Events]
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_portal_PageDesigner/Module/SmartBI/smartbi.html"
},
initialize: function(form, options){
this.setOptions(options);
this.path = "../x_component_portal_PageDesigner/Module/SmartBI/";
this.cssPath = "../x_component_portal_PageDesigner/Module/SmartBI/"+this.options.style+"/css.wcss";
this._loadCss();
this.moduleType = "container";
this.moduleName = "SmartBI";
this.Node = null;
this.form = form;
},
});
{
"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 #F56C6C",
"min-height": "200px",
"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",
"height": "auto",
"opacity": 1,
"background-color": "#ffffff",
"padding":"5px",
"height":"500px"
},
"nodeContainer":{
"margin-top":"20px",
"font-size":"20px",
"color":"#f52d2d",
"margin":"20px auto",
"width":"300px",
"height":"100px"
},
"nodeIcon":{
"float":"left",
"width":"48px",
"height":"32px",
"background": "url("+"../x_component_portal_PageDesigner/Module/SmartBI/default/icon/smartbi-32.png) center no-repeat",
},
"nodeTxt":{
"float":"left",
"line-height":"32px"
},
"iframe":{
"width":"100%",
"height":"100%",
"min-height":"500px"
},
"propertyRefreshResourceNode":{
"width": "24px",
"height": "24px",
"float": "right",
"background": "url(../x_component_portal_PageDesigner/Module/SmartBI/default/icon/refresh.png) no-repeat center center",
"cursor": "pointer"
}
}
\ 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">{{$.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>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.smartbi.select}}:</td>
<td class="editTableValue">
<div class="MWFSmartBISelect" name="smartbiresource"></div>
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.smartbi.displayToolbar}}:</td>
<td class="editTableValue">
<div class="MWFSmartBIDisplayToolbar" name="smartbidisplaytoolbar">
<input type="radio" class="MWFSmartBIToolbar" name="MWFSmartBIToolbar" value="true" text{($.smartbidisplaytoolbar)?'checked':''} /> {{$.lp.smartbi.toolbarShow}}
<input type="radio" class="MWFSmartBIToolbar" name="MWFSmartBIToolbar" value="false" text{(!$.smartbidisplaytoolbar)?'checked':''} /> {{$.lp.smartbi.toolbarHide}}
</div>
</td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="{{$.lp.style}}"></div>
<div class="MWFMaplist" name="properties" title="{{$.lp.attribute}}"></div>
</div>
<div title="{{$.lp.event}}" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="{{$.lp.html}}" class="MWFTab">
<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="{{$.lp.json}}" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
{
"id": "",
"name": "",
"type": "SmartBI",
"description": "",
"events": {
"queryLoad" : {
"code": "",
"html": ""
},
"load" : {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
},
"dblclick": {
"code": "",
"html": ""
},
"mousedown": {
"code": "",
"html": ""
},
"mousemove": {
"code": "",
"html": ""
},
"mouseout": {
"code": "",
"html": ""
},
"mouseover": {
"code": "",
"html": ""
},
"mouseup": {
"code": "",
"html": ""
}
},
"class": "",
"styles": {},
"container": ""
}
......@@ -35,22 +35,22 @@ MWF.xApplication.process.FormDesigner.Module.SmartBI = MWF.FCSmartBI = new Class
}).inject(this.form.container);
},
_setEditStyle: function(name){
if (name=="smartbiresource"){
var options = {
"showtoolbar":this.json.smartbidisplaytoolbar||false //showtoolbar对应SmartBI系统中的参数名
};
if (name=="smartbiresource"){
var value = this.json.smartbiresource||"none";
if(value =="" || value == "none"){
this.setNodeContainer()
}else{
var SmartBIAction = o2.Actions.load("x_custom_smartbi_assemble_control");
var address = SmartBIAction.ResourceAction.action.getAddress();
var uri = SmartBIAction.ResourceAction.action.actions.open.uri;
var url = uri.replace("{id}", encodeURIComponent(value));
url = o2.filterUrl(address+url);
this.node.empty();
new Element("iframe",{src:url,styles:this.css.iframe,frameborder:"0",scrolling:"auto"}).inject(this.node);
this.createIframeNode(value,options)
}
}
if(name=="smartbidisplaytoolbar"){
if (this.json.smartbiresource && this.json.smartbiresource!=="none"){
this.createIframeNode(this.json.smartbiresource,options)
}
}
},
_loadNodeStyles: function(){
var _iframe = this.node.getElements("iframe");
......@@ -58,6 +58,26 @@ MWF.xApplication.process.FormDesigner.Module.SmartBI = MWF.FCSmartBI = new Class
_iframe[0].setStyles(this.css.iframe)
}
},
createIframeNode:function(id,options){
var value = id;
var SmartBIAction = o2.Actions.load("x_custom_smartbi_assemble_control");
var address = SmartBIAction.ResourceAction.action.getAddress();
var uri = SmartBIAction.ResourceAction.action.actions.open.uri;
var url = uri.replace("{id}", encodeURIComponent(value));
if(options){
var paraString = "";
for(var key in options){
paraString = paraString + "&" + key + "=" + options[key]
}
url = url + "?"+paraString
}
url = o2.filterUrl(address+url);
this.node.empty();
new Element("iframe",{src:url,styles:this.css.iframe,frameborder:"0",scrolling:"auto"}).inject(this.node);
},
_createNode: function(){
this.node = this.moveNode.clone(true, true);
this.node.setStyles(this.css.moduleNode);
......
......@@ -22,6 +22,15 @@
<div class="MWFSmartBISelect" name="smartbiresource"></div>
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.smartbi.displayToolbar}}:</td>
<td class="editTableValue">
<div class="MWFSmartBIDisplayToolbar" name="smartbidisplaytoolbar">
<input type="radio" class="MWFSmartBIToolbar" name="MWFSmartBIToolbar" value="true" text{($.smartbidisplaytoolbar)?'checked':''} /> {{$.lp.smartbi.toolbarShow}}
<input type="radio" class="MWFSmartBIToolbar" name="MWFSmartBIToolbar" value="false" text{(!$.smartbidisplaytoolbar)?'checked':''} /> {{$.lp.smartbi.toolbarHide}}
</div>
</td>
</tr>
</table>
<div class="MWFMaplist" name="styles" title="{{$.lp.style}}"></div>
......
......@@ -2567,6 +2567,7 @@ debugger;
loadSmartBISelect: function(){
var SmartBIAction = o2.Actions.load("x_custom_smartbi_assemble_control");
var SmartBINodes = this.propertyContent.getElements(".MWFSmartBISelect");
var SmartBIToolbarNodes = this.propertyContent.getElements(".MWFSmartBIToolbar");
if (SmartBINodes.length){
var node = SmartBINodes[0];
......@@ -2582,8 +2583,15 @@ debugger;
SmartBIAction.ResourceAction.sync(function(){
this.setSmartBIOptions(select)
}.bind(this))
}.bind(this))
}.bind(this))
}
if(SmartBIToolbarNodes.length){
SmartBIToolbarNodes.addEvent("change",function(e){
var value = e.target.get("value");
if (value=="false") value = false;
if (value=="true") value = true;
this.setValue(e.target.getParent("div").get("name"), value);
}.bind(this));
}
},
setSmartBIOptions:function(node){
......
......@@ -1209,7 +1209,10 @@ MWF.xApplication.process.FormDesigner.LP = {
"logoUrl":"logo link"
},
"smartbi":{
"select":"select"
"select":"select",
"displayToolbar":"toolbar",
"toolbarShow":"show",
"toolbarHide":"hide"
},
"tabletWidth": "Tablet Width",
"tabletHeight": "Tablet Height",
......
......@@ -1216,7 +1216,10 @@ MWF.xApplication.process.FormDesigner.LP = {
"logoUrl":"logo链接"
},
"smartbi":{
"select":"资源选择"
"select":"资源选择",
"displayToolbar":"显示工具栏",
"toolbarShow":"显示",
"toolbarHide":"隐藏"
},
"tabletWidth": "手写板宽度",
"tabletHeight": "手写板高度",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册