提交 c2a944c5 编写于 作者: U unknown

上下文种添加 getParentEnvirment

上级 966404e5
......@@ -688,7 +688,7 @@ MWF.xScript.CMSEnvironment = function(ev){
}
MWF.xDesktop.requireApp("query.Query", "Viewer", function(){
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app);
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
......
......@@ -857,7 +857,7 @@ MWF.xScript.Environment = function(ev){
}
MWF.xDesktop.requireApp("query.Query", "Viewer", function(){
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app);
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
......
......@@ -736,7 +736,7 @@ MWF.xScript.PageEnvironment = function (ev) {
}
MWF.xDesktop.requireApp("query.Query", "Viewer", function () {
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app);
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
......
......@@ -660,7 +660,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
}
MWF.xDesktop.requireApp("query.Query", "Viewer", function () {
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app);
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app, _form.Macro);
}.bind(this));
}.bind(this));
}
......@@ -748,7 +748,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
//仅前台对象-----------------------------------------
//form
this.page = this.form = this.queryView = {
"getParentEnvironment" : function () { return _form.parentEnvironment; }, //视图嵌入的表单或页面的上下文
"getParentEnvironment" : function () { return _form.getParentEnvironment(); }, //视图嵌入的表单或页面的上下文
"getViewInfor" : function () { return _form.getViewInfor(); },
"getPageInfor" : function () { return _form.getPageInfor(); },
"getPageData" : function () { return _form.getPageData(); },
......
......@@ -80,7 +80,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView = new Class({
this.fireEvent("openDocument");
this.openOptions = null;
}.bind(this)
}, this.form.app);
}, this.form.app, this.form.Macro);
//}.bind(this));
},
......
......@@ -334,7 +334,7 @@ MWF.xApplication.process.Xform.ViewSelector = MWF.APPViewSelector = new Class({
],
"onPostShow": function(){
MWF.xDesktop.requireApp("query.Query", "Viewer", function(){
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content, viewJson, {"style": "select"}, this.form.app );
this.view = new MWF.xApplication.query.Query.Viewer(dlg.content, viewJson, {"style": "select"}, this.form.app, this.form.Macro );
}.bind(this));
}.bind(this)
});
......
......@@ -23,7 +23,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
// },
// "actionRoot": "x_query_assemble_surface"
},
initialize: function(container, json, options, app){
initialize: function(container, json, options, app, parentMacro){
//本类有三种事件,
//一种是通过 options 传进来的事件,包括 loadView、openDocument、select
//一种是用户配置的 事件, 在this.options.moduleEvents 中定义的作为类事件
......@@ -41,6 +41,8 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
this.container = $(container);
this.json = json;
this.parentMacro = parentMacro;
debugger;
this.originalJson = Object.clone(json);
......@@ -736,6 +738,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
}.bind(this));
},
//api 使用 开始
getParentEnvironment : function(){
return this.parentMacro ? this.parentMacro.environment : null;
},
getViewInfor : function(){
return this.json;
},
......@@ -1718,9 +1723,9 @@ MWF.xApplication.query.Query.Viewer.Actionbar = new Class({
}
if (flag){
flag = true;
if (tool.control){
flag = this.form.businessData.control[tool.control]
}
// if (tool.control){
// flag = this.form.businessData.control[tool.control]
// }
if (tool.condition){
var hideFlag = this.form.Macro.exec(tool.condition, this);
flag = !hideFlag;
......@@ -1756,9 +1761,9 @@ MWF.xApplication.query.Query.Viewer.Actionbar = new Class({
//var path = "/x_component_process_FormDesigner/Module/Actionbar/";
var path = "/x_component_query_ViewDesigner/$View/";
var flag = true;
if (tool.control){
flag = this.form.businessData.control[tool.control]
}
// if (tool.control){
// flag = this.form.businessData.control[tool.control]
// }
if (!noCondition) if (tool.condition){
var hideFlag = this.form.Macro.exec(tool.condition, this);
flag = flag && (!hideFlag);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册