unknown 5 лет назад
Родитель
Сommit
b3eedd4497

+ 1 - 1
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"});
+                        this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app);
                     }.bind(this));
                 }.bind(this));
             }

+ 1 - 1
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"});
+                        this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, {"style": "select"}, _form.app);
                     }.bind(this));
                 }.bind(this));
             }

+ 1 - 1
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" });
+                        this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app);
                     }.bind(this));
                 }.bind(this));
             }

+ 15 - 16
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -25,16 +25,6 @@ MWF.xScript.ViewEnvironment = function (ev) {
     // };
     // this.setData(_data);
 
-    this.viewContext = {
-        getViewInfor : function () { return _form.getViewInfor(); },
-        getPageInfor : function () { return _form.getPageInfor(); },
-        getPageData : function () { return _form.getPageData(); },
-        toPage : function ( pageNumber ) { return _form.toPage(pageNumber); },
-        selectAll : function () { return _form.selectAll(); },
-        unSelectAll : function () { return _form.unSelectAll(); },
-        switchView : function ( options ) { return _form.switchView(options); }
-    };
-
     //dict
     this.Dict = MWF.xScript.createDict();
     //org
@@ -670,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" });
+                        this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app);
                     }.bind(this));
                 }.bind(this));
             }
@@ -757,7 +747,16 @@ MWF.xScript.ViewEnvironment = function (ev) {
 
     //仅前台对象-----------------------------------------
     //form
-    this.page = this.form = {
+    this.page = this.form = this.queryView = {
+
+        "getViewInfor" : function () { return _form.getViewInfor(); },
+        "getPageInfor" : function () { return _form.getPageInfor(); },
+        "getPageData" : function () { return _form.getPageData(); },
+        "toPage" : function ( pageNumber, callback ) { return _form.toPage(pageNumber, callback); },
+        "selectAll" : function () { return _form.selectAll(); },
+        "unSelectAll" : function () { return _form.unSelectAll(); },
+        "switchView" : function ( options ) { return _form.switchView(options); },
+
         // "getInfor": function () { return ev.pageInfor; },
         // "infor": ev.pageInfor,
         "getApp": function () { return _form.app; },
@@ -774,7 +773,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
         "getDesktop": function () { return _form.app.desktop },
         // "getData": function () { return new MWF.xScript.JSONData(_form.getData()); },
         //"save": function(callback){_form.saveWork(callback);},
-        "close": function () { _form.closeWork(); },
+        // "close": function () { _form.closeWork(); },
 
         // "print": function (application, form) {
         //     _form.printWork(application, form);
@@ -809,9 +808,9 @@ MWF.xScript.ViewEnvironment = function (ev) {
             _form.notice(content, type, target, where, offset, option);
         },
         "addEvent": function (e, f) { _form.addEvent(e, f); },
-        "openWindow": function (form, app) {
-            _form.openWindow(form, app);
-        },
+        // "openWindow": function (form, app) {
+        //     _form.openWindow(form, app);
+        // },
         // "toPage": function (name, par, nohis) {
         //     _form.app.toPage(name, par, nohis);
         // },

+ 1 - 1
o2web/source/x_component_cms_Module/ExcelForm.js

@@ -193,7 +193,7 @@ MWF.xApplication.cms.Module.ExportForm = new Class({
                 "onSelect": function(){
                     this.fireEvent("select");
                 }.bind(this)
-            });
+            }, this.app);
         }.bind(this));
     },
     _setNodesSize : function(width, height, formContentHeight, formTableHeight){

+ 1 - 1
o2web/source/x_component_process_FormDesigner/widget/EventsEditor.js

@@ -131,7 +131,7 @@ MWF.xApplication.process.FormDesigner.widget.EventsEditor.Item = new Class({
         if (form.scriptDesigner) form.scriptDesigner.addScriptItem(this.data, "code", this.editor.module, this.editor.scriptPath+"."+this.event);
 	},
     deleteScriptDesignerItem: function(){
-        var form = this.editor.app.form || this.editor.app.page;
+        var form = this.editor.app.form || this.editor.app.page || this.editor.app.view;
         if (form.scriptDesigner){
             form.scriptDesigner.deleteScriptItem(this.editor.module, this.editor.scriptPath+"."+this.event);
         }

+ 1 - 1
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);
         //}.bind(this));
     },
 

+ 1 - 1
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.view = new MWF.xApplication.query.Query.Viewer(dlg.content, viewJson, {"style": "select"}, this.form.app );
                         }.bind(this));
                     }.bind(this)
                 });

