提交 ad58b112 编写于 作者: U unknown

在平台应用组件中加入status参数

上级 efc559d8
......@@ -145,7 +145,7 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
}.bind(this));
},
getColumn: function(success, failure){
if( this.options.column ){
if( this.options.column && o2.typeOf(this.options.column)==="object" ){
if (success) success();
return;
}
......
......@@ -136,8 +136,8 @@ MWF.xApplication.portal.PageDesigner.Module.Application = MWF.PCApplication = ne
var module = this;
this.page.designer.shortcut = false;
this.page.designer.confirm("warn", module.node, MWF.APPPOD.LP.notice.deleteElementTitle, MWF.APPPOD.LP.notice.deleteElement, 300, 120, function(){
if (this.queryGetPageDataFun) module.page.removeEvent("queryGetPageData", this.queryGetPageDataFun);
if (this.postGetPageDataFun) module.page.removeEvent("postGetPageData", this.postGetPageDataFun);
if (module.queryGetPageDataFun) module.page.removeEvent("queryGetPageData", module.queryGetPageDataFun);
if (module.postGetPageDataFun) module.page.removeEvent("postGetPageData", module.postGetPageDataFun);
module.page.selected();
......@@ -204,13 +204,14 @@ MWF.xApplication.portal.PageDesigner.Module.Application = MWF.PCApplication = ne
loadApplication: function ( ) {
if(this.node)this.node.empty();
this.clean();
var status = this.json.statusType === "map" ? this.json.statusMapList : {};
var options = this.json.optionsType === "map" ? this.json.optionsMapList : {};
if (this.json.componentSelected && this.json.componentSelected!=="none" && this.json.componentType!=="script"){
var componentPath = this.json.componentSelected;
if( componentPath.indexOf("@url:") === 0 ){
this._loadIframe( componentPath.substring(5, componentPath.length ) );
}else{
this._loadApplication( componentPath, options );
this._loadApplication( componentPath, status, options );
}
}else{
this.loadIcon();
......@@ -228,7 +229,7 @@ MWF.xApplication.portal.PageDesigner.Module.Application = MWF.PCApplication = ne
this.iframe = new Element("iframe", attr).inject( this.node );
this.loadMask();
},
_loadApplication: function ( app, options ) {
_loadApplication: function ( app, status, options ) {
var clazz = MWF.xApplication;
app.split(".").each(function (a) {
clazz[a] = clazz[a] || {};
......@@ -242,7 +243,7 @@ MWF.xApplication.portal.PageDesigner.Module.Application = MWF.PCApplication = ne
var opt = options || {};
opt.embededParent = this.node;
this.application = new clazz.Main(this.form.designer.desktop, opt);
this.application.status = opt;
this.application.status = status;
this.application.load();
this.application.setEventTarget(this.form.designer);
this.loadMask();
......
......@@ -43,6 +43,26 @@
<div class="MWFScriptArea" name="componentScript" title="{{$.lp.componentScript}} (S)"></div>
</div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.applicationStatus}}:</td>
<td class="editTableValue">
<input class="editTableRadio" onclick="
if (this.checked){
$('text{$.pid}statusMapList').setStyle('display', 'block');
$('text{$.pid}statusScript').setStyle('display', 'none')}
" name="statusType" text{($.statusType!='script')?'checked':''} type="radio" value="map"/>{{$.lp.textValue}}
<input class="editTableRadio" onclick="
if (this.checked){
$('text{$.pid}statusScript').setStyle('display', 'block');
$('text{$.pid}statusMapList').setStyle('display', 'none')}
" name="statusType" text{($.statusType=='script')?'checked':''} type="radio" value="script"/>{{$.lp.script}}
</td>
</tr>
</table>
<div id="text{$.pid}statusMapList" class="MWFMaplist" name="statusMapList" title="{{$.lp.option}}" style="display: text{($.statusType !=='script')?'block':'none'}" ></div>
<div id="text{$.pid}statusScript" class="MWFScriptArea" name="statusScript" title="status {{$.lp.script}}" style="display: text{($.statusType=='script')?'block':'none'}"></div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.applicationOptions}}:</td>
......
......@@ -1381,7 +1381,8 @@ MWF.xApplication.process.FormDesigner.LP = {
"component": "Application",
"scriptComponentNote": "Return application path, such as organization management",
"componentScript": "Apply Path Script",
"applicationOptions": "Application Options"
"applicationOptions": "Application Options",
"applicationStatus": "Application Status"
},
"smartbi":{
"nosetup":"please install SmartBI APP first",
......
......@@ -1387,7 +1387,8 @@ MWF.xApplication.process.FormDesigner.LP = {
"component": "应用",
"scriptComponentNote": "返回应用路径,如组织管理",
"componentScript": "应用路径脚本",
"applicationOptions": "应用options"
"applicationOptions": "应用options",
"applicationStatus": "应用status"
},
"smartbi":{
......
......@@ -75,13 +75,14 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
});
}
this.clean();
var status = this.getComponentStatus() || {};
var options = this.getComponentOptions() || {};
this.getComponentPath(function (componentPath) {
debugger;
if( componentPath.indexOf("@url:") === 0 ){
this.loadIframe( componentPath.substring(5, componentPath.length ) );
}else{
this.loadComponent( componentPath, options );
this.loadComponent( componentPath, status, options );
}
}.bind(this))
},
......@@ -114,6 +115,7 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
/**
* @summary 加载系统组件
* @param {String} path 组件的路径,如'Calendar'
* @param {Object} [status] 组件的状态
* @param {Object} [options] 组件的选项
* @example
* this.form.get("fieldId").clean(); //清除当前嵌入的对象
......@@ -124,7 +126,7 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
* "columnId":"25434995-45d2-4c9a-a344-55ad0deff071"
* }); //加载id为25434995-45d2-4c9a-a344-55ad0deff071的内容管理栏目
*/
loadComponent: function ( path, options ) {
loadComponent: function ( path, status, options ) {
var clazz = MWF.xApplication;
path.split(".").each(function (a) {
clazz[a] = clazz[a] || {};
......@@ -136,6 +138,7 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
MWF.xDesktop.requireApp(path, "Main", null, false);
if( clazz.Main ){
var opt = options || {};
var stt = status || {};
opt.embededParent = this.node;
/**
......@@ -152,7 +155,7 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
* app.addEvent(type, fun); //为应用绑定一个事件
*/
this.component = new clazz.Main(this.form.app.desktop, opt);
this.component.status = opt;
this.component.status = stt;
this.fireEvent("queryLoadApplication", this.component);
this.component.load();
this.component.setEventTarget(this.form.app);
......@@ -205,5 +208,23 @@ MWF.xApplication.process.Xform.Application = MWF.APPApplication = new Class(
}
}
return params;
},
/**
* @summary 获取表单设计配置的component对象的状态
* @return 设置的状态
* @example
* var param = this.form.get("fieldId").getComponentStatus()
*/
getComponentStatus: function(){
var params = "";
if( this.json.statusType === "map" ){
params = this.json.statusMapList;
}else if( this.json.statusType === "script" ){
var code = (this.json.statusScript) ? this.json.statusScript.code : "";
if (code){
params = this.form.Macro.exec(code, this);
}
}
return params;
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册