diff --git a/o2web/source/o2_core/o2/xScript/CMSEnvironment.js b/o2web/source/o2_core/o2/xScript/CMSEnvironment.js index fbcd7092312d7bcb007d0c5ed75bae45ab14f25e..4fa9b97e093a29a0d898eb284f1031d8f9f2f287 100644 --- a/o2web/source/o2_core/o2/xScript/CMSEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/CMSEnvironment.js @@ -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)); } diff --git a/o2web/source/o2_core/o2/xScript/Environment.js b/o2web/source/o2_core/o2/xScript/Environment.js index 71c7ca578a95a8313d3b859068c6017da2c7276c..9986f85c69b1f7f2a86f5046b5d045957c40e7bc 100644 --- a/o2web/source/o2_core/o2/xScript/Environment.js +++ b/o2web/source/o2_core/o2/xScript/Environment.js @@ -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)); } diff --git a/o2web/source/o2_core/o2/xScript/PageEnvironment.js b/o2web/source/o2_core/o2/xScript/PageEnvironment.js index 1579ed9729885f9d075e1dc448c04573ce38a9e9..65b17248931d8bc30f914d4ee2906babaf278db0 100644 --- a/o2web/source/o2_core/o2/xScript/PageEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/PageEnvironment.js @@ -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)); } diff --git a/o2web/source/o2_core/o2/xScript/ViewEnvironment.js b/o2web/source/o2_core/o2/xScript/ViewEnvironment.js index abb2fbf030126efc7691558954140b3773346940..a3a8be02900b65f6de6419c65485cdaa0f231a1f 100644 --- a/o2web/source/o2_core/o2/xScript/ViewEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/ViewEnvironment.js @@ -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(); }, diff --git a/o2web/source/x_component_process_Xform/View.js b/o2web/source/x_component_process_Xform/View.js index a6d25922e34705af050136a5f7e056731330f07a..16972178a09202e1d2454848dbca408b0c675d74 100644 --- a/o2web/source/x_component_process_Xform/View.js +++ b/o2web/source/x_component_process_Xform/View.js @@ -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)); }, diff --git a/o2web/source/x_component_process_Xform/ViewSelector.js b/o2web/source/x_component_process_Xform/ViewSelector.js index ffea76024ac80d8494aa197c52e587d623ca6000..3fcc2a776de634e944a2613f4ef33ecc4737ee5e 100644 --- a/o2web/source/x_component_process_Xform/ViewSelector.js +++ b/o2web/source/x_component_process_Xform/ViewSelector.js @@ -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) }); diff --git a/o2web/source/x_component_query_Query/Viewer.js b/o2web/source/x_component_query_Query/Viewer.js index cc14ef70d646665c332eb1bf9d75ef66c38b7fcf..fbb2c95c81dd00d738e42d6907a95b6b828586db 100644 --- a/o2web/source/x_component_query_Query/Viewer.js +++ b/o2web/source/x_component_query_Query/Viewer.js @@ -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);