+ 1 - 1
o2web/source/x_component_query_Query/Main.js

@@ -195,7 +195,7 @@ MWF.xApplication.query.Query.ViewItem = new Class({
                 "application": this.view.query,
                 "viewName": this.view.name,
                 "isExpand": data.isExpand
-            }, {"export": true});
+            }, {"export": true}, this.app);
         }.bind(this));
     }
 

+ 16 - 9
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){
+    initialize: function(container, json, options, app){
         //本类有三种事件,
         //一种是通过 options 传进来的事件,包括 loadView、openDocument、select
         //一种是用户配置的 事件, 在this.options.moduleEvents 中定义的作为类事件
@@ -36,6 +36,8 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         this._loadCss();
         this.lp = MWF.xApplication.query.Query.LP;
 
+        this.app = app;
+
         this.container = $(container);
         this.json = json;
 
@@ -110,14 +112,10 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         this.viewPageAreaNode = new Element("div", {"styles": this.css.viewPageAreaNode}).inject(this.viewPageNode);
     },
     loadMacro: function (callback) {
-        if( !this.Macro ){ //有可能是page\cms\process传入的macro
-            MWF.require("MWF.xScript.Macro", function () {
-                this.Macro = new MWF.Macro.ViewContext(this);
-                if (callback) callback();
-            }.bind(this));
-        }else{
+        MWF.require("MWF.xScript.Macro", function () {
+            this.Macro = new MWF.Macro.ViewContext(this);
             if (callback) callback();
-        }
+        }.bind(this));
     },
     createExportNode: function(){
         if (this.options.export){
@@ -804,7 +802,16 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 
         var newJson = Object.merge( Object.clone(this.originalJson), json );
         this.container.empty();
-        this.initialize( this.container, newJson, Object.clone(this.options));
+        this.initialize( this.container, newJson, Object.clone(this.options), this.app);
+    },
+    confirm: function (type, e, title, text, width, height, ok, cancel, callback, mask, style) {
+        this.app.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style)
+    },
+    alert: function (type, title, text, width, height) {
+        this.app.alert(type, "center", title, text, width, height);
+    },
+    notice: function (content, type, target, where, offset, option) {
+        this.app.notice(content, type, target, where, offset, option)
     },
     //api 使用 结束
     loadCurrentPageData: function( callback ){

+ 1 - 6
o2web/source/x_component_query_Query/lp/zh-cn.js

@@ -144,10 +144,5 @@ MWF.xApplication.query.Query.LP = {
     "selecteAllRow": "选择所有行",
 
     "firstPage": "第一页",
-    "lastPage": "最后一页",
-
-    "notice": {
-        "deleteEventTitle": "删除事件确认",
-        "deleteEvent": "是否确定删除当前事件吗?"
-    }
+    "lastPage": "最后一页"
 };

+ 4 - 1
o2web/source/x_component_query_ViewDesigner/lp/zh-cn.js

@@ -48,7 +48,10 @@ MWF.xApplication.query.ViewDesigner.LP = {
         "numberKey": "项目名称不能为数字,请重新输入",
 
         "inputName": "请输入视图名称",
-        "noModifyName": "不能修改名称或者别名"
+        "noModifyName": "不能修改名称或者别名",
+
+        "deleteEventTitle": "删除事件确认",
+        "deleteEvent": "是否确定删除当前事件吗?"
     },
     "actionbar": {
         "readhide": "设置阅读时是否显示",