From 0c5d5b2729ae84395d056bc54df0332e859b12ba Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Mar 2020 11:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E7=A7=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20getParentEnvirment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../o2_core/o2/xScript/CMSEnvironment.js | 2 +- .../source/o2_core/o2/xScript/Environment.js | 2 +- .../o2_core/o2/xScript/PageEnvironment.js | 2 +- .../o2_core/o2/xScript/ViewEnvironment.js | 4 ++-- .../source/x_component_process_Xform/View.js | 2 +- .../x_component_process_Xform/ViewSelector.js | 2 +- .../source/x_component_query_Query/Viewer.js | 19 ++++++++++++------- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/o2web/source/o2_core/o2/xScript/CMSEnvironment.js b/o2web/source/o2_core/o2/xScript/CMSEnvironment.js index fbcd709231..4fa9b97e09 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 71c7ca578a..9986f85c69 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 1579ed9729..65b1724893 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 abb2fbf030..a3a8be0290 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 a6d25922e3..16972178a0 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 ffea76024a..3fcc2a776d 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 cc14ef70d6..fbb2c95c81 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); -- GitLab