Bläddra i källkod

Merge branch 'fix/Process.checkbox_exception' into 'develop'

Merge of fix/[流程表单]修复流程表单中多选按钮最后一个值不能被取消的问题 to develop

See merge request o2oa/o2oa!154
蔡祥熠 5 år sedan
förälder
incheckning
2440526d92
42 ändrade filer med 5638 tillägg och 164 borttagningar
  1. 119 0
      o2web/source/o2_core/o2/widget/$Paging/default/css.wcss
  2. BIN
      o2web/source/o2_core/o2/widget/$Paging/default/icon/left.png
  3. BIN
      o2web/source/o2_core/o2/widget/$Paging/default/icon/right.png
  4. 120 0
      o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss
  5. BIN
      o2web/source/o2_core/o2/widget/$Paging/forum/icon/left.png
  6. BIN
      o2web/source/o2_core/o2/widget/$Paging/forum/icon/right.png
  7. 240 0
      o2web/source/o2_core/o2/widget/Paging.js
  8. 1 1
      o2web/source/o2_core/o2/xScript/CMSEnvironment.js
  9. 47 0
      o2web/source/o2_core/o2/xScript/CMSMacro.js
  10. 1 1
      o2web/source/o2_core/o2/xScript/Environment.js
  11. 46 0
      o2web/source/o2_core/o2/xScript/Macro.js
  12. 1 1
      o2web/source/o2_core/o2/xScript/PageEnvironment.js
  13. 1093 0
      o2web/source/o2_core/o2/xScript/ViewEnvironment.js
  14. 1 1
      o2web/source/x_component_cms_Module/ExcelForm.js
  15. 93 0
      o2web/source/x_component_process_FormDesigner/Module/View.js
  16. 7 0
      o2web/source/x_component_process_FormDesigner/Module/View/view.html
  17. 1 1
      o2web/source/x_component_process_FormDesigner/widget/EventsEditor.js
  18. 2 2
      o2web/source/x_component_process_Xform/Checkbox.js
  19. 1 1
      o2web/source/x_component_process_Xform/View.js
  20. 1 1
      o2web/source/x_component_process_Xform/ViewSelector.js
  21. 9 10
      o2web/source/x_component_query_Query/$Viewer/default/css.wcss
  22. 2 2
      o2web/source/x_component_query_Query/$Viewer/select/css.wcss
  23. 1 1
      o2web/source/x_component_query_Query/Main.js
  24. 624 131
      o2web/source/x_component_query_Query/Viewer.js
  25. 42 0
      o2web/source/x_component_query_ViewDesigner/$View/actionbar.html
  26. 69 0
      o2web/source/x_component_query_ViewDesigner/$View/actionbar.json
  27. 50 0
      o2web/source/x_component_query_ViewDesigner/$View/default/actionbar.wcss
  28. BIN
      o2web/source/x_component_query_ViewDesigner/$View/default/actionbar/export.png
  29. 32 1
      o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss
  30. 46 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/config.json
  31. 50 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json
  32. 419 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-simple.json
  33. 445 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_cmcc.json
  34. 44 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_default.json
  35. 467 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_official.json
  36. 418 0
      o2web/source/x_component_query_ViewDesigner/$View/skin/styles_red-simple.json
  37. 12 0
      o2web/source/x_component_query_ViewDesigner/$View/toolbars.json
  38. 33 0
      o2web/source/x_component_query_ViewDesigner/$View/view.html
  39. 43 1
      o2web/source/x_component_query_ViewDesigner/$View/view.json
  40. 149 0
      o2web/source/x_component_query_ViewDesigner/Property.js
  41. 887 8
      o2web/source/x_component_query_ViewDesigner/View.js
  42. 22 1
      o2web/source/x_component_query_ViewDesigner/lp/zh-cn.js

+ 119 - 0
o2web/source/o2_core/o2/widget/$Paging/default/css.wcss

@@ -0,0 +1,119 @@
+{
+    "pagingBar" : {
+        "float": "left",
+        "margin-left": "10px",
+        "height": "24px",
+        "color": "#777777"
+    },
+    "firstPage" : {
+        "height": "24px",
+        "width": "80px",
+        "border": "1px solid #e6e6e6",
+        "color": "#777777",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "margin-right": "10px",
+        "background-color": "#ffffff",
+        "float": "left"
+    },
+    "firstPage_over" : {
+        "background-color": "#f1f1f1"
+    },
+    "lastPage" : {
+        "height": "24px",
+        "width": "80px",
+        "border": "1px solid #e6e6e6",
+        "color": "#777777",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "background-color": "#ffffff",
+        "float": "left"
+    },
+    "lastPage_over" : {
+        "background-color": "#f1f1f1"
+    },
+    "prePage" : {
+        "width": "24px",
+        "height": "24px",
+        "border": "1px solid #e6e6e6",
+        "color": "#777777",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "background-color": "#ffffff",
+        "float": "left",
+        "margin-right": "10px",
+        "background": "url(/o2_core/o2/widget/$Paging/default/icon/left.png) no-repeat center center"
+    },
+    "prePage_over" : {
+        "background-color": "#f1f1f1"
+    },
+    "pageTurnContainer" : {
+        "float" : "left"
+    },
+    "pageItem" : {
+        "width": "24px",
+        "height": "24px",
+        "border": "1px solid #e6e6e6",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "float": "left",
+        "margin-right": "10px",
+        "background-color": "#ffffff",
+        "color": "#777777"
+    },
+    "pageItem_over" : {
+        "background-color": "#f1f1f1"
+    },
+    "currentPage" : {
+        "width": "24px",
+        "height": "24px",
+        "border": "1px solid #e6e6e6",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "float": "left",
+        "margin-right": "10px",
+        "background-color": "#4a90e2",
+        "color": "#ffffff"
+    },
+    "pageJumper" : {
+        "float" : "left",
+        "height" : "20px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "width" : "20px",
+        "margin-left" : "5px",
+        "border" : "1px solid #ddd"
+    },
+    "pageJumper_over" : {
+        "border" : "1px solid #43AAFA"
+    },
+    "pageJumperText" : {
+        "float" : "left",
+        "height" : "20px",
+        "padding" : "2px 5px",
+        "text-align" : "center",
+        "line-height" : "20px",
+        "margin-right" : "5px"
+    },
+    "nextPage" : {
+        "width": "24px",
+        "height": "24px",
+        "border": "1px solid #e6e6e6",
+        "color": "#777777",
+        "text-align": "center",
+        "line-height": "24px",
+        "cursor": "pointer",
+        "background-color": "#ffffff",
+        "float": "left",
+        "margin-right": "10px",
+        "background": "url(/o2_core/o2/widget/$Paging/default/icon/right.png) no-repeat center center"
+    },
+    "nextPage_over" : {
+        "background-color": "#f1f1f1"
+    }
+}

BIN
o2web/source/o2_core/o2/widget/$Paging/default/icon/left.png


BIN
o2web/source/o2_core/o2/widget/$Paging/default/icon/right.png


+ 120 - 0
o2web/source/o2_core/o2/widget/$Paging/forum/css.wcss

@@ -0,0 +1,120 @@
+{
+    "pagingBar" : {
+        "float" : "right",
+        "margin-right" : "10px",
+        "padding-left" : "10px",
+        "overflow" : "hidden",
+        "height" : "36px",
+        "line-height" : "36px",
+        "margin-bottom" : "10px",
+        "background" : "#fff",
+        "color" : "#333"
+    },
+    "firstPage" : {
+        "float" : "left"
+    },
+    "firstPage_over" : {
+
+    },
+    "lastPage" : {
+        "float" : "left"
+    },
+    "lastPage_over" : {
+
+    },
+    "prePage" : {
+        "float" : "left",
+        "width" : "16px",
+        "height" : "20px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "padding" : "2px 5px",
+        "border" : "1px solid #f3f3f3",
+        "margin" : "5px",
+        "cursor" : "pointer",
+        "background": "url(/o2_core/o2/widget/$Paging/forum/icon/left.png) no-repeat center center",
+        "background-color" : "#f3f3f3"
+    },
+    "prePage_over" : {
+        "border" : "1px solid #43AAFA",
+        "background-color" : "#fff",
+        "color" : "#43AAFA"
+    },
+    "pageTurnContainer" : {
+        "float" : "left"
+    },
+    "pageItem" : {
+        "float" : "left",
+        "height" : "20px",
+        "min-width" : "16px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "padding" : "2px 5px",
+        "border" : "1px solid #f3f3f3",
+        "background-color" : "#f3f3f3",
+        "cursor" : "pointer",
+        "color" : "#333",
+        "margin" : "5px"
+    },
+    "pageItem_over" : {
+        "border" : "1px solid #43AAFA",
+        "background-color" : "#fff",
+        "color" : "#43AAFA"
+    },
+    "currentPage" : {
+        "float" : "left",
+        "height" : "20px",
+        "width" : "16px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "padding" : "2px 5px",
+        "border" : "1px solid #43AAFA",
+        "color" : "#fff",
+        "margin" : "5px",
+        "font-weight" : "bold",
+        "background-color" : "#43aafa"
+    },
+    "pageJumper" : {
+        "float" : "left",
+        "height" : "20px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "width" : "20px",
+        "margin-top" : "5px",
+        "margin-bottom" : "5px",
+        "margin-left" : "5px",
+        "border" : "1px solid #ddd"
+    },
+    "pageJumper_over" : {
+        "border" : "1px solid #43AAFA"
+    },
+    "pageJumperText" : {
+        "float" : "left",
+        "height" : "20px",
+        "padding" : "2px 5px",
+        "text-align" : "center",
+        "line-height" : "20px",
+        "margin-top" : "5px",
+        "margin-bottom" : "5px",
+        "margin-right" : "5px"
+    },
+    "nextPage" : {
+        "float" : "left",
+        "width" : "16px",
+        "height" : "20px",
+        "line-height" : "20px",
+        "text-align" : "center",
+        "padding" : "2px 5px",
+        "border" : "1px solid #f3f3f3",
+        "margin" : "5px",
+        "cursor" : "pointer",
+        "color" : "#333",
+        "background": "url(/o2_core/o2/widget/$Paging/forum/icon/right.png) no-repeat center center",
+        "background-color" : "#f3f3f3"
+    },
+    "nextPage_over" : {
+        "border" : "1px solid #43AAFA",
+        "background-color" : "#fff",
+        "color" : "#43AAFA"
+    }
+}

BIN
o2web/source/o2_core/o2/widget/$Paging/forum/icon/left.png


BIN
o2web/source/o2_core/o2/widget/$Paging/forum/icon/right.png


+ 240 - 0
o2web/source/o2_core/o2/widget/Paging.js

@@ -0,0 +1,240 @@
+o2.widget = o2.widget || {};
+o2.require("o2.widget.Common", null, false);
+o2.widget.Paging = new Class({
+    Implements: [Options, Events],
+    Extends: o2.widget.Common,
+    options: {
+        style : "default",
+        countPerPage: 20,
+        visiblePages: 10,
+        currentPage: 1,
+        itemSize: 0,
+        pageSize: 0,
+        hasNextPage: true,
+        hasPrevPage: true,
+        hasTruningBar: true,
+        hasJumper: true,
+        hiddenWithDisable: false,
+        hiddenWithNoItem: true,
+        text: {
+            prePage: "",
+            nextPage: "",
+            firstPage: "",
+            lastPage: ""
+        }
+    },
+    initialize: function (node, options, css) {
+
+        this.setOptions(options || {});
+        this.container = $(node);
+
+        this.path = o2.session.path + "/widget/$Paging/";
+        this.cssPath = o2.session.path + "/widget/$Paging/" + this.options.style + "/css.wcss";
+        this._loadCss();
+
+        if (css) {
+            this.css = Object.clone(this.css);
+            this.css = Object.merge(this.css, css);
+        }
+    },
+    load: function () {
+        this.fireEvent("queryLoad", this);
+        this.options.pageSize = Math.ceil(this.options.itemSize / this.options.countPerPage);
+
+        if ( this.options.pageSize == 0 && this.options.hiddenWithNoItem) return;
+
+        this.container.empty();
+        this.createNode();
+
+        this.fireEvent("postLoad", this);
+    },
+    createNode: function() {
+        var _self = this;
+
+        this.node = new Element("div.pagingBar", {styles: this.css.pagingBar}).inject(this.container);
+
+        var i, max, min;
+
+        var showWithDisable = !this.options.hiddenWithDisable;
+        var pageSize = this.options.pageSize;
+        var currentPage = this.options.currentPage;
+        var visiblePages = this.options.visiblePages;
+
+        var halfCount = Math.floor(visiblePages / 2);
+        if (pageSize <= visiblePages) {
+            min = 1;
+            max = pageSize;
+        } else if (currentPage + halfCount > pageSize) {
+            min = pageSize - visiblePages;
+            max = pageSize;
+        } else if (currentPage - halfCount < 1) {
+            min = 1;
+            max = visiblePages;
+        } else {
+            min = currentPage - halfCount;
+            max = currentPage + halfCount;
+        }
+
+        if  (min > 1 || !this.options.hiddenWithDisable )this.createFirst();
+
+        if (this.options.hasPrevPage && ( currentPage != 1 || showWithDisable ) ){
+            this.createPrev();
+        }
+
+        if( this.options.hasTruningBar ){
+            this.pageTurnContainer = new Element("div", {
+                styles : this.css.pageTurnContainer
+            }).inject( this.node );
+            this.pageTurnNodes = [];
+            for (i = min; i <= max; i++) {
+                if (currentPage == i) {
+                    this.currentPage = new Element("div.currentPage", {
+                        "styles": this.css.currentPage,
+                        "text" : i
+                    }).inject(this.pageTurnContainer);
+                } else {
+                    this.pageTurnNodes.push( this.createPageTurnNode(i) );
+                }
+            }
+        }
+
+        if (this.options.hasJumper) {
+            this.createPageJumper();
+        }
+
+        if (this.options.hasNextPage && ( currentPage != pageSize || showWithDisable )){
+            this.createNext();
+        }
+
+        if( max < pageSize || showWithDisable )this.createLast();
+    },
+    createFirst : function(){
+        var firstPage = this.firstPage = new Element("div.firstPage", {
+            styles: this.css.firstPage
+        }).inject(this.node);
+        if (this.options.text.firstPage) firstPage.set("text", this.options.text.firstPage);
+        firstPage.addEvents({
+            "mouseover": function (ev) {
+                ev.target.setStyles(this.css.firstPage_over)
+            }.bind(this),
+            "mouseout": function (ev) {
+                ev.target.setStyles(this.css.firstPage)
+            }.bind(this),
+            "click": function () {
+                this.gotoPage(1)
+            }.bind(this)
+        })
+    },
+    createLast : function(){
+        var lastPage = this.lastPage = new Element("div.lastPage", {
+            styles: this.css.lastPage
+        }).inject(this.node);
+        if (this.options.text.lastPage) lastPage.set("text", this.options.text.lastPage);
+        lastPage.addEvents({
+            "mouseover": function (ev) {
+                ev.target.setStyles(this.css.lastPage_over)
+            }.bind(this),
+            "mouseout": function (ev) {
+                ev.target.setStyles(this.css.lastPage)
+            }.bind(this),
+            "click": function () {
+                this.gotoPage( this.options.pageSize )
+            }.bind(this)
+        })
+    },
+    createPrev : function(){
+        var prePage = this.prePage = new Element("div.prePage", {
+            styles: this.css.prePage
+        }).inject(this.node);
+        if (this.options.text.prePage) prePage.set("text", this.options.text.prePage);
+        prePage.addEvents({
+            "mouseover": function (ev) {
+                ev.target.setStyles(this.css.prePage_over)
+            }.bind(this),
+            "mouseout": function (ev) {
+                ev.target.setStyles(this.css.prePage)
+            }.bind(this),
+            "click": function () {
+                this.gotoPage(this.options.currentPage - 1)
+            }.bind(this)
+        });
+    },
+    createNext : function(){
+        var nextPage = this.nextPage = new Element("div.nextPage", {
+            styles: this.css.nextPage
+        }).inject(this.node);
+        if (this.options.text.nextPage) nextPage.set("text", this.options.text.nextPage);
+        nextPage.addEvents({
+            "mouseover": function (ev) {
+                ev.target.setStyles(this.css.nextPage_over)
+            }.bind(this),
+            "mouseout": function (ev) {
+                ev.target.setStyles(this.css.nextPage)
+            }.bind(this),
+            "click": function () {
+                this.gotoPage(this.options.currentPage + 1)
+            }.bind(this)
+        });
+    },
+    createPageTurnNode: function(i){
+        var pageTurnNode = new Element("div.pageItem", {
+            "styles": this.css.pageItem,
+            "text": i
+        }).inject(this.pageTurnContainer);
+        pageTurnNode.addEvents({
+            "mouseover": function (ev) {
+                ev.target.setStyles(this.css.pageItem_over)
+            }.bind(this),
+            "mouseout": function (ev) {
+                ev.target.setStyles(this.css.pageItem)
+            }.bind(this),
+            "click": function () {
+                this.obj.gotoPage(this.num)
+            }.bind({obj: this, num: i})
+        });
+        return pageTurnNode;
+    },
+    createPageJumper : function(){
+        var _self = this;
+        var pageJumper = this.pageJumper = new Element("input.pageJumper", {
+            "styles": this.css.pageJumper,
+            "title": "输入页码,离开输入框或按回车跳转"
+        }).inject(this.node);
+        this.pageJumperText = new Element("div.pageText", {
+            "styles": this.css.pageJumperText,
+            "text": "/" + this.options.pageSize
+        }).inject(this.node);
+        pageJumper.addEvents({
+            "focus": function (ev) {
+                ev.target.setStyles(this.css.pageJumper_over)
+            }.bind(this),
+            "blur": function (ev) {
+                if( this.value )_self.gotoPage(this.value);
+                ev.target.setStyles(_self.css.pageJumper);
+            },
+            "keyup": function (e) {
+                this.value = this.value.replace(/[^0-9_]/g, '');
+            },
+            "keydown": function (e) {
+                if (e.code == 13 && this.value != "") {
+                    _self.gotoPage(this.value);
+                    e.stopPropagation();
+                    //e.preventDefault();
+                }
+            }
+        });
+    },
+    gotoPage: function (num) {
+        if (num < 1 || num > this.options.pageSize) return;
+        this.fireEvent("jumpingPage", [num]);
+        this.options.currentPage = num;
+        this.load();
+    },
+    gotoItem: function (itemNum) {
+        var pageNum = Math.ceil(itemNum / this.options.countPerPage);
+        var index = itemNum % this.options.countPerPage;
+        this.fireEvent("jumpingPage", [pageNum, itemNum, index]);
+        this.options.currentPage = pageNum;
+        this.load();
+    }
+});

+ 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(){
                     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, _form.Macro);
                     }.bind(this));
                     }.bind(this));
                 }.bind(this));
                 }.bind(this));
             }
             }

+ 47 - 0
o2web/source/o2_core/o2/xScript/CMSMacro.js

@@ -81,6 +81,53 @@ MWF.CMSMacro.CMSFormContext = new Class({
 
 
 });
 });
 
 
+if( !MWF.Macro.ViewContext ){
+    MWF.Macro.ViewContext = new Class({
+        macroFunction: null,
+        environment: {},
+        initialize: function(view){
+            this.form = view;
+            var environment = {
+                "view": view,
+                "viewInfor": view.viewInfor,
+                "target": null,
+                "event": null
+            };
+            MWF.require("MWF.xScript.ViewEnvironment", null, false);
+            this.environment = new MWF.xScript.ViewEnvironment(environment);
+        },
+        setTarget: function(target){
+            if (target){
+                this.environment.target = target;
+            }else{
+                this.environment.target = null;
+            }
+        },
+        setEvent: function(event){
+            if (event){
+                this.environment.event = event;
+            }else{
+                this.environment.event = null;
+            }
+        },
+        exec: function(code, target){
+            this.setTarget(target);
+            var returnValue = MWF.Macro.exec(code, this.environment);
+            //this.form.businessData.data = Object.merge(this.form.businessData.data, this.environment.data);
+
+            return returnValue;
+            //this.environment.data
+
+        },
+        fire: function(code, target, event){
+            this.setTarget(target);
+            this.setEvent(event);
+            return MWF.Macro.exec(code, this.environment);
+        }
+    });
+}
+
+
 JSONObject = function(o){
 JSONObject = function(o){
 
 
 };
 };

+ 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(){
                     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, _form.Macro);
                     }.bind(this));
                     }.bind(this));
                 }.bind(this));
                 }.bind(this));
             }
             }

+ 46 - 0
o2web/source/o2_core/o2/xScript/Macro.js

@@ -165,5 +165,51 @@ MWF.Macro.PageContext = new Class({
     }
     }
 });
 });
 
 
+if( !MWF.Macro.ViewContext ) {
+    MWF.Macro.ViewContext = new Class({
+        macroFunction: null,
+        environment: {},
+        initialize: function (view) {
+            this.form = view;
+            var environment = {
+                "view": view,
+                "viewInfor": view.viewInfor,
+                "target": null,
+                "event": null
+            };
+            MWF.require("MWF.xScript.ViewEnvironment", null, false);
+            this.environment = new MWF.xScript.ViewEnvironment(environment);
+        },
+        setTarget: function (target) {
+            if (target) {
+                this.environment.target = target;
+            } else {
+                this.environment.target = null;
+            }
+        },
+        setEvent: function (event) {
+            if (event) {
+                this.environment.event = event;
+            } else {
+                this.environment.event = null;
+            }
+        },
+        exec: function (code, target) {
+            this.setTarget(target);
+            var returnValue = MWF.Macro.exec(code, this.environment);
+            //this.form.businessData.data = Object.merge(this.form.businessData.data, this.environment.data);
+
+            return returnValue;
+            //this.environment.data
+
+        },
+        fire: function (code, target, event) {
+            this.setTarget(target);
+            this.setEvent(event);
+            return MWF.Macro.exec(code, this.environment);
+        }
+    });
+}
+
 JSONObject = function(o){
 JSONObject = function(o){
 };
 };

+ 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 () {
                     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, _form.Macro);
                     }.bind(this));
                     }.bind(this));
                 }.bind(this));
                 }.bind(this));
             }
             }

+ 1093 - 0
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -0,0 +1,1093 @@
+MWF.xScript = MWF.xScript || {};
+MWF.xScript.ViewEnvironment = function (ev) {
+    var _form = ev.view;
+
+    this.library = COMMON;
+    //this.library.version = "4.0";
+
+    //data
+    // var getJSONData = function (jData) {
+    //     return new MWF.xScript.JSONData(jData, function (data, key, _self) {
+    //         var p = { "getKey": function () { return key; }, "getParent": function () { return _self; } };
+    //         while (p && !_forms[p.getKey()]) p = p.getParent();
+    //         if (p) if (p.getKey()) if (_forms[p.getKey()]) _forms[p.getKey()].resetData();
+    //     });
+    // };
+    // this.setData = function (data) {
+    //     this.data = getJSONData(data);
+    //     this.data.save = function (callback) {
+    //         var formData = {
+    //             "data": data,
+    //             "sectionList": _form.getSectionList()
+    //         };
+    //         form.workAction.saveData(function (json) { if (callback) callback(); }.bind(this), null, work.id, jData);
+    //     }
+    // };
+    // this.setData(_data);
+
+    //dict
+    this.Dict = MWF.xScript.createDict();
+    //org
+    var orgActions = null;
+    var getOrgActions = function () {
+        if (!orgActions) {
+            MWF.require("MWF.xScript.Actions.UnitActions", null, false);
+            orgActions = new MWF.xScript.Actions.UnitActions();
+        }
+    };
+    var getNameFlag = function (name) {
+        var t = typeOf(name);
+        if (t === "array") {
+            var v = [];
+            name.each(function (id) {
+                v.push((typeOf(id) === "object") ? (id.distinguishedName || id.id || id.unique || id.name) : id);
+            });
+            return v;
+        } else {
+            return [(t === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name];
+        }
+    };
+    this.org = {
+        //群组***************
+        //获取群组--返回群组的对象数组
+        getGroup: function (name) {
+            getOrgActions();
+            var data = { "groupList": getNameFlag(name) };
+            var v = null;
+            orgActions.listGroup(data, function (json) { v = json.data; }, null, false);
+            return (v && v.length === 1) ? v[0] : v;
+        },
+        //查询下级群组--返回群组的对象数组
+        //nested  布尔  true嵌套下级;false直接下级;默认false;
+        listSubGroup: function (name, nested) {
+            getOrgActions();
+            var data = { "groupList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listSubGroupNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listSubGroupDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //查询上级群组--返回群组的对象数组
+        //nested  布尔  true嵌套上级;false直接上级;默认false;
+        listSupGroup: function (name, nested) {
+            getOrgActions();
+            var data = { "groupList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listSupGroupNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listSupGroupDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //人员所在群组(嵌套)--返回群组的对象数组
+        listGroupWithPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listGroupWithPerson(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //群组是否拥有角色--返回true, false
+        groupHasRole: function (name, role) {
+            getOrgActions();
+            nameFlag = (typeOf(name) === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name;
+            var data = { "group": nameFlag, "roleList": getNameFlag(role) };
+            var v = false;
+            orgActions.groupHasRole(data, function (json) { v = json.data.value; }, null, false);
+            return v;
+        },
+
+        //角色***************
+        //获取角色--返回角色的对象数组
+        getRole: function (name) {
+            getOrgActions();
+            var data = { "roleList": getNameFlag(name) };
+            var v = null;
+            orgActions.listRole(data, function (json) { v = json.data; }, null, false);
+            return (v && v.length === 1) ? v[0] : v;
+        },
+        //人员所有角色(嵌套)--返回角色的对象数组
+        listRoleWithPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listRoleWithPerson(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+
+        //人员***************
+        //人员是否拥有角色--返回true, false
+        personHasRole: function (name, role) {
+            getOrgActions();
+            nameFlag = (typeOf(name) === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name;
+            var data = { "person": nameFlag, "roleList": getNameFlag(role) };
+            var v = false;
+            orgActions.personHasRole(data, function (json) { v = json.data.value; }, null, false);
+            return v;
+        },
+        //获取人员--返回人员的对象数组
+        getPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPerson(data, function (json) { v = json.data; }, null, false);
+            return (v && v.length === 1) ? v[0] : v;
+        },
+        //查询下级人员--返回人员的对象数组
+        //nested  布尔  true嵌套下级;false直接下级;默认false;
+        listSubPerson: function (name, nested) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listPersonSubNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listPersonSubDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //查询上级人员--返回人员的对象数组
+        //nested  布尔  true嵌套上级;false直接上级;默认false;
+        listSupPerson: function (name, nested) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listPersonSupNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listPersonSupDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //获取群组的所有人员--返回人员的对象数组
+        listPersonWithGroup: function (name) {
+            getOrgActions();
+            var data = { "groupList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPersonWithGroup(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //获取角色的所有人员--返回人员的对象数组
+        listPersonWithRole: function (name) {
+            getOrgActions();
+            var data = { "roleList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPersonWithRole(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //获取身份的所有人员--返回人员的对象数组
+        listPersonWithIdentity: function (name) {
+            getOrgActions();
+            var data = { "identityList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPersonWithIdentity(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //查询组织成员的人员--返回人员的对象数组
+        //nested  布尔  true嵌套的所有成员;false直接成员;默认false;
+        listPersonWithUnit: function (name, nested) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listPersonWithUnitNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listPersonWithUnitDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //根据属性查询人员--返回人员的对象数组
+        //name  string 属性名
+        //value  string 属性值
+        listPersonWithAttribute: function (name, value) {
+            getOrgActions();
+            var data = { "name": name, "attribute": value };
+            var v = null;
+            orgActions.listPersonWithAttribute(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //根据属性查询人员--返回人员的全称数组
+        //name  string 属性名
+        //value  string 属性值
+        listPersonNameWithAttribute: function (name, value) {
+            getOrgActions();
+            var data = { "name": name, "attribute": value };
+            var v = null;
+            orgActions.listPersonWithAttributeValue(data, function (json) { v = json.data.personList; }, null, false);
+            return v;
+        },
+
+        //人员属性************
+        //添加人员属性值(在属性中添加values值,如果没有此属性,则创建一个)
+        appendPersonAttribute: function (person, attr, values, success, failure) {
+            getOrgActions();
+            var personFlag = (typeOf(person) === "object") ? (person.distinguishedName || person.id || person.unique || person.name) : person;
+            var data = { "attributeList": values, "name": attr, "person": personFlag };
+            orgActions.appendPersonAttribute(data, function (json) {
+                if (json.data.value) {
+                    if (success) success();
+                } else {
+                    if (failure) failure(null, "", "append values failed");
+                }
+            }, function (xhr, text, error) {
+                if (failure) failure(xhr, text, error);
+            }, false);
+        },
+        //设置人员属性值(将属性值修改为values,如果没有此属性,则创建一个)
+        setPersonAttribute: function (person, attr, values, success, failure) {
+            getOrgActions();
+            var personFlag = (typeOf(person) === "object") ? (person.distinguishedName || person.id || person.unique || person.name) : person;
+            var data = { "attributeList": values, "name": attr, "person": personFlag };
+            orgActions.setPersonAttribute(data, function (json) {
+                if (json.data.value) {
+                    if (success) success();
+                } else {
+                    if (failure) failure(null, "", "append values failed");
+                }
+            }, function (xhr, text, error) {
+                if (failure) failure(xhr, text, error);
+            }, false);
+        },
+        //获取人员属性值
+        getPersonAttribute: function (person, attr) {
+            getOrgActions();
+            var personFlag = (typeOf(person) === "object") ? (person.distinguishedName || person.id || person.unique || person.name) : person;
+            var data = { "name": attr, "person": personFlag };
+            var v = null;
+            orgActions.getPersonAttribute(data, function (json) { v = json.data.attributeList; }, null, false);
+            return v;
+        },
+        //列出人员所有属性的名称
+        listPersonAttributeName: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPersonAttributeName(data, function (json) { v = json.data.nameList; }, null, false);
+            return v;
+        },
+        //列出人员的所有属性
+        listPersonAllAttribute: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listPersonAllAttribute(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+
+        //身份**********
+        //获取身份
+        getIdentity: function (name) {
+            getOrgActions();
+            var data = { "identityList": getNameFlag(name) };
+            var v = null;
+            orgActions.listIdentity(data, function (json) { v = json.data; }, null, false);
+            return (v && v.length === 1) ? v[0] : v;
+        },
+        //列出人员的身份
+        listIdentityWithPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listIdentityWithPerson(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //查询组织成员身份--返回身份的对象数组
+        //nested  布尔  true嵌套的所有成员;false直接成员;默认false;
+        listIdentityWithUnit: function (name, nested) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listIdentityWithUnitNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listIdentityWithUnitDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+
+        //组织**********
+        //获取组织
+        getUnit: function (name) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnit(data, function (json) { v = json.data; }, null, false);
+            return (v && v.length === 1) ? v[0] : v;
+        },
+        //查询组织的下级--返回组织的对象数组
+        //nested  布尔  true嵌套下级;false直接下级;默认false;
+        listSubUnit: function (name, nested) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listUnitSubNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listUnitSubDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //查询组织的上级--返回组织的对象数组
+        //nested  布尔  true嵌套上级;false直接上级;默认false;
+        listSupUnit: function (name, nested) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            if (nested) {
+                orgActions.listUnitSupNested(data, function (json) { v = json.data; }, null, false);
+            } else {
+                orgActions.listUnitSupDirect(data, function (json) { v = json.data; }, null, false);
+            }
+            return v;
+        },
+        //根据个人身份获取组织
+        //flag 数字    表示获取第几层的组织
+        //     字符串  表示获取指定类型的组织
+        //     空     表示获取直接所在的组织
+        getUnitByIdentity: function (name, flag) {
+            getOrgActions();
+            var getUnitMethod = "current";
+            var v;
+            if (flag) {
+                if (typeOf(flag) === "string") getUnitMethod = "type";
+                if (typeOf(flag) === "number") getUnitMethod = "level";
+            }
+            switch (getUnitMethod) {
+                case "current":
+                    var data = { "identityList": getNameFlag(name) };
+                    orgActions.listUnitWithIdentity(data, function (json) { v = json.data; v = (v && v.length === 1) ? v[0] : v }, null, false);
+                    break;
+                case "type":
+                    var data = { "identity": (typeOf(name) === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name, "type": flag };
+                    orgActions.getUnitWithIdentityAndType(data, function (json) { v = json.data; }, null, false);
+                    break;
+                case "level":
+                    var data = { "identity": (typeOf(name) === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name, "level": flag };
+                    orgActions.getUnitWithIdentityAndLevel(data, function (json) { v = json.data; }, null, false);
+                    break;
+            }
+            return v;
+        },
+        //列出身份所在组织的所有上级组织
+        listAllSupUnitWithIdentity: function (name) {
+            getOrgActions();
+            var data = { "identityList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitSupNestedWithIdentity(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //获取人员所在的所有组织
+        listUnitWithPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitWithPerson(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //列出身份所在组织的所有上级组织
+        listAllSupUnitWithPerson: function (name) {
+            getOrgActions();
+            var data = { "personList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitSupNestedWithPerson(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //根据组织属性,获取所有符合的组织
+        listUnitWithAttribute: function (name, attribute) {
+            getOrgActions();
+            var data = { "name": name, "attribute": attribute };
+            var v = null;
+            orgActions.listUnitWithAttribute(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //根据组织职务,获取所有符合的组织
+        listUnitWithDuty: function (name, id) {
+            getOrgActions();
+            var data = { "name": "", "identity": (typeOf(id) === "object") ? (id.distinguishedName || id.id || id.unique || id.name) : id };
+            var v = null;
+            orgActions.listUnitWithDuty(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //列出顶层组织
+        listTopUnit: function () {
+            var action = MWF.Actions.get("x_organization_assemble_control");
+            var v = null;
+            action.listTopUnit(function (json) {
+                v = json.data;
+            }, null, false);
+            return v;
+        },
+
+        //组织职务***********
+        //获取指定的组织职务的身份
+        getDuty: function (duty, id) {
+            getOrgActions();
+            var data = { "name": duty, "unit": (typeOf(id) === "object") ? (id.distinguishedName || id.id || id.unique || id.name) : id };
+            var v = null;
+            orgActions.getDuty(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+        //获取身份的所有职务名称
+        listDutyNameWithIdentity: function (name) {
+            getOrgActions();
+            var data = { "identityList": getNameFlag(name) };
+            var v = null;
+            orgActions.listDutyNameWithIdentity(data, function (json) { v = json.data.nameList; }, null, false);
+            return v;
+        },
+        //获取组织的所有职务名称
+        listDutyNameWithUnit: function (name) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            orgActions.listDutyNameWithUnit(data, function (json) { v = json.data.nameList; }, null, false);
+            return v;
+        },
+        //获取组织的所有职务
+        listUnitAllDuty: function (name) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitAllDuty(data, function (json) { v = json.data; }, null, false);
+            return v;
+        },
+
+        //组织属性**************
+        //添加组织属性值(在属性中添加values值,如果没有此属性,则创建一个)
+        appendUnitAttribute: function (unit, attr, values, success, failure) {
+            getOrgActions();
+            var unitFlag = (typeOf(unit) === "object") ? (unit.distinguishedName || unit.id || unit.unique || unit.name) : unit;
+            var data = { "attributeList": values, "name": attr, "unit": unitFlag };
+            orgActions.appendUnitAttribute(data, function (json) {
+                if (json.data.value) {
+                    if (success) success();
+                } else {
+                    if (failure) failure(null, "", "append values failed");
+                }
+            }, function (xhr, text, error) {
+                if (failure) failure(xhr, text, error);
+            }, false);
+        },
+        //设置组织属性值(将属性值修改为values,如果没有此属性,则创建一个)
+        setUnitAttribute: function (unit, attr, values, success, failure) {
+            getOrgActions();
+            var unitFlag = (typeOf(unit) === "object") ? (unit.distinguishedName || unit.id || unit.unique || unit.name) : unit;
+            var data = { "attributeList": values, "name": attr, "unit": unitFlag };
+            orgActions.setUnitAttribute(data, function (json) {
+                if (json.data.value) {
+                    if (success) success();
+                } else {
+                    if (failure) failure(null, "", "append values failed");
+                }
+            }, function (xhr, text, error) {
+                if (failure) failure(xhr, text, error);
+            }, false);
+        },
+        //获取组织属性值
+        getUnitAttribute: function (unit, attr) {
+            getOrgActions();
+            var unitFlag = (typeOf(unit) === "object") ? (unit.distinguishedName || unit.id || unit.unique || unit.name) : unit;
+            var data = { "name": attr, "unit": unitFlag };
+            var v = null;
+            orgActions.getUnitAttribute(data, function (json) { v = json.data.attributeList; }, null, false);
+            return v;
+        },
+        //列出组织所有属性的名称
+        listUnitAttributeName: function (name) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitAttributeName(data, function (json) { v = json.data.nameList; }, null, false);
+            return v;
+        },
+        //列出组织的所有属性
+        listUnitAllAttribute: function (name) {
+            getOrgActions();
+            var data = { "unitList": getNameFlag(name) };
+            var v = null;
+            orgActions.listUnitAllAttribute(data, function (json) { v = json.data; }, null, false);
+            return v;
+        }
+    };
+
+    this.Action = (function () {
+        var actions = [];
+        return function (root, json) {
+            var action = actions[root] || (actions[root] = new MWF.xDesktop.Actions.RestActions("", root, ""));
+            action.getActions = function (callback) {
+                if (!this.actions) this.actions = {};
+                Object.merge(this.actions, json);
+                if (callback) callback();
+            };
+            this.invoke = function (option) {
+                action.invoke(option)
+            }
+        }
+    })();
+    this.service = {
+        "jaxwsClient": {},
+        "jaxrsClient": {}
+    };
+
+    var lookupAction = null;
+    var getLookupAction = function (callback) {
+        if (!lookupAction) {
+            MWF.require("MWF.xDesktop.Actions.RestActions", function () {
+                lookupAction = new MWF.xDesktop.Actions.RestActions("", "x_processplatform_assemble_surface", "");
+                lookupAction.getActions = function (actionCallback) {
+                    this.actions = {
+                        //"lookup": {"uri": "/jaxrs/view/flag/{view}/application/flag/{application}"},
+                        //"getView": {"uri": "/jaxrs/view/{id}/design"}
+                        "lookup": { "uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}/execute", "method": "PUT" },
+                        "getView": { "uri": "/jaxrs/queryview/flag/{view}/application/flag/{application}" }
+                    };
+                    if (actionCallback) actionCallback();
+                }
+                if (callback) callback();
+            });
+        } else {
+            if (callback) callback();
+        }
+    };
+
+    this.view = {
+        "lookup": function (view, callback, async) {
+            var filterList = { "filterList": (view.filter || null) };
+            MWF.Actions.get("x_query_assemble_surface").loadView(view.view, view.application, filterList, function (json) {
+                var data = {
+                    "grid": json.data.grid || json.data.groupGrid,
+                    "groupGrid": json.data.groupGrid
+                };
+                if (callback) callback(data);
+            }, null, async);
+        },
+
+        "lookupV1": function (view, callback) {
+            getLookupAction(function () {
+                lookupAction.invoke({
+                    "name": "lookup", "async": true, "parameter": { "view": view.view, "application": view.application }, "success": function (json) {
+                        var data = {
+                            "grid": json.data.grid,
+                            "groupGrid": json.data.groupGrid
+                        };
+                        if (callback) callback(data);
+                    }.bind(this)
+                });
+            }.bind(this));
+        },
+        "select": function (view, callback, options) {
+            if (view.view) {
+                var viewJson = {
+                    "application": view.application || _form.json.application,
+                    "viewName": view.view || "",
+                    "isTitle": (view.isTitle === false) ? "no" : "yes",
+                    "select": (view.isMulti === false) ? "single" : "multi",
+                    "filter": view.filter
+                };
+                if (!options) options = {};
+                options.width = view.width;
+                options.height = view.height;
+                options.title = view.caption;
+
+                var width = options.width || "700";
+                var height = options.height || "400";
+
+                if (layout.mobile) {
+                    var size = document.body.getSize();
+                    width = size.x;
+                    height = size.y;
+                    options.style = "viewmobile";
+                }
+                width = width.toInt();
+                height = height.toInt();
+
+                var size = _form.app.content.getSize();
+                var x = (size.x - width) / 2;
+                var y = (size.y - height) / 2;
+                if (x < 0) x = 0;
+                if (y < 0) y = 0;
+                if (layout.mobile) {
+                    x = 20;
+                    y = 0;
+                }
+
+                var _self = this;
+                MWF.require("MWF.xDesktop.Dialog", function () {
+                    var dlg = new MWF.xDesktop.Dialog({
+                        "title": options.title || "select view",
+                        "style": options.style || "view",
+                        "top": y,
+                        "left": x - 20,
+                        "fromTop": y,
+                        "fromLeft": x - 20,
+                        "width": width,
+                        "height": height,
+                        "html": "<div style='height: 100%;'></div>",
+                        "maskNode": _form.app.content,
+                        "container": _form.app.content,
+                        "buttonList": [
+                            {
+                                "text": MWF.LP.process.button.ok,
+                                "action": function () {
+                                    //if (callback) callback(_self.view.selectedItems);
+                                    if (callback) callback(_self.view.getData());
+                                    this.close();
+                                }
+                            },
+                            {
+                                "text": MWF.LP.process.button.cancel,
+                                "action": function () { this.close(); }
+                            }
+                        ]
+                    });
+                    dlg.show();
+
+                    if (layout.mobile) {
+                        var backAction = dlg.node.getElement(".MWF_dialod_Action_back");
+                        var okAction = dlg.node.getElement(".MWF_dialod_Action_ok");
+                        if (backAction) backAction.addEvent("click", function (e) {
+                            dlg.close();
+                        }.bind(this));
+                        if (okAction) okAction.addEvent("click", function (e) {
+                            //if (callback) callback(this.view.selectedItems);
+                            if (callback) callback(this.view.getData());
+                            dlg.close();
+                        }.bind(this));
+                    }
+
+                    MWF.xDesktop.requireApp("query.Query", "Viewer", function () {
+                        this.view = new MWF.xApplication.query.Query.Viewer(dlg.content.getFirst(), viewJson, { "style": "select" }, _form.app, _form.Macro);
+                    }.bind(this));
+                }.bind(this));
+            }
+        }
+    };
+
+    //include 引用脚本
+    //optionsOrName : {
+    //  type : "", 默认为portal, 可以为 portal  process  cms
+    //  application : "", 门户/流程/CMS的名称/别名/id, 默认为当前应用
+    //  name : "" // 脚本名称/别名/id
+    //}
+    //或者name: "" // 脚本名称/别名/id
+    // if( !window.includedScripts ){
+    //     var includedScripts = window.includedScripts = [];
+    // }else{
+    //     var includedScripts = window.includedScripts;
+    // }
+    var includedScripts = [];
+    this.include = function (optionsOrName, callback) {
+        var options = optionsOrName;
+        if (typeOf(options) == "string") {
+            options = { name: options };
+        }
+        var name = options.name;
+        var type = (options.type && options.application) ? options.type : "portal";
+        var application = options.application || _form.json.application;
+        var key = type + "-" + application + "-" + name;
+        if (includedScripts.indexOf(key) > -1) {
+            if (callback) callback.apply(this);
+            return;
+        }
+        //if (includedScripts.indexOf( name )> -1){
+        //    if (callback) callback.apply(this);
+        //    return;
+        //}
+        var scriptAction;
+        switch (type) {
+            case "portal":
+                if (this.scriptActionPortal) {
+                    scriptAction = this.scriptActionPortal;
+                } else {
+                    MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
+                    scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
+                }
+                break;
+            case "process":
+                if (this.scriptActionProcess) {
+                    scriptAction = this.scriptActionProcess;
+                } else {
+                    MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
+                    scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
+                }
+                break;
+            case "cms":
+                if (this.scriptActionCMS) {
+                    scriptAction = this.scriptActionCMS;
+                } else {
+                    MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
+                    scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
+                }
+                break;
+        }
+        scriptAction.getScriptByName(application, name, includedScripts, function (json) {
+            if (json.data) {
+                includedScripts.push(key);
+                includedScripts = includedScripts.concat(json.data.importedList);
+                MWF.Macro.exec(json.data.text, this);
+                if (callback) callback.apply(this);
+            } else {
+                if (callback) callback.apply(this);
+            }
+        }.bind(this), null, false);
+    };
+
+    this.define = function (name, fun, overwrite) {
+        var over = true;
+        if (overwrite === false) over = false;
+        var o = {};
+        o[name] = { "value": fun, "configurable": over };
+        MWF.defineProperties(this, o);
+    }.bind(this);
+
+
+    //仅前台对象-----------------------------------------
+    //form
+    this.page = this.form = this.queryView = {
+        "getParentEnvironment" : function () { return _form.getParentEnvironment(); }, //视图嵌入的表单或页面的上下文
+        "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(); },
+        "getSelectedData" : function () { return _form.getSelectedData(); },
+        "setFilter" : function ( filter ) { return _form.setFilter(filter); },
+        "switchView" : function ( options ) { return _form.switchView(options); },
+
+        // "getInfor": function () { return ev.pageInfor; },
+        // "infor": ev.pageInfor,
+        // "getApp": function () { return _form.app; },
+        // "app": _form.app,
+        "node": function () { return _form.node; },
+        // "get": function (name) { return (_form.all) ? _form.all[name] : null; },
+        // "getWidgetModule": function (widget, moduleName) {
+        //     if (!_form.widgetModules || !_form.widgetModules[widget]) return null;
+        //     var module = _form.widgetModules[widget][moduleName];
+        //     return module || null;
+        // },
+        // "getField": function (name) { return _forms[name]; },
+        // "getAction": function () { return _form.workAction },
+        "getDesktop": function () { return _form.app ? _form.app.desktop : null},
+        // "getData": function () { return new MWF.xScript.JSONData(_form.getData()); },
+        //"save": function(callback){_form.saveWork(callback);},
+        // "close": function () { _form.closeWork(); },
+
+        // "print": function (application, form) {
+        //     _form.printWork(application, form);
+        // },
+
+        "confirm": function (type, title, text, width, height, ok, cancel, callback, mask, style) {
+            // var p = MWF.getCenter({"x": width, "y": height});
+            // e = {"event": {"clientX": p.x,"x": p.x,"clientY": p.y,"y": p.y}};
+            // _form.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style);
+            if ((arguments.length <= 1) || o2.typeOf(arguments[1]) === "string") {
+                var p = MWF.getCenter({ "x": width, "y": height });
+                e = { "event": { "clientX": p.x, "x": p.x, "clientY": p.y, "y": p.y } };
+                _form.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style);
+            } else {
+                e = (arguments.length > 1) ? arguments[1] : null;
+                title = (arguments.length > 2) ? arguments[2] : null;
+                text = (arguments.length > 3) ? arguments[3] : null;
+                width = (arguments.length > 4) ? arguments[4] : null;
+                height = (arguments.length > 5) ? arguments[5] : null;
+                ok = (arguments.length > 6) ? arguments[6] : null;
+                cancel = (arguments.length > 7) ? arguments[7] : null;
+                callback = (arguments.length > 8) ? arguments[8] : null;
+                mask = (arguments.length > 9) ? arguments[9] : null;
+                style = (arguments.length > 10) ? arguments[10] : null;
+                _form.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style);
+            }
+        },
+        "alert": function(type, title, text, width, height){
+            _form.alert(type, title, text, width, height);
+        },
+        "notice": function (content, type, target, where, offset, option) {
+            _form.notice(content, type, target, where, offset, option);
+        },
+        "addEvent": function (e, f) { _form.addEvent(e, f); },
+        // "openWindow": function (form, app) {
+        //     _form.openWindow(form, app);
+        // },
+        // "toPage": function (name, par, nohis) {
+        //     _form.app.toPage(name, par, nohis);
+        // },
+        // "toPortal": function (portal, page, par) {
+        //     _form.app.toPortal(portal, page, par);
+        // },
+        "openWork": function (id, completedId, title, options) {
+            var op = options || {};
+            op.workId = id;
+            op.workCompletedId = completedId;
+            op.docTitle = title;
+            op.appId = "process.Work" + (op.workId || op.workCompletedId);
+            return layout.desktop.openApplication(this.event, "process.Work", op);
+        },
+        "openJob": function (id, choice, options) {
+            var workData = null;
+            o2.Actions.get("x_processplatform_assemble_surface").listWorkByJob(id, function (json) {
+                if (json.data) workData = json.data;
+            }.bind(this), null, false);
+
+            if (workData) {
+                var len = workData.workList.length + workData.workCompletedList.length;
+                if (len) {
+                    if (len > 1 && choice) {
+                        var node = new Element("div", { "styles": { "padding": "20px", "width": "500px" } }).inject(_form.node);
+                        workData.workList.each(function (work) {
+                            var workNode = new Element("div", {
+                                "styles": {
+                                    "background": "#ffffff",
+                                    "border-radius": "10px",
+                                    "clear": "both",
+                                    "margin-bottom": "10px",
+                                    "height": "40px",
+                                    "padding": "10px 10px"
+                                }
+                            }).inject(node);
+                            var html = "<div style='height: 40px; width: 40px; float: left; background: url(/x_component_process_Xform/$Form/default/icon/work.png) no-repeat center center'></div>" +
+                                "<div style='height: 40px; width: 40px; float: right'><div class='MWFAction' style='height: 20px; width: 40px; margin-top: 10px; border: 1px solid #999999; border-radius: 5px;text-align: center; cursor: pointer'>" + o2.LP.widget.open + "</div></div>" +
+                                "<div style='height: 20px; line-height: 20px; margin: 0px 40px'>" + work.title + "</div>" +
+                                "<div style='margin: 0px 40px'><div style='color:#999999; float: left; margin-right: 10px'>" + work.activityName + "</div>" +
+                                "<div style='color:#999999; float: left; margin-right: 10px'>" + work.activityArrivedTime + "</div>" +
+                                "<div style='color:#999999; float: left; margin-right: 10px'>" + (work.manualTaskIdentityText || "") + "</div></div>";
+                            workNode.set("html", html);
+                            var action = workNode.getElement(".MWFAction");
+                            action.store("work", work);
+                            action.addEvent("click", function (e) {
+                                var work = e.target.retrieve("work");
+                                if (work) this.openWork(work.id, null, work.title, options);
+                                dlg.close();
+                            }.bind(this));
+
+                        }.bind(this));
+                        workData.workCompletedList.each(function (work) {
+                            var workNode = new Element("div", {
+                                "styles": {
+                                    "background": "#ffffff",
+                                    "border-radius": "10px",
+                                    "clear": "both",
+                                    "margin-bottom": "10px",
+                                    "height": "40px",
+                                    "padding": "10px 10px"
+                                }
+                            }).inject(node);
+                            var html = "<div style='height: 40px; width: 40px; float: left; background: url(/x_component_process_Xform/$Form/default/icon/work.png) no-repeat center center'></div>" +
+                                "<div style='height: 40px; width: 40px; float: right'><div class='MWFAction' style='height: 20px; width: 40px; margin-top: 10px; border: 1px solid #999999; border-radius: 5px;text-align: center; cursor: pointer'>" + o2.LP.widget.open + "</div></div>" +
+                                "<div style='height: 20px; line-height: 20px; margin: 0px 40px'>" + work.title + "</div>" +
+                                "<div style='margin: 0px 40px'><div style='color:#999999; float: left; margin-right: 10px'>" + o2.LP.widget.workcompleted + "</div>" +
+                                "<div style='color:#999999; float: left; margin-right: 10px'>" + work.completedTime + "</div>";
+                            workNode.set("html", html);
+                            var action = workNode.getElement(".MWFAction");
+                            action.store("work", work);
+                            action.addEvent("click", function (e) {
+                                var work = e.target.retrieve("work");
+                                if (work) this.openWork(null, work.id, work.title, options);
+                                dlg.close();
+                            }.bind(this));
+
+                        }.bind(this));
+                        var height = node.getSize().y + 20;
+                        if (height > 600) height = 600;
+
+                        var dlg = o2.DL.open({
+                            "title": o2.LP.widget.choiceWork,
+                            "style": "user",
+                            "isResize": false,
+                            "content": node,
+                            "buttonList": [
+                                {
+                                    "type": "cancel",
+                                    "text": o2.LP.widget.close,
+                                    "action": function () { dlg.close(); }
+                                }
+                            ]
+                        });
+                    } else {
+                        if (workData.workList.length) {
+                            var work = workData.workList[0];
+                            return this.openWork(work.id, null, work.title, options);
+                        } else {
+                            var work = workData.workCompletedList[0];
+                            return this.openWork(null, work.id, work.title, options);
+                        }
+                    }
+                }
+            }
+        },
+        "openDocument": function (id, title, options) {
+            var op = options || {};
+            op.documentId = id;
+            op.docTitle = title || "";
+            layout.desktop.openApplication(this.event, "cms.Document", op);
+        },
+        "openPortal": function (name, page, par) {
+            var action = MWF.Actions.get("x_portal_assemble_surface");
+            action.getApplication(name, function (json) {
+                if (json.data) {
+                    if (page) {
+                        action.getPageByName(page, json.data.id, function (pageJson) {
+                            layout.desktop.openApplication(null, "portal.Portal", {
+                                "portalId": json.data.id,
+                                "pageId": (pageJson.data) ? pageJson.data.id : "",
+                                "parameters": par,
+                                "appId": "portal.Portal" + json.data.id
+                            })
+                        });
+                    } else {
+                        layout.desktop.openApplication(null, "portal.Portal", {
+                            "portalId": json.data.id,
+                            "parameters": par,
+                            "appId": "portal.Portal" + json.data.id
+                        })
+                    }
+                }
+
+            });
+        },
+        "openCMS": function (name) {
+            var action = MWF.Actions.get("x_cms_assemble_control");
+            action.getColumn(name, function (json) {
+                if (json.data) {
+                    layout.desktop.openApplication(null, "cms.Module", {
+                        "columnId": json.data.id,
+                        "appId": "cms.Module" + json.data.id
+                    });
+                }
+            });
+        },
+        "openProcess": function (name) {
+            var action = MWF.Actions.get("x_processplatform_assemble_surface");
+            action.getApplication(name, function (json) {
+                if (json.data) {
+                    layout.desktop.openApplication(null, "process.Application", {
+                        "id": json.data.id,
+                        "appId": "process.Application" + json.data.id
+                    });
+                }
+            });
+        },
+        "openApplication": function (name, options) {
+            layout.desktop.openApplication(null, name, options);
+        },
+        "createDocument": function (columnOrOptions, category, data, identity, callback, target, latest, selectColumnEnable, ignoreTitle) {
+            var column = columnOrOptions;
+            if (typeOf(columnOrOptions) == "object") {
+                column = columnOrOptions.column;
+                category = columnOrOptions.category;
+                data = columnOrOptions.data;
+                identity = columnOrOptions.identity;
+                callback = columnOrOptions.callback;
+                target = columnOrOptions.target;
+                latest = columnOrOptions.latest;
+                selectColumnEnable = columnOrOptions.selectColumnEnable;
+                ignoreTitle = columnOrOptions.ignoreTitle;
+            }
+            if (target) {
+                if (layout.app && layout.app.inBrowser) {
+                    layout.app.content.empty();
+                    layout.app = null;
+                }
+            }
+
+            MWF.xDesktop.requireApp("cms.Index", "Newer", function () {
+                var starter = new MWF.xApplication.cms.Index.Newer(null, null, _form.app, null, {
+                    "documentData": data,
+                    "identity": identity,
+
+                    "ignoreTitle": ignoreTitle === true,
+                    "ignoreDrafted": latest === false,
+                    "selectColumnEnable": !category || selectColumnEnable === true,
+                    "restrictToColumn": !!category && selectColumnEnable !== true,
+
+                    "categoryFlag": category, //category id or name
+                    "columnFlag": column, //column id or name,
+                    "onStarted": function (documentId, data) {
+                        if (callback) callback();
+                    },
+                    "onPostLoad": function () {
+                    },
+                    "onPostPublish": function () {
+                    }
+                });
+                starter.load();
+            })
+        },
+        "startProcess": function (app, process, data, identity, callback, target, latest) {
+            debugger;
+            if (arguments.length > 2) {
+                for (var i = 2; i < arguments.length; i++) {
+                    if (typeOf(arguments[i]) == "boolean") {
+                        target = arguments[i];
+                        break;
+                    }
+                }
+            }
+
+            if (target) {
+                if (layout.app && layout.app.inBrowser) {
+                    //layout.app.content.empty();
+                    layout.app.$openWithSelf = true;
+                }
+            }
+            var action = MWF.Actions.get("x_processplatform_assemble_surface").getProcessByName(process, app, function (json) {
+                if (json.data) {
+                    MWF.xDesktop.requireApp("process.TaskCenter", "ProcessStarter", function () {
+                        var starter = new MWF.xApplication.process.TaskCenter.ProcessStarter(json.data, _form.app, {
+                            "workData": data,
+                            "identity": identity,
+                            "latest": latest,
+                            "onStarted": function (data, title, processName) {
+                                var currentTask = [];
+                                data.each(function (work) {
+                                    if (work.currentTaskIndex != -1) currentTask.push(work.taskList[work.currentTaskIndex].work);
+                                }.bind(this));
+
+                                if (currentTask.length == 1) {
+                                    var options = { "workId": currentTask[0], "appId": currentTask[0] };
+                                    layout.desktop.openApplication(null, "process.Work", options);
+                                } else { }
+
+                                if (callback) callback(data);
+                            }.bind(this)
+                        });
+                        starter.load();
+                    }.bind(this));
+                }
+            });
+        }
+        //"app": _form.app
+    };
+    // this.form.currentRouteName = _form.json.currentRouteName;
+    // this.form.opinion = _form.json.opinion;
+
+    this.target = ev.target;
+    this.event = ev.event;
+    this.status = ev.status;
+    this.session = layout.desktop.session;
+    this.Actions = o2.Actions;
+
+    this.query = function (option) {
+        // options = {
+        //      "name": "statementName",
+        //      "data": "json data",
+        //      "firstResult": 1,
+        //      "maxResults": 100,
+        //      "success": function(){},
+        //      "error": function(){},
+        //      "async": true or false, default is true
+        // }
+        if (option) {
+            var json = (option.data) || {};
+            if (option.firstResult) json.firstResult = option.firstResult.toInt();
+            if (option.maxResults) json.maxResults = option.maxResults.toInt();
+            o2.Actions.get("x_query_assemble_surface").executeStatement(option.name, json, success, error, options.async);
+        }
+    };
+    // this.Table = MWF.xScript.createTable();
+};
+

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

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

+ 93 - 0
o2web/source/x_component_process_FormDesigner/Module/View.js

@@ -14,6 +14,9 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
 		this.path = "/x_component_process_FormDesigner/Module/View/";
 		this.path = "/x_component_process_FormDesigner/Module/View/";
 		this.cssPath = "/x_component_process_FormDesigner/Module/View/"+this.options.style+"/css.wcss";
 		this.cssPath = "/x_component_process_FormDesigner/Module/View/"+this.options.style+"/css.wcss";
 
 
+        this.imagePath_default = "/x_component_query_ViewDesigner/$View/";
+        this.imagePath_custom = "/x_component_process_FormDesigner/Module/Actionbar/";
+
 		this._loadCss();
 		this._loadCss();
 		this.moduleType = "element";
 		this.moduleType = "element";
 		this.moduleName = "view";
 		this.moduleName = "view";
@@ -103,6 +106,7 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
         this.viewNode = this.node.getChildren("div")[1];
         this.viewNode = this.node.getChildren("div")[1];
         if (this.viewNode){
         if (this.viewNode){
             this.node.setStyle("background", "transparent");
             this.node.setStyle("background", "transparent");
+            this.actionbarNode = this.viewNode.getChildren("div")[0];
             this.viewTable = this.viewNode.getElement("table").setStyles(this.css.viewTitleTableNode);
             this.viewTable = this.viewNode.getElement("table").setStyles(this.css.viewTitleTableNode);
             this.viewLine = this.viewTable.getElement("tr").setStyles(this.css.viewTitleLineNode);
             this.viewLine = this.viewTable.getElement("tr").setStyles(this.css.viewTitleLineNode);
             this.viewSelectCell = this.viewLine.getElement("td");
             this.viewSelectCell = this.viewLine.getElement("td");
@@ -112,9 +116,13 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
         }
         }
 	},
 	},
     _createViewNode: function(callback){
     _createViewNode: function(callback){
+
         if (!this.viewNode) this.viewNode = new Element("div", {"styles": this.css.viewNode}).inject(this.node);
         if (!this.viewNode) this.viewNode = new Element("div", {"styles": this.css.viewNode}).inject(this.node);
+        if( !this.actionbarNode)this.actionbarNode = new Element("div.actionbarNode",{}).inject( this.viewNode, "top" );
+
         this.node.setStyle("background", "transparent");
         this.node.setStyle("background", "transparent");
 
 
+
         this.viewTable = new Element("table", {
         this.viewTable = new Element("table", {
             "styles": this.css.viewTitleTableNode,
             "styles": this.css.viewTitleTableNode,
             "border": "0px",
             "border": "0px",
@@ -132,6 +140,13 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
 
 
         MWF.Actions.get("x_query_assemble_designer").getView(this.json["queryView"].id, function(json){
         MWF.Actions.get("x_query_assemble_designer").getView(this.json["queryView"].id, function(json){
             var viewData = JSON.decode(json.data.data);
             var viewData = JSON.decode(json.data.data);
+
+            this.viewData = viewData;
+            if( this.json.actionbar === "show" ){
+                this.actionbarList = [];
+                this._showActionbar();
+            }
+
             var columnList = viewData.selectEntryList || viewData.selectList;
             var columnList = viewData.selectEntryList || viewData.selectList;
             columnList.each(function(column){
             columnList.each(function(column){
                 if (!column.hideColumn){
                 if (!column.hideColumn){
@@ -176,6 +191,9 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
             this.treeNode.setTitle(this.json.id);
             this.treeNode.setTitle(this.json.id);
             this.node.set("id", this.json.id);
             this.node.set("id", this.json.id);
         }
         }
+        if(name=="actionbar"){
+            input.get("value") === "show" ? this._showActionbar() : this._hideActionbar();
+        }
 
 
         this._setEditStyle_custom(name, input, oldValue);
         this._setEditStyle_custom(name, input, oldValue);
 
 
@@ -231,5 +249,80 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
     _checkTitle: function(){
     _checkTitle: function(){
         if (!this.json["isTitle"]) this.json["isTitle"] = "yes";
         if (!this.json["isTitle"]) this.json["isTitle"] = "yes";
         if (this.viewNode) this._setViewNodeTitle();
         if (this.viewNode) this._setViewNodeTitle();
+    },
+
+    _hideActionbar : function(){
+        if(this.actionbarNode)this.actionbarNode.hide();
+    },
+    _showActionbar : function(){
+	    if( !this.actionbarNode )return;
+        MWF.require("MWF.widget.Toolbar", null, false);
+        this.actionbarNode.show();
+        if( !this.viewData.actionbarList )this.viewData.actionbarList = [];
+        if( !this.actionbarList || this.actionbarList.length == 0 ){
+            this.actionbarNode.empty();
+            if( this.viewData.actionbarList.length ){
+                if( !this.actionbarList )this.actionbarList = [];
+                this.viewData.actionbarList.each( function(json){
+
+                    var toolbarWidget = new MWF.widget.Toolbar(this.actionbarNode, {"style": json.style}, this);
+                    if (json.actionStyles)toolbarWidget.css = json.actionStyles;
+
+                    if( !json.hideSystemTools )this.setToolbars( json.defaultTools, this.actionbarNode, json );
+                    this.setCustomToolbars( json.tools, this.actionbarNode, json );
+
+                    toolbarWidget.load();
+                    this.actionbarList.push( toolbarWidget );
+                }.bind(this));
+            }else{
+
+            }
+        }
+    },
+    setToolbars: function(tools, node, json){
+	    var style = "default";
+        tools.each(function(tool){
+            var actionNode = new Element("div", {
+                "MWFnodetype": tool.type,
+                "MWFButtonImage": this.imagePath_default+""+style+"/actionbar/"+tool.img,
+                "title": tool.title,
+                "MWFButtonAction": tool.action,
+                "MWFButtonText": tool.text
+            }).inject(node);
+            if( this.json.iconOverStyle ){
+                actionNode.set("MWFButtonImageOver" , this.imagePath_default+""+ style+"/actionbar/"+json.iconOverStyle+"/"+tool.img );
+            }
+            // this.systemTools.push(actionNode);
+            // if (tool.sub){
+            //     var subNode = node.getLast();
+            //     this.setToolbars(tool.sub, subNode);
+            // }
+        }.bind(this));
+    },
+    setCustomToolbars: function(tools, node, json){
+        //var style = (this.json.style || "default").indexOf("red") > -1 ? "red" : "blue";
+        var path = "";
+        if( json.customIconStyle ){
+            path = json.customIconStyle+ "/";
+        }
+        var customImageStyle = "default";
+
+        tools.each(function(tool){
+            var actionNode = new Element("div", {
+                "MWFnodetype": tool.type,
+                "MWFButtonImage": this.imagePath_custom+""+customImageStyle +"/custom/"+path+tool.img,
+                "title": tool.title,
+                "MWFButtonAction": tool.action,
+                "MWFButtonText": tool.text
+            }).inject(node);
+            if( this.json.customIconOverStyle ){
+                actionNode.set("MWFButtonImageOver" , this.imagePath_custom+""+customImageStyle +"/custom/"+json.customIconOverStyle+ "/" +tool.img );
+            }
+            // this.customTools.push(actionNode);
+            // if (tool.sub){
+            //     var subNode = node.getLast();
+            //     this.setCustomToolbars(tool.sub, subNode);
+            // }
+        }.bind(this));
     }
     }
 });
 });

+ 7 - 0
o2web/source/x_component_process_FormDesigner/Module/View/view.html

@@ -166,6 +166,13 @@
 					</select>
 					</select>
 				</td>
 				</td>
 			</tr>
 			</tr>
+			<tr>
+				<td class="editTableTitle">操作条</td>
+				<td class="editTableValue">
+					<input class="editTableRadio" name="actionbar" text{($.actionbar=='show')?'checked':''} type="radio" value="show"/>显示
+					<input class="editTableRadio" name="actionbar" text{($.actionbar!='show')?'checked':''} type="radio" value="hidden"/>不显示
+				</td>
+			</tr>
 			<!--<tr>-->
 			<!--<tr>-->
 			<!--<td class="editTableTitle">打开文件</td>-->
 			<!--<td class="editTableTitle">打开文件</td>-->
 			<!--<td class="editTableValue">-->
 			<!--<td class="editTableValue">-->

+ 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);
         if (form.scriptDesigner) form.scriptDesigner.addScriptItem(this.data, "code", this.editor.module, this.editor.scriptPath+"."+this.event);
 	},
 	},
     deleteScriptDesignerItem: function(){
     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){
         if (form.scriptDesigner){
             form.scriptDesigner.deleteScriptItem(this.editor.module, this.editor.scriptPath+"."+this.event);
             form.scriptDesigner.deleteScriptItem(this.editor.module, this.editor.scriptPath+"."+this.event);
         }
         }

+ 2 - 2
o2web/source/x_component_process_Xform/Checkbox.js

@@ -123,7 +123,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
 
 
                 radio.addEvent("click", function(){
                 radio.addEvent("click", function(){
                     this.validationMode();
                     this.validationMode();
-                    if (this.validation()) this._setBusinessData(this.getInputData("change"));
+                    if (this.validation()) this._setBusinessData(this.getInputData("change") || []);
                 }.bind(this));
                 }.bind(this));
 
 
                 Object.each(this.json.events, function(e, key){
                 Object.each(this.json.events, function(e, key){
@@ -190,7 +190,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
                 }
                 }
             });
             });
         }
         }
-        return (value.length) ? value : null;
+        return (value.length) ? value : [];
     },
     },
     resetData: function(){
     resetData: function(){
         this.setData(this.getValue());
         this.setData(this.getValue());

+ 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.fireEvent("openDocument");
                     this.openOptions = null;
                     this.openOptions = null;
                 }.bind(this)
                 }.bind(this)
-            });
+            }, this.form.app, this.form.Macro);
         //}.bind(this));
         //}.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(){
                     "onPostShow": function(){
                         MWF.xDesktop.requireApp("query.Query", "Viewer", 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, this.form.Macro );
                         }.bind(this));
                         }.bind(this));
                     }.bind(this)
                     }.bind(this)
                 });
                 });

+ 9 - 10
o2web/source/x_component_query_Query/$Viewer/default/css.wcss

@@ -164,7 +164,7 @@
         "border": "1px solid #cccccc",
         "border": "1px solid #cccccc",
         "float": "none",
         "float": "none",
         "margin": "10px",
         "margin": "10px",
-        "border-radius": "5px",
+        "border-radius": "5px"
     },
     },
     "viewFilterSearchCustomActionNode": {
     "viewFilterSearchCustomActionNode": {
         "height": "24px",
         "height": "24px",
@@ -249,16 +249,16 @@
     "viewFilterSearchCustomPathListNode": {
     "viewFilterSearchCustomPathListNode": {
         "border": "0px",
         "border": "0px",
         "border-radius": "5px",
         "border-radius": "5px",
-        "height": "80px",
+        "height": "74px",
         "padding": "3px",
         "padding": "3px",
-        "width": "99px",
+        "width": "93px",
         "font-size": "12px"
         "font-size": "12px"
     },
     },
     "viewFilterSearchCustomComparisonListNode": {
     "viewFilterSearchCustomComparisonListNode": {
         "border": "0px",
         "border": "0px",
-        "height": "80px",
+        "height": "74px",
         "padding": "3px",
         "padding": "3px",
-        "width": "99px",
+        "width": "93px",
         "font-size": "12px"
         "font-size": "12px"
     },
     },
     "viewFilterSearchOptionNode": {
     "viewFilterSearchOptionNode": {
@@ -288,8 +288,7 @@
         "float": "left"
         "float": "left"
     },
     },
     "viewSearchFilterNode_over": {
     "viewSearchFilterNode_over": {
-        "border": "1px solid #fe9145",
-        //"color": "#fe9145",
+        "border": "1px solid #fe9145"
     },
     },
     "viewSearchFilterSelectAreaNode": {
     "viewSearchFilterSelectAreaNode": {
         "height": "17px",
         "height": "17px",
@@ -313,7 +312,7 @@
         "width": "13px",
         "width": "13px",
         "margin": "2px 0px",
         "margin": "2px 0px",
         "border-radius": "6px",
         "border-radius": "6px",
-        "background-color": "#666666",
+        "background-color": "#666666"
     },
     },
     "viewSearchFilterSelectButtonNode_over": {
     "viewSearchFilterSelectButtonNode_over": {
         "background-color": "#fe9145"
         "background-color": "#fe9145"
@@ -416,7 +415,7 @@
         "z-index": "200"
         "z-index": "200"
     },
     },
     "worksAreaTitleNode": {
     "worksAreaTitleNode": {
-        "height": "20px",
+        "height": "20px"
     },
     },
     "worksAreaTitleCloseNode": {
     "worksAreaTitleCloseNode": {
         "width": "20px",
         "width": "20px",
@@ -437,7 +436,7 @@
     },
     },
     "workAreaTitleNode": {
     "workAreaTitleNode": {
         "height": "20px",
         "height": "20px",
-        "line-height": "20px",
+        "line-height": "20px"
     },
     },
     "workAreaContentNode": {
     "workAreaContentNode": {
         "height": "20px",
         "height": "20px",

+ 2 - 2
o2web/source/x_component_query_Query/$Viewer/select/css.wcss

@@ -17,7 +17,7 @@
         "height": "30px"
         "height": "30px"
     },
     },
     "viewPageAreaNode": {
     "viewPageAreaNode": {
-        "height": "24px",
+        "height": "24px"
         //"margin-top": "28px"
         //"margin-top": "28px"
     },
     },
     "viewPageContentNode": {
     "viewPageContentNode": {
@@ -161,7 +161,7 @@
         "border": "1px solid #cccccc",
         "border": "1px solid #cccccc",
         "float": "none",
         "float": "none",
         "margin": "10px",
         "margin": "10px",
-        "border-radius": "5px",
+        "border-radius": "5px"
     },
     },
     "viewFilterSearchCustomActionNode": {
     "viewFilterSearchCustomActionNode": {
         "height": "24px",
         "height": "24px",

+ 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,
                 "application": this.view.query,
                 "viewName": this.view.name,
                 "viewName": this.view.name,
                 "isExpand": data.isExpand
                 "isExpand": data.isExpand
-            }, {"export": true});
+            }, {"export": true}, this.app);
         }.bind(this));
         }.bind(this));
     }
     }
 
 

+ 624 - 131
o2web/source/x_component_query_Query/Viewer.js

@@ -1,6 +1,7 @@
 MWF.xApplication.query = MWF.xApplication.query || {};
 MWF.xApplication.query = MWF.xApplication.query || {};
 MWF.xApplication.query.Query = MWF.xApplication.query.Query || {};
 MWF.xApplication.query.Query = MWF.xApplication.query.Query || {};
 MWF.require("MWF.widget.Common", null, false);
 MWF.require("MWF.widget.Common", null, false);
+MWF.require("o2.widget.Paging", null, false);
 MWF.require("MWF.xScript.Macro", null, false);
 MWF.require("MWF.xScript.Macro", null, false);
 MWF.xDesktop.requireApp("query.Query", "lp.zh-cn", null, false);
 MWF.xDesktop.requireApp("query.Query", "lp.zh-cn", null, false);
 MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
@@ -12,7 +13,10 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         "paging" : "scroll",
         "paging" : "scroll",
         "perPageCount" : 50,
         "perPageCount" : 50,
         "isload": "true",
         "isload": "true",
-        "export": false
+        "export": false,
+        "moduleEvents": ["queryLoad", "postLoad", "postLoadPageData", "postLoadPage", "selectRow", "unselectRow",
+            "queryLoadItemRow", "postLoadItemRow", "queryLoadCategoryRow", "postLoadCategoryRow"]
+
         // "actions": {
         // "actions": {
         //     "lookup": {"uri": "/jaxrs/view/flag/{view}/query/{application}/execute", "method":"PUT"},
         //     "lookup": {"uri": "/jaxrs/view/flag/{view}/query/{application}/execute", "method":"PUT"},
         //     "getView": {"uri": "/jaxrs/view/flag/{view}/query/{application}"}
         //     "getView": {"uri": "/jaxrs/view/flag/{view}/query/{application}"}
@@ -20,7 +24,12 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         // },
         // },
         // "actionRoot": "x_query_assemble_surface"
         // "actionRoot": "x_query_assemble_surface"
     },
     },
-    initialize: function(container, json, options){
+    initialize: function(container, json, options, app, parentMacro){
+        //本类有三种事件,
+        //一种是通过 options 传进来的事件,包括 loadView、openDocument、select
+        //一种是用户配置的 事件, 在this.options.moduleEvents 中定义的作为类事件
+        //还有一种也是用户配置的事件,不在this.options.moduleEvents 中定义的作为 this.node 的DOM事件
+
         this.setOptions(options);
         this.setOptions(options);
 
 
         this.path = "/x_component_query_Query/$Viewer/";
         this.path = "/x_component_query_Query/$Viewer/";
@@ -28,9 +37,16 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         this._loadCss();
         this._loadCss();
         this.lp = MWF.xApplication.query.Query.LP;
         this.lp = MWF.xApplication.query.Query.LP;
 
 
+        this.app = app;
+
         this.container = $(container);
         this.container = $(container);
         this.json = json;
         this.json = json;
 
 
+        this.parentMacro = parentMacro;
+
+        debugger;
+        this.originalJson = Object.clone(json);
+
         this.viewJson = null;
         this.viewJson = null;
         this.filterItems = [];
         this.filterItems = [];
         this.searchStatus = "none"; //none, custom, default
         this.searchStatus = "none"; //none, custom, default
@@ -48,6 +64,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
                 this.load();
                 this.load();
             }.bind(this));
             }.bind(this));
         }
         }
+
     },
     },
     loadView: function(){
     loadView: function(){
         if (this.viewJson){
         if (this.viewJson){
@@ -67,8 +84,18 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         }
         }
     },
     },
     load: function(){
     load: function(){
+        this.loadMacro( function () {
+            this._loadModuleEvents();
+            if (this.fireEvent("queryLoad")){
+                this._loadUserInterface();
+                //this._loadStyles();
+                this._loadDomEvents();
+            }
+        }.bind(this))
+    },
+    _loadUserInterface : function(){
         this.loadLayout();
         this.loadLayout();
-        this.createExportNode();
+        this.createActionbarNode();
         this.createSearchNode();
         this.createSearchNode();
         this.createViewNode({"filterList": this.json.filter  ? this.json.filter.clone() : null});
         this.createViewNode({"filterList": this.json.filter  ? this.json.filter.clone() : null});
 
 
@@ -80,16 +107,23 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
     },
     },
     loadLayout: function(){
     loadLayout: function(){
         this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
         this.node = new Element("div", {"styles": this.css.node}).inject(this.container);
-        if (this.options.export) this.exportAreaNode = new Element("div", {"styles": this.css.exportAreaNode}).inject(this.node);
+        this.actionbarAreaNode =  new Element("div", {"styles": this.css.actionbarAreaNode}).inject(this.node);
+        //if (this.options.export) this.exportAreaNode = new Element("div", {"styles": this.css.exportAreaNode}).inject(this.node);
         this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.node);
         this.searchAreaNode = new Element("div", {"styles": this.css.searchAreaNode}).inject(this.node);
         this.viewAreaNode = new Element("div", {"styles": this.css.viewAreaNode}).inject(this.node);
         this.viewAreaNode = new Element("div", {"styles": this.css.viewAreaNode}).inject(this.node);
         this.viewPageNode = new Element("div", {"styles": this.css.viewPageNode}).inject(this.node);
         this.viewPageNode = new Element("div", {"styles": this.css.viewPageNode}).inject(this.node);
         this.viewPageAreaNode = new Element("div", {"styles": this.css.viewPageAreaNode}).inject(this.viewPageNode);
         this.viewPageAreaNode = new Element("div", {"styles": this.css.viewPageAreaNode}).inject(this.viewPageNode);
     },
     },
+    loadMacro: function (callback) {
+        MWF.require("MWF.xScript.Macro", function () {
+            this.Macro = new MWF.Macro.ViewContext(this);
+            if (callback) callback();
+        }.bind(this));
+    },
     createExportNode: function(){
     createExportNode: function(){
         if (this.options.export){
         if (this.options.export){
             MWF.require("MWF.widget.Toolbar", function(){
             MWF.require("MWF.widget.Toolbar", function(){
-                this.toolbar = new MWF.widget.Toolbar(this.exportAreaNode, {"style": "simple"}, this);
+                this.toolbar = new MWF.widget.Toolbar(this.actionbarAreaNode, {"style": "simple"}, this); //this.exportAreaNode
                 var actionNode = new Element("div", {
                 var actionNode = new Element("div", {
                     "id": "",
                     "id": "",
                     "MWFnodetype": "MWFToolBarButton",
                     "MWFnodetype": "MWFToolBarButton",
@@ -97,7 +131,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
                     "title": this.lp.exportExcel,
                     "title": this.lp.exportExcel,
                     "MWFButtonAction": "exportView",
                     "MWFButtonAction": "exportView",
                     "MWFButtonText": this.lp.exportExcel
                     "MWFButtonText": this.lp.exportExcel
-                }).inject(this.exportAreaNode);
+                }).inject(this.actionbarAreaNode); //this.exportAreaNode
 
 
                 this.toolbar.load();
                 this.toolbar.load();
             }.bind(this));
             }.bind(this));
@@ -513,8 +547,12 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         var size = this.node.getSize();
         var size = this.node.getSize();
         var searchSize = this.searchAreaNode.getComputedSize();
         var searchSize = this.searchAreaNode.getComputedSize();
         var h = size.y-searchSize.totalHeight;
         var h = size.y-searchSize.totalHeight;
-        if (this.exportAreaNode){
-            var exportSize = this.exportAreaNode.getComputedSize();
+        //if (this.exportAreaNode){
+        //    var exportSize = this.exportAreaNode.getComputedSize();
+        //    h = h-exportSize.totalHeight;
+        //}
+        if( this.actionbarAreaNode ){
+            var exportSize = this.actionbarAreaNode.getComputedSize();
             h = h-exportSize.totalHeight;
             h = h-exportSize.totalHeight;
         }
         }
         var pageSize = this.viewPageNode.getComputedSize();
         var pageSize = this.viewPageNode.getComputedSize();
@@ -529,6 +567,16 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         var loadingTextNode = new Element("div", {"styles": this.css.viewLoadingTextNode}).inject(loadingNode);
         var loadingTextNode = new Element("div", {"styles": this.css.viewLoadingTextNode}).inject(loadingNode);
         loadingTextNode.set("text", "loading...");
         loadingTextNode.set("text", "loading...");
     },
     },
+    createActionbarNode : function(){
+        this.actionbarAreaNode.empty();
+        if( typeOf( this.viewJson.actionbarHidden ) === "boolean" ){
+            if( this.viewJson.actionbarHidden === true || !this.viewJson.actionbarList || !this.viewJson.actionbarList.length )return;
+            this.actionbar = new MWF.xApplication.query.Query.Viewer.Actionbar(this.actionbarAreaNode, this.viewJson.actionbarList[0], this, {});
+            this.actionbar.load();
+        }else{ //兼容以前的ExportNode
+            this.createExportNode();
+        }
+    },
     createViewNode: function(data){
     createViewNode: function(data){
         this.viewAreaNode.empty();
         this.viewAreaNode.empty();
         this.contentAreaNode = new Element("div", {"styles": this.css.contentAreaNode}).inject(this.viewAreaNode);
         this.contentAreaNode = new Element("div", {"styles": this.css.contentAreaNode}).inject(this.viewAreaNode);
@@ -545,11 +593,11 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
             this.viewTitleLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
             this.viewTitleLine = new Element("tr", {"styles": this.css.viewTitleLineNode}).inject(this.viewTable);
 
 
             //if (this.json.select==="single" || this.json.select==="multi") {
             //if (this.json.select==="single" || this.json.select==="multi") {
-                this.selectTitleCell = new Element("td", {
-                    "styles": this.css.viewTitleCellNode
-                }).inject(this.viewTitleLine);
-                this.selectTitleCell.setStyle("width", "10px");
-                if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
+            this.selectTitleCell = new Element("td", {
+                "styles": this.css.viewTitleCellNode
+            }).inject(this.viewTitleLine);
+            this.selectTitleCell.setStyle("width", "10px");
+            if (this.json.titleStyles) this.selectTitleCell.setStyles(this.json.titleStyles);
             //}
             //}
 
 
             //序号
             //序号
@@ -587,75 +635,103 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
             this.lookup(data);
             this.lookup(data);
         }
         }
     },
     },
-    _loadPageCountNode: function(){
-        this.viewPageContentNode.empty();
-
-        var size = this.viewPageAreaNode.getSize();
-        var w1 = this.viewPageFirstNode.getSize().x*2;
-        var w2 = this.viewPageContentNode.getStyle("margin-left").toInt();
-        var w = size.x-w1-w2;
-
-        var bw = this.css.viewPageButtonNode.width.toInt()+this.css.viewPageButtonNode["margin-right"].toInt();
-        var count = (w/bw).toInt()-2;
-        if (count>10) count = 10;
-        this.showPageCount = Math.min(count, this.pages);
-
-        var tmp = this.showPageCount/2;
-        var n = tmp.toInt();
-        var left = this.currentPage-n;
-        if (left<=0) left = 1;
-        var right = this.showPageCount + left-1;
-        if (right>this.pages) right = this.pages;
-        left = right-this.showPageCount+1;
-        if (left<=1) left = 1;
-
-        this.viewPagePrevNode = new Element("div", {"styles": this.css.viewPagePrevButtonNode}).inject(this.viewPageContentNode);
-        this.loadPageButtonEvent(this.viewPagePrevNode, "viewPagePrevButtonNode_over", "viewPagePrevButtonNode_up", "viewPagePrevButtonNode_down", function(){
-            if (this.currentPage>1) this.currentPage--;
-            this.loadCurrentPageData();
-        }.bind(this));
-
-        for (i=left; i<=right; i++){
-            var node = new Element("div", {"styles": this.css.viewPageButtonNode, "text": i}).inject(this.viewPageContentNode);
-            if (i==this.currentPage){
-                node.setStyles(this.css.viewPageButtonNode_current);
-            }else{
-                this.loadPageButtonEvent(node, "viewPageButtonNode_over", "viewPageButtonNode_up", "viewPageButtonNode_down", function(e){
-                    this.currentPage = e.target.get("text").toInt();
-                    this.loadCurrentPageData();
-                }.bind(this));
-            }
-        }
-        this.viewPageNextNode = new Element("div", {"styles": this.css.viewPageNextButtonNode}).inject(this.viewPageContentNode);
-        this.loadPageButtonEvent(this.viewPageNextNode, "viewPageNextButtonNode_over", "viewPageNextButtonNode_up", "viewPageNextButtonNode_down", function(){
-            if (this.currentPage<=this.pages-1) this.currentPage++;
-            this.loadCurrentPageData();
-        }.bind(this));
-    },
-    loadPageButtonEvent: function(node, over, out, down, click){
-        node.addEvents({
-            "mouseover": function(){node.setStyles(this.css[over])}.bind(this),
-            "mouseout": function(){node.setStyles(this.css[out])}.bind(this),
-            "mousedown": function(){node.setStyles(this.css[down])}.bind(this),
-            "mouseup": function(){node.setStyles(this.css[out])}.bind(this),
-            "click": click,
-        });
-    },
-    _loadPageNode: function(){
+    // _loadPageCountNode: function(){
+    //     this.viewPageContentNode.empty();
+    //
+    //     var size = this.viewPageAreaNode.getSize();
+    //     var w1 = this.viewPageFirstNode.getSize().x*2;
+    //     var w2 = this.viewPageContentNode.getStyle("margin-left").toInt();
+    //     var w = size.x-w1-w2;
+    //
+    //     var bw = this.css.viewPageButtonNode.width.toInt()+this.css.viewPageButtonNode["margin-right"].toInt();
+    //     var count = (w/bw).toInt()-2;
+    //     if (count>10) count = 10;
+    //     this.showPageCount = Math.min(count, this.pages);
+    //
+    //     var tmp = this.showPageCount/2;
+    //     var n = tmp.toInt();
+    //     var left = this.currentPage-n;
+    //     if (left<=0) left = 1;
+    //     var right = this.showPageCount + left-1;
+    //     if (right>this.pages) right = this.pages;
+    //     left = right-this.showPageCount+1;
+    //     if (left<=1) left = 1;
+    //
+    //     this.viewPagePrevNode = new Element("div", {"styles": this.css.viewPagePrevButtonNode}).inject(this.viewPageContentNode);
+    //     this.loadPageButtonEvent(this.viewPagePrevNode, "viewPagePrevButtonNode_over", "viewPagePrevButtonNode_up", "viewPagePrevButtonNode_down", function(){
+    //         if (this.currentPage>1) this.currentPage--;
+    //         this.loadCurrentPageData();
+    //     }.bind(this));
+    //
+    //     for (i=left; i<=right; i++){
+    //         var node = new Element("div", {"styles": this.css.viewPageButtonNode, "text": i}).inject(this.viewPageContentNode);
+    //         if (i==this.currentPage){
+    //             node.setStyles(this.css.viewPageButtonNode_current);
+    //         }else{
+    //             this.loadPageButtonEvent(node, "viewPageButtonNode_over", "viewPageButtonNode_up", "viewPageButtonNode_down", function(e){
+    //                 this.currentPage = e.target.get("text").toInt();
+    //                 this.loadCurrentPageData();
+    //             }.bind(this));
+    //         }
+    //     }
+    //     this.viewPageNextNode = new Element("div", {"styles": this.css.viewPageNextButtonNode}).inject(this.viewPageContentNode);
+    //     this.loadPageButtonEvent(this.viewPageNextNode, "viewPageNextButtonNode_over", "viewPageNextButtonNode_up", "viewPageNextButtonNode_down", function(){
+    //         if (this.currentPage<=this.pages-1) this.currentPage++;
+    //         this.loadCurrentPageData();
+    //     }.bind(this));
+    // },
+    // loadPageButtonEvent: function(node, over, out, down, click){
+    //     node.addEvents({
+    //         "mouseover": function(){node.setStyles(this.css[over])}.bind(this),
+    //         "mouseout": function(){node.setStyles(this.css[out])}.bind(this),
+    //         "mousedown": function(){node.setStyles(this.css[down])}.bind(this),
+    //         "mouseup": function(){node.setStyles(this.css[out])}.bind(this),
+    //         "click": click
+    //     });
+    // },
+    // _loadPageNode: function(){
+    //     this.viewPageAreaNode.empty();
+    //     this.viewPageFirstNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.firstPage}).inject(this.viewPageAreaNode);
+    //     this.viewPageContentNode = new Element("div", {"styles": this.css.viewPageContentNode}).inject(this.viewPageAreaNode);
+    //     this.viewPageLastNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.lastPage}).inject(this.viewPageAreaNode);
+    //     this._loadPageCountNode();
+    //
+    //     this.loadPageButtonEvent(this.viewPageFirstNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){
+    //         this.currentPage = 1;
+    //         this.loadCurrentPageData();
+    //     }.bind(this));
+    //     this.loadPageButtonEvent(this.viewPageLastNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){
+    //         this.currentPage = this.pages;
+    //         this.loadCurrentPageData();
+    //     }.bind(this));
+    // },
+    _loadPageNode : function(){
+        debugger;
         this.viewPageAreaNode.empty();
         this.viewPageAreaNode.empty();
-        this.viewPageFirstNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.firstPage}).inject(this.viewPageAreaNode);
-        this.viewPageContentNode = new Element("div", {"styles": this.css.viewPageContentNode}).inject(this.viewPageAreaNode);
-        this.viewPageLastNode = new Element("div", {"styles": this.css.viewPageFirstLastNode, "text": this.lp.lastPage}).inject(this.viewPageAreaNode);
-        this._loadPageCountNode();
-
-        this.loadPageButtonEvent(this.viewPageFirstNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){
-            this.currentPage = 1;
-            this.loadCurrentPageData();
-        }.bind(this));
-        this.loadPageButtonEvent(this.viewPageLastNode, "viewPageFirstLastNode_over", "viewPageFirstLastNode_up", "viewPageFirstLastNode_down", function(){
-            this.currentPage = this.pages;
-            this.loadCurrentPageData();
-        }.bind(this));
+        this.paging = new o2.widget.Paging(this.viewPageAreaNode, {
+            countPerPage: this.json.pageSize || this.options.perPageCount,
+            visiblePages: 10,
+            currentPage: this.currentPage,
+            itemSize: this.count,
+            pageSize: this.pages,
+            hasNextPage: true,
+            hasPrevPage: true,
+            hasTruningBar: true,
+            hasJumper: true,
+            hiddenWithDisable: false,
+            hiddenWithNoItem: true,
+            text: {
+                prePage: "",
+                nextPage: "",
+                firstPage: this.lp.firstPage,
+                lastPage: this.lp.lastPage
+            },
+            onJumpingPage : function( pageNum, itemNum ){
+                this.currentPage = pageNum;
+                this.loadCurrentPageData();
+            }.bind(this)
+        });
+        this.paging.load();
     },
     },
     _initPage: function(){
     _initPage: function(){
         this.count = this.bundleItems.length;
         this.count = this.bundleItems.length;
@@ -674,7 +750,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 
 
                     this._initPage();
                     this._initPage();
                     if (this.bundleItems.length){
                     if (this.bundleItems.length){
-                        this.loadCurrentPageData();
+                        this.loadCurrentPageData( function () {
+                            this.fireEvent("postLoad"); //用户配置的事件
+                        }.bind(this));
                     }else{
                     }else{
                         //this._loadPageNode();
                         //this._loadPageNode();
                         this.viewPageAreaNode.empty();
                         this.viewPageAreaNode.empty();
@@ -682,14 +760,17 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
                             this.loadingAreaNode.destroy();
                             this.loadingAreaNode.destroy();
                             this.loadingAreaNode = null;
                             this.loadingAreaNode = null;
                         }
                         }
+                        this.fireEvent("postLoad"); //用户配置的事件
                     }
                     }
-
-
                 }.bind(this));
                 }.bind(this));
             }
             }
         }.bind(this));
         }.bind(this));
     },
     },
-    loadCurrentPageData: function(){
+    loadCurrentPageData: function( callback ){
+        debugger;
+        //是否需要在翻页的时候清空之前的items ?
+        this.items = [];
+
         var p = this.currentPage;
         var p = this.currentPage;
         var d = {};
         var d = {};
         var valueList = this.bundleItems.slice((p-1)*this.json.pageSize,this.json.pageSize*p);
         var valueList = this.bundleItems.slice((p-1)*this.json.pageSize,this.json.pageSize*p);
@@ -702,6 +783,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
 
 
         this.loadViewRes = this.lookupAction.loadView(this.json.name, this.json.application, d, function(json){
         this.loadViewRes = this.lookupAction.loadView(this.json.name, this.json.application, d, function(json){
             this.viewData = json.data;
             this.viewData = json.data;
+
+            this.fireEvent("postLoadPageData");
+
             if (this.viewJson.group.column){
             if (this.viewJson.group.column){
                 this.gridJson = json.data.groupGrid;
                 this.gridJson = json.data.groupGrid;
                 this.loadGroupData();
                 this.loadGroupData();
@@ -714,7 +798,12 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
                 this.loadingAreaNode.destroy();
                 this.loadingAreaNode.destroy();
                 this.loadingAreaNode = null;
                 this.loadingAreaNode = null;
             }
             }
-            this.fireEvent("loadView");
+
+            this.fireEvent("loadView"); //options 传入的事件
+
+            this.fireEvent("postLoadPage");
+
+            if(callback)callback();
         }.bind(this));
         }.bind(this));
     },
     },
 
 
@@ -722,9 +811,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
     loadData: function(){
     loadData: function(){
         if (this.gridJson.length){
         if (this.gridJson.length){
             // if( !this.options.paging ){
             // if( !this.options.paging ){
-                this.gridJson.each(function(line, i){
-                    this.items.push(new MWF.xApplication.query.Query.Viewer.Item(this, line, null, i));
-                }.bind(this));
+            this.gridJson.each(function(line, i){
+                this.items.push(new MWF.xApplication.query.Query.Viewer.Item(this, line, null, i));
+            }.bind(this));
             // }else{
             // }else{
             //     this.loadPaging();
             //     this.loadPaging();
             // }
             // }
@@ -907,6 +996,9 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         }
         }
         return (filterData.length) ? filterData : null;
         return (filterData.length) ? filterData : null;
     },
     },
+    getSelectedData : function(){
+        return this.getData();
+    },
     getData: function(){
     getData: function(){
         if (this.selectedItems.length){
         if (this.selectedItems.length){
             var arr = [];
             var arr = [];
@@ -917,7 +1009,124 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
         }else{
         }else{
             return [];
             return [];
         }
         }
+    },
+    _loadModuleEvents : function(){
+        debugger;
+        Object.each(this.viewJson.events, function(e, key){
+            if (e.code){
+                if (this.options.moduleEvents.indexOf(key)!==-1){
+                    this.addEvent(key, function(event, target){
+                        debugger;
+                        return this.Macro.fire(e.code, target || this, event);
+                    }.bind(this));
+                }
+            }
+        }.bind(this));
+    },
+    _loadDomEvents: function(){
+        Object.each(this.viewJson.events, function(e, key){
+            if (e.code){
+                if (this.options.moduleEvents.indexOf(key)===-1){
+                    this.node.addEvent(key, function(event){
+                        return this.Macro.fire(e.code, this, event);
+                    }.bind(this));
+                }
+            }
+        }.bind(this));
+    },
+
+    //api 使用 开始
+    getParentEnvironment : function(){
+        return this.parentMacro ? this.parentMacro.environment : null;
+    },
+    getViewInfor : function(){
+        return this.json;
+    },
+    getPageInfor : function(){
+        return {
+            pages : this.pages,
+            perPageCount : this.options.perPageCount,
+            currentPageNumber : this.currentPage
+        };
+    },
+    getPageData : function () {
+        return this.gridJson;
+    },
+    toPage : function( pageNumber, callback ){
+        this.currentPage = pageNumber;
+        this.loadCurrentPageData( callback );
+    },
+    selectAll : function(){
+        var flag = this.json.select || this.viewJson.select ||  "none";
+        if ( flag==="multi"){
+            this.items.each( function (item) {
+                if( item.clazzType === "item" ){
+                    item.selected();
+                }else{
+                    item.expand();
+                    if( item.items ){
+                        item.items.each( function (it) {
+                            it.selected();
+                        })
+                    }
+                }
+            })
+        }
+    },
+    unSelectAll : function(){
+        var flag = this.json.select || this.viewJson.select ||  "none";
+        if ( flag==="multi"){
+            this.items.each( function (item) {
+                if( item.clazzType === "item" ){
+                    item.unSelected();
+                }else{
+                    if(item.items){
+                        item.items.each( function (it) {
+                            it.unSelected();
+                        })
+                    }
+                }
+            })
+        }
+    },
+    setFilter : function( filter ){
+        if( !filter )filter = [];
+        if( typeOf( filter ) === "object" )filter = [ filter ];
+        this.json.filter = filter;
+        this.createViewNode({"filterList": this.json.filter  ? this.json.filter.clone() : null});
+    },
+    switchView : function( json ){
+        debugger;
+        // json = {
+        //     "application": application,
+        //     "viewName": viewName,
+        //     "isTitle": "yes",
+        //     "select": "none",
+        //     "titleStyles": titleStyles,
+        //     "itemStyles": itemStyles,
+        //     "isExpand": "no",
+        //     "filter": filter
+        // }
+        this.node.setStyle("display", "block");
+        if (this.loadingAreaNode) this.loadingAreaNode.setStyle("display", "block");
+
+        this.searchMorph = null;
+        this.viewSearchCustomContentNode = null;
+
+        var newJson = Object.merge( Object.clone(this.originalJson), json );
+        this.container.empty();
+        this.initialize( this.container, newJson, Object.clone(this.options), this.app, this.parentMacro);
+    },
+    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 使用 结束
 });
 });
 
 
 MWF.xApplication.query.Query.Viewer.Item = new Class({
 MWF.xApplication.query.Query.Viewer.Item = new Class({
@@ -928,10 +1137,12 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         this.isSelected = false;
         this.isSelected = false;
         this.prev = prev;
         this.prev = prev;
         this.idx = i;
         this.idx = i;
+        this.clazzType = "item";
         this.load();
         this.load();
     },
     },
     load: function(){
     load: function(){
-        debugger;
+        this.view.fireEvent("queryLoadItemRow", [null, this]);
+
         this.node = new Element("tr", {"styles": this.css.viewContentTrNode});
         this.node = new Element("tr", {"styles": this.css.viewContentTrNode});
         if (this.prev){
         if (this.prev){
             this.node.inject(this.prev.node, "after");
             this.node.inject(this.prev.node, "after");
@@ -940,9 +1151,9 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         }
         }
 
 
         //if (this.view.json.select==="single" || this.view.json.select==="multi"){
         //if (this.view.json.select==="single" || this.view.json.select==="multi"){
-            this.selectTd = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
-            this.selectTd.setStyles({"cursor": "pointer"});
-            if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
+        this.selectTd = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
+        this.selectTd.setStyles({"cursor": "pointer"});
+        if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
         //}
         //}
 
 
         //序号
         //序号
@@ -954,26 +1165,25 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         }
         }
 
 
         Object.each(this.view.entries, function(c, k){
         Object.each(this.view.entries, function(c, k){
-            debugger;
             var cell = this.data.data[k];
             var cell = this.data.data[k];
             if (cell === undefined) cell = "";
             if (cell === undefined) cell = "";
             //if (cell){
             //if (cell){
-                if (this.view.hideColumns.indexOf(k)===-1){
-                    var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
-                    if (k!== this.view.viewJson.group.column){
-                        //var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
-                        var v = cell;
-                        if (c.isHtml){
-                            td.set("html", v);
-                        }else{
-                            td.set("text", v);
-                        }
-                    }
-                    if (this.view.openColumns.indexOf(k)!==-1){
-                        this.setOpenWork(td, c)
+            if (this.view.hideColumns.indexOf(k)===-1){
+                var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(this.node);
+                if (k!== this.view.viewJson.group.column){
+                    //var v = (this.view.entries[k].code) ? MWF.Macro.exec(this.view.entries[k].code, {"value": cell, "gridData": this.view.gridJson, "data": this.view.viewData, "entry": this.data}) : cell;
+                    var v = cell;
+                    if (c.isHtml){
+                        td.set("html", v);
+                    }else{
+                        td.set("text", v);
                     }
                     }
-                    if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
                 }
                 }
+                if (this.view.openColumns.indexOf(k)!==-1){
+                    this.setOpenWork(td, c)
+                }
+                if (this.view.json.itemStyles) td.setStyles(this.view.json.itemStyles);
+            }
             //}
             //}
         }.bind(this));
         }.bind(this));
 
 
@@ -992,32 +1202,41 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         // }.bind(this));
         // }.bind(this));
 
 
         this.setEvent();
         this.setEvent();
+
+        this.view.fireEvent("postLoadItemRow", [null, this]);
     },
     },
     setOpenWork: function(td, column){
     setOpenWork: function(td, column){
-        debugger;
         td.setStyle("cursor", "pointer");
         td.setStyle("cursor", "pointer");
         if( column.clickCode ){
         if( column.clickCode ){
-            if( !this.view.Macro ){
-                MWF.require("MWF.xScript.Macro", function () {
-                    this.view.businessData = {};
-                    this.view.Macro = new MWF.Macro.PageContext(this.view);
-                }.bind(this), false);
-            }
+            // if( !this.view.Macro ){
+            //     MWF.require("MWF.xScript.Macro", function () {
+            //         this.view.businessData = {};
+            //         this.view.Macro = new MWF.Macro.PageContext(this.view);
+            //     }.bind(this), false);
+            // }
             td.addEvent("click", function( ev ){
             td.addEvent("click", function( ev ){
-                return this.view.Macro.fire(column.clickCode, this, ev);
+                var result = this.view.Macro.fire(column.clickCode, this, ev);
+                ev.stopPropagation();
+                return result;
             }.bind(this));
             }.bind(this));
         }else{
         }else{
             if (this.view.json.type==="cms"){
             if (this.view.json.type==="cms"){
-                td.addEvent("click", this.openCms.bind(this));
+                td.addEvent("click", function(ev){
+                    this.openCms(ev)
+                    ev.stopPropagation();
+                }.bind(this));
             }else{
             }else{
-                td.addEvent("click", this.openWorkAndCompleted.bind(this));
+                td.addEvent("click", function(ev){
+                    this.openWorkAndCompleted(ev)
+                    ev.stopPropagation();
+                }.bind(this));
             }
             }
         }
         }
 
 
     },
     },
     openCms: function(e){
     openCms: function(e){
         var options = {"documentId": this.data.bundle};
         var options = {"documentId": this.data.bundle};
-        this.view.fireEvent("openDocument", [options, this]);
+        this.view.fireEvent("openDocument", [options, this]); //options 传入的事件
         layout.desktop.openApplication(e, "cms.Document", options);
         layout.desktop.openApplication(e, "cms.Document", options);
     },
     },
     openWorkAndCompleted: function(e){
     openWorkAndCompleted: function(e){
@@ -1137,22 +1356,23 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
     },
     },
     openWork: function(id, e){
     openWork: function(id, e){
         var options = {"workId": id};
         var options = {"workId": id};
-        this.view.fireEvent("openDocument", [options, this]);
+        this.view.fireEvent("openDocument", [options, this]); //options 传入的事件
         layout.desktop.openApplication(e, "process.Work", options);
         layout.desktop.openApplication(e, "process.Work", options);
     },
     },
     openWorkCompleted: function(id, e){
     openWorkCompleted: function(id, e){
         var options = {"workCompletedId": id};
         var options = {"workCompletedId": id};
-        this.view.fireEvent("openDocument", [options, this]);
+        this.view.fireEvent("openDocument", [options, this]); //options 传入的事件
         layout.desktop.openApplication(e, "process.Work", options);
         layout.desktop.openApplication(e, "process.Work", options);
     },
     },
 
 
     setEvent: function(){
     setEvent: function(){
-        if (this.view.json.select==="single" || this.view.json.select==="multi"){
+        var flag = this.view.json.select || this.view.viewJson.select ||  "none";
+        if ( flag ==="single" || flag==="multi"){
             this.node.addEvents({
             this.node.addEvents({
                 "mouseover": function(){
                 "mouseover": function(){
                     if (!this.isSelected){
                     if (!this.isSelected){
                         var iconName = "checkbox";
                         var iconName = "checkbox";
-                        if (this.view.json.select==="single") iconName = "radiobox";
+                        if (flag==="single") iconName = "radiobox";
                         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/"+iconName+".png) center center no-repeat"});
                         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/"+iconName+".png) center center no-repeat"});
                     }
                     }
                 }.bind(this),
                 }.bind(this),
@@ -1165,20 +1385,21 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
     },
     },
 
 
     select: function(){
     select: function(){
+        var flag = this.view.json.select || this.view.viewJson.select ||  "none";
         if (this.isSelected){
         if (this.isSelected){
-            if (this.view.json.select==="single"){
+            if (flag==="single"){
                 this.unSelectedSingle();
                 this.unSelectedSingle();
             }else{
             }else{
                 this.unSelected();
                 this.unSelected();
             }
             }
         }else{
         }else{
-            if (this.view.json.select==="single"){
+            if (flag==="single"){
                 this.selectedSingle();
                 this.selectedSingle();
             }else{
             }else{
                 this.selected();
                 this.selected();
             }
             }
         }
         }
-        this.view.fireEvent("select");
+        this.view.fireEvent("select"); //options 传入的事件
     },
     },
 
 
     selected: function(){
     selected: function(){
@@ -1186,12 +1407,14 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/checkbox_checked.png) center center no-repeat"});
         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/checkbox_checked.png) center center no-repeat"});
         this.node.setStyles(this.css.viewContentTrNode_selected);
         this.node.setStyles(this.css.viewContentTrNode_selected);
         this.isSelected = true;
         this.isSelected = true;
+        this.view.fireEvent("selectRow", [this]);
     },
     },
     unSelected: function(){
     unSelected: function(){
         this.view.selectedItems.erase(this);
         this.view.selectedItems.erase(this);
         this.selectTd.setStyles({"background": "transparent"});
         this.selectTd.setStyles({"background": "transparent"});
         this.node.setStyles(this.css.viewContentTrNode);
         this.node.setStyles(this.css.viewContentTrNode);
         this.isSelected = false;
         this.isSelected = false;
+        this.view.fireEvent("unselectRow", [this]);
     },
     },
     selectedSingle: function(){
     selectedSingle: function(){
         if (this.view.currentSelectedItem) this.view.currentSelectedItem.unSelectedSingle();
         if (this.view.currentSelectedItem) this.view.currentSelectedItem.unSelectedSingle();
@@ -1200,6 +1423,7 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/radiobox_checked.png) center center no-repeat"});
         this.selectTd.setStyles({"background": "url("+"/x_component_query_Query/$Viewer/default/icon/radiobox_checked.png) center center no-repeat"});
         this.node.setStyles(this.css.viewContentTrNode_selected);
         this.node.setStyles(this.css.viewContentTrNode_selected);
         this.isSelected = true;
         this.isSelected = true;
+        this.view.fireEvent("selectRow", [this]);
     },
     },
     unSelectedSingle: function(){
     unSelectedSingle: function(){
         this.view.selectedItems = [];
         this.view.selectedItems = [];
@@ -1207,6 +1431,7 @@ MWF.xApplication.query.Query.Viewer.Item = new Class({
         this.selectTd.setStyles({"background": "transparent"});
         this.selectTd.setStyles({"background": "transparent"});
         this.node.setStyles(this.css.viewContentTrNode);
         this.node.setStyles(this.css.viewContentTrNode);
         this.isSelected = false;
         this.isSelected = false;
+        this.view.fireEvent("unselectRow", [this]);
     }
     }
 });
 });
 
 
@@ -1218,13 +1443,16 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
         this.items = [];
         this.items = [];
         this.loadChild = false;
         this.loadChild = false;
         this.idx = i;
         this.idx = i;
+        this.clazzType = "category";
         this.load();
         this.load();
     },
     },
     load: function(){
     load: function(){
+        this.view.fireEvent("queryLoadCategoryRow", [null, this]);
+
         this.node = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.view.viewTable);
         this.node = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.view.viewTable);
         //if (this.view.json.select==="single" || this.view.json.select==="multi"){
         //if (this.view.json.select==="single" || this.view.json.select==="multi"){
-            this.selectTd = new Element("td", {"styles": this.css.viewContentCategoryTdNode}).inject(this.node);
-            if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
+        this.selectTd = new Element("td", {"styles": this.css.viewContentCategoryTdNode}).inject(this.node);
+        if (this.view.json.itemStyles) this.selectTd.setStyles(this.view.json.itemStyles);
         //}
         //}
         this.categoryTd = new Element("td", {
         this.categoryTd = new Element("td", {
             "styles": this.css.viewContentCategoryTdNode,
             "styles": this.css.viewContentCategoryTdNode,
@@ -1249,12 +1477,14 @@ MWF.xApplication.query.Query.Viewer.ItemCategory = new Class({
         if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
         if (this.view.json.itemStyles) this.categoryTd.setStyles(this.view.json.itemStyles);
 
 
         this.setEvent();
         this.setEvent();
+
+        this.view.fireEvent("postLoadCategoryRow", [null, this]);
     },
     },
     setEvent: function(){
     setEvent: function(){
         //if (this.selectTd){
         //if (this.selectTd){
-            this.node.addEvents({
-                "click": function(){this.expandOrCollapse();}.bind(this)
-            });
+        this.node.addEvents({
+            "click": function(){this.expandOrCollapse();}.bind(this)
+        });
         //}
         //}
     },
     },
     expandOrCollapse: function(){
     expandOrCollapse: function(){
@@ -1356,3 +1586,266 @@ MWF.xApplication.query.Query.Viewer.Filter = new Class({
         MWF.release(this);
         MWF.release(this);
     }
     }
 });
 });
+
+MWF.xApplication.query.Query.Viewer.Actionbar = new Class({
+    Implements: [Events],
+    options: {
+        "style" : "default",
+        "moduleEvents": ["load", "queryLoad", "postLoad", "afterLoad"]
+    },
+    initialize: function(node, json, form, options){
+
+        this.node = $(node);
+        this.node.store("module", this);
+        this.json = json;
+        this.form = form;
+        this.view = form;
+    },
+    hide: function(){
+        var dsp = this.node.getStyle("display");
+        if (dsp!=="none") this.node.store("mwf_display", dsp);
+        this.node.setStyle("display", "none");
+    },
+    show: function(){
+        var dsp = this.node.retrieve("mwf_display", dsp);
+        this.node.setStyle("display", dsp);
+    },
+    load: function(){
+
+        this._loadModuleEvents();
+        if (this.fireEvent("queryLoad")){
+            //this._queryLoaded();
+            this._loadUserInterface();
+            this._loadStyles();
+            this._loadDomEvents();
+            //this._loadEvents();
+
+            //this._afterLoaded();
+            this.fireEvent("postLoad");
+            this.fireEvent("load");
+        }
+    },
+
+    _loadStyles: function(){
+        if (this.json.styles) Object.each(this.json.styles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1 || value.indexOf("x_cms_assemble_control")!=-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                var host3 = MWF.Actions.getHost("x_cms_assemble_control");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+                if (value.indexOf("/x_cms_assemble_control")!==-1){
+                    value = value.replace("/x_cms_assemble_control", host3+"/x_cms_assemble_control");
+                }else if (value.indexOf("x_cms_assemble_control")!==-1){
+                    value = value.replace("x_cms_assemble_control", host3+"/x_cms_assemble_control");
+                }
+            }
+            this.node.setStyle(key, value);
+        }.bind(this));
+
+        // if (["x_processplatform_assemble_surface", "x_portal_assemble_surface"].indexOf(root.toLowerCase())!==-1){
+        //     var host = MWF.Actions.getHost(root);
+        //     return (flag==="/") ? host+this.json.template : host+"/"+this.json.template
+        // }
+        //if (this.json.styles) this.node.setStyles(this.json.styles);
+    },
+    _loadModuleEvents : function(){
+        Object.each(this.json.events, function(e, key){
+            if (e.code){
+                if (this.options.moduleEvents.indexOf(key)!==-1){
+                    this.addEvent(key, function(event){
+                        return this.form.Macro.fire(e.code, this, event);
+                    }.bind(this));
+                }
+            }
+        }.bind(this));
+    },
+    _loadDomEvents: function(){
+        Object.each(this.json.events, function(e, key){
+            if (e.code){
+                if (this.options.moduleEvents.indexOf(key)===-1){
+                    this.node.addEvent(key, function(event){
+                        return this.form.Macro.fire(e.code, this, event);
+                    }.bind(this));
+                }
+            }
+        }.bind(this));
+    },
+    _loadEvents: function(){
+        Object.each(this.json.events, function(e, key){
+            if (e.code){
+                if (this.options.moduleEvents.indexOf(key)!==-1){
+                    this.addEvent(key, function(event){
+                        return this.form.Macro.fire(e.code, this, event);
+                    }.bind(this));
+                }else{
+                    this.node.addEvent(key, function(event){
+                        return this.form.Macro.fire(e.code, this, event);
+                    }.bind(this));
+                }
+            }
+        }.bind(this));
+    },
+    addModuleEvent: function(key, fun){
+        if (this.options.moduleEvents.indexOf(key)!==-1){
+            this.addEvent(key, function(event){
+                return (fun) ? fun(this, event) : null;
+            }.bind(this));
+        }else{
+            this.node.addEvent(key, function(event){
+                return (fun) ? fun(this, event) : null;
+            }.bind(this));
+        }
+    },
+    _loadUserInterface: function(){
+        // if (this.form.json.mode == "Mobile"){
+        //     this.node.empty();
+        // }else if (COMMON.Browser.Platform.isMobile){
+        //     this.node.empty();
+        // }else{
+        this.toolbarNode = this.node.getFirst("div");
+        if( !this.toolbarNode ){
+            this.toolbarNode = new Element("div").inject( this.node );
+        }
+        this.toolbarNode.empty();
+
+        MWF.require("MWF.widget.Toolbar", function(){
+            this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {
+                "style": this.json.style,
+                "onPostLoad" : function(){
+                    this.fireEvent("afterLoad");
+                }.bind(this)
+            }, this);
+            if (this.json.actionStyles) this.toolbarWidget.css = this.json.actionStyles;
+            //alert(this.readonly)
+
+            if (this.json.hideSystemTools){
+                this.setCustomToolbars(this.json.tools, this.toolbarNode);
+                this.toolbarWidget.load();
+            }else{
+                if (this.json.defaultTools){
+                    this.setToolbars(this.json.defaultTools, this.toolbarNode, this.readonly);
+                    this.setCustomToolbars(this.json.tools, this.toolbarNode);
+                    this.toolbarWidget.load();
+                }else{
+                    MWF.getJSON(this.form.path+"toolbars.json", function(json){
+                        this.setToolbars(json, this.toolbarNode, this.readonly, true);
+                        this.setCustomToolbars(this.json.tools, this.toolbarNode);
+                        this.toolbarWidget.load();
+                    }.bind(this), null);
+                }
+            }
+
+        }.bind(this));
+        // }
+    },
+
+    setCustomToolbars: function(tools, node){
+        var path = "/x_component_process_FormDesigner/Module/Actionbar/";
+        var iconPath = "";
+        if( this.json.customIconStyle ){
+            iconPath = this.json.customIconStyle+"/";
+        }
+        tools.each(function(tool){
+            var flag = true;
+            if (this.readonly){
+                flag = tool.readShow;
+            }else{
+                flag = tool.editShow;
+            }
+            if (flag){
+                flag = true;
+                // if (tool.control){
+                //     flag = this.form.businessData.control[tool.control]
+                // }
+                if (tool.condition){
+                    var hideFlag = this.form.Macro.exec(tool.condition, this);
+                    flag = !hideFlag;
+                }
+                if (flag){
+                    var actionNode = new Element("div", {
+                        "id": tool.id,
+                        "MWFnodetype": tool.type,
+                        "MWFButtonImage": path+""+this.form.options.style+"/custom/"+iconPath+tool.img,
+                        "title": tool.title,
+                        "MWFButtonAction": "runCustomAction",
+                        "MWFButtonText": tool.text
+                    }).inject(node);
+                    if( this.json.customIconOverStyle ){
+                        actionNode.set("MWFButtonImageOver" , path+""+this.form.options.style +"/custom/"+this.json.customIconOverStyle+ "/" +tool.img );
+                    }
+                    if( tool.properties ){
+                        actionNode.set(tool.properties);
+                    }
+                    if (tool.actionScript){
+                        actionNode.store("script", tool.actionScript);
+                    }
+                    if (tool.sub){
+                        var subNode = node.getLast();
+                        this.setCustomToolbars(tool.sub, subNode);
+                    }
+                }
+            }
+        }.bind(this));
+    },
+
+    setToolbarItem: function(tool, node, readonly, noCondition){
+        //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 (!noCondition) if (tool.condition){
+            var hideFlag = this.form.Macro.exec(tool.condition, this);
+            flag = flag && (!hideFlag);
+        }
+        if (readonly) if (!tool.read) flag = false;
+        if (flag){
+            var actionNode = new Element("div", {
+                "id": tool.id,
+                "MWFnodetype": tool.type,
+                //"MWFButtonImage": this.form.path+""+this.form.options.style+"/actionbar/"+tool.img,
+                //"MWFButtonImage": path+(this.options.style||"default") +"/tools/"+ (this.json.style || "default") +"/"+tool.img,
+                "MWFButtonImage": path+this.options.style+"/actionbar/"+tool.img,
+                "title": tool.title,
+                "MWFButtonAction": tool.action,
+                "MWFButtonText": tool.text
+            }).inject(node);
+            if( this.json.iconOverStyle ){
+                actionNode.set("MWFButtonImageOver" , path+""+this.options.style+"/actionbar/"+this.json.iconOverStyle+"/"+tool.img );
+                //actionNode.set("MWFButtonImageOver" , path+""+(this.options.style||"default")+"/tools/"+( this.json.iconOverStyle || "default" )+"/"+tool.img );
+            }
+            if( tool.properties ){
+                actionNode.set(tool.properties);
+            }
+            if (tool.sub){
+                var subNode = node.getLast();
+                this.setToolbars(tool.sub, subNode, readonly, noCondition);
+            }
+        }
+    },
+    setToolbars: function(tools, node, readonly, noCondition){
+        tools.each(function(tool){
+            this.setToolbarItem(tool, node, readonly, noCondition);
+        }.bind(this));
+    },
+    runCustomAction: function(bt){
+        var script = bt.node.retrieve("script");
+        this.form.Macro.exec(script, this);
+    },
+    exportView : function(){
+        this.form.exportView();
+    },
+    deleteWork: function(){
+        this.form.deleteWork();
+    }
+});

+ 42 - 0
o2web/source/x_component_query_ViewDesigner/$View/actionbar.html

@@ -0,0 +1,42 @@
+<div style="background-color: #FFF; overflow: hidden">
+	<div title="基本" class="MWFTab">
+		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+		  <tr>
+		    <td class="editTableTitle">标识:</td>
+		    <td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
+		  </tr>
+		  <tr>
+		    <td class="editTableTitle">名称:</td>
+		    <td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
+		  </tr>
+		  <tr>
+		    <td class="editTableTitle">描述:</td>
+		    <td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
+		  </tr>
+          <tr>
+            <td class="editTableTitle">系统操作:</td>
+            <td class="editTableValue">
+                <input type="radio" name="hideSystemTools" value="false" text{(!$.hideSystemTools)?'checked':''}/>显示
+                <input type="radio" name="hideSystemTools" value="true" text{($.hideSystemTools)?'checked':''}/>不显示
+            </td>
+          </tr>
+
+		</table>
+	</div>
+    <div title="操作"  class="MWFTab" style="overflow: hidden">
+		<div class="MWFDefaultActionArea" name="defaultTools"></div>
+        <div class="MWFActionArea" name="tools"></div>
+    </div>
+    <div title="样式"  class="MWFTab">
+        <div class="MWFActionStylesArea" name="actionStyles"></div>
+    </div>
+	<div title="事件"  class="MWFTab">
+		<div class="MWFEventsArea" name="events"></div>
+	</div>
+	<!--<div title="HTML"  class="MWFTab">-->
+		<!--<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>-->
+	<!--</div>-->
+	<div title="JSON"  class="MWFTab">
+		<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+	</div>
+</div>

+ 69 - 0
o2web/source/x_component_query_ViewDesigner/$View/actionbar.json

@@ -0,0 +1,69 @@
+{
+  "id": "",
+  "name": "",
+  "type": "Actionbar",
+  "description": "",
+  "tools":[],
+  "style": "view_default",
+  "customIconStyle" : "",
+  "hideSystemTools": false,
+  "container": "",
+  "events": {
+    "queryLoad" : {
+      "code": "",
+      "html": ""
+    },
+    "postLoad" : {
+      "code": "",
+      "html": ""
+    },
+    "load" : {
+      "code": "",
+      "html": ""
+    },
+    "afterLoad" : {
+      "code": "",
+      "html": ""
+    },
+    "click": {
+      "code": "",
+      "html": ""
+    },
+    "dblclick": {
+      "code": "",
+      "html": ""
+    },
+    "keydown": {
+      "code": "",
+      "html": ""
+    },
+    "keypress": {
+      "code": "",
+      "html": ""
+    },
+    "keyup": {
+      "code": "",
+      "html": ""
+    },
+    "mousedown": {
+      "code": "",
+      "html": ""
+    },
+    "mousemove": {
+      "code": "",
+      "html": ""
+    },
+    "mouseout": {
+      "code": "",
+      "html": ""
+    },
+    "mouseover": {
+      "code": "",
+      "html": ""
+    },
+    "mouseup": {
+      "code": "",
+      "html": ""
+    }
+  }
+}

+ 50 - 0
o2web/source/x_component_query_ViewDesigner/$View/default/actionbar.wcss

@@ -0,0 +1,50 @@
+{
+	"moduleNodeMove": {
+		"border": "2px dashed #ffa200",
+		"height": "30px",
+		"overflow": "hidden",
+		"margin": "3px",
+		"display": "block",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none",
+		"position": "absolute",
+		"z-index": 10002,
+		"opacity": 0.7,
+		"width": "100px",
+		"background-color": "#999",
+		"cursor": "move"
+	},
+	"moduleNodeShow": {
+		"border": "1px dashed #333",
+        "height": "2px",
+        "cursor": "pointer",
+        "line-height": "22px",
+        "overflow": "hidden",
+        "margin": "3px 3px",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "display": "block",
+        "top": "auto",
+        "left": "auto",
+        "width": "auto",
+        "opacity": 0.5,
+        "background": "#ffa200"
+	},
+	"moduleNode": {
+        "border": "1px dashed #999",
+        "height": "auto",
+        "overflow": "hidden",
+        "margin": "auto",
+        "display": "block",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "opacity": 1,
+        "width": "auto",
+        "margin": "3px 3px",
+        "background-color": "#999",
+        "cursor": "pointer"
+	}
+	
+}

BIN
o2web/source/x_component_query_ViewDesigner/$View/default/actionbar/export.png


+ 32 - 1
o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss

@@ -1,4 +1,7 @@
 {
 {
+    "actionbarNode" : {
+        "overflow": "hidden"
+    },
     "viewAreaNode": {
     "viewAreaNode": {
         "overflow": "hidden"
         "overflow": "hidden"
     },
     },
@@ -316,5 +319,33 @@
         "position": "relative",
         "position": "relative",
         "margin-right": "8px",
         "margin-right": "8px",
         "top": "-38px"
         "top": "-38px"
-    }
+    },
+
+    "toolbarWarpNode": {
+        "border": "1px dashed #999",
+        "height": "auto",
+        "overflow": "hidden",
+        "margin": "auto",
+        "display": "block",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "opacity": 1,
+        "width": "auto",
+        "margin": "3px 3px",
+        "background-color": "#999",
+        "cursor": "pointer"
+    },
+    "toolbarWarpNode_selected": {
+        "background-color": "#FFF",
+//        "height": "38px",
+        "border": "1px solid red",
+        "white-space": "nowrap"
+    },
+    "toolbarWarpNode_over": {
+        "background-color": "#F9F9F9",
+//        "height": "38px",
+        "border": "1px dotted blue",
+        "white-space": "nowrap"
+    },
 }
 }

+ 46 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/config.json

@@ -0,0 +1,46 @@
+{
+  "default": {
+    "name": "默认样式",
+    "file": "styles_default.json",
+    "mode": [
+      "pc"
+    ]
+  },
+  "red-simple": {
+    "name": "红色简洁",
+    "file": "styles_red-simple.json",
+    "mode": [
+      "pc"
+    ]
+  },
+  "blue-simple": {
+    "name": "蓝色简洁",
+    "file": "styles_blue-simple.json",
+    "mode": [
+      "pc"
+    ]
+  },
+  "official": {
+    "name": "公文样式",
+    "file": "styles_official.json",
+    "mode": [
+      "pc"
+    ]
+  },
+  "cmcc": {
+    "name": "集团样式",
+    "file": "styles_cmcc.json",
+    "extendFile": "styles_cmcc_extend.json",
+    "mode": [
+      "pc"
+    ]
+  },
+  "blue-flat": {
+    "name": "蓝白扁平",
+    "file": "styles_blue-flat.json",
+    "extendFile": "styles_blue-flat_extend.json",
+    "mode": [
+      "pc"
+    ]
+  }
+}

+ 50 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-flat.json

@@ -0,0 +1,50 @@
+{
+  "name": "蓝白扁平",
+  "form": {
+    "styles":{
+      "background-color": "#f1f4f9"
+    }
+  },
+  "table": {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "border" : "1px solid #DCDFE6"
+    },
+    "titleTdStyles":{
+      "background-color": "#F1F4F9",
+      "color": "#12171F",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center"
+    },
+    "contentTdStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#535861"
+    },
+    "contentTdOverStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#535861"
+    },
+    "contentTdSelectedStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#535861"
+    },
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "actionbar": {
+    "style": "xform_blue_flat",
+    "iconOverStyle": "xform_blue_flat_over",
+    "customIconStyle" : "blue",
+    "customIconOverStyle" : "white"
+  },
+  "paging" : {
+
+  }
+}

+ 419 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_blue-simple.json

@@ -0,0 +1,419 @@
+{
+  "name": "蓝色简洁",
+  "form": {
+    "styles":{
+      "background-color": "#f0f0f0"
+    }
+  },
+  "label": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#3c76b7",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "24px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#3c76b7",
+        "height": "60px"
+      }
+    },
+
+    "section": {
+      "name": "区段标题",
+      "styles": {
+        "height": "40px",
+        "background-color": "#f7f7f7",
+        "line-height": "40px",
+        "padding": "0px 20px",
+        "font-weight": "bold",
+        "color": "#666",
+        "border-bottom": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "div": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#3c76b7",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "24px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#3c76b7",
+        "height": "60px"
+      }
+    },
+    "section": {
+      "name": "区段",
+      "styles": {
+        "padding": "20px 0px",
+        "background-color": "#FFF",
+        "border": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "tab": {
+    "styles": {},
+    "tabAreaStyles": {
+      "height": "40px",
+      "border-bottom": "2px solid #3c76b7"
+    },
+    "contentAreaStyles": {
+      "line-height": "normal",
+      "clear": "both",
+      "overflow": "hidden"
+    },
+    "tabStyles": {
+      "position": "relative",
+      "margin-left": "4px",
+      "margin-top": "0px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "cursor": "pointer",
+      "min-width": "100px",
+      "background": "transparent ",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #3c76b7"
+    },
+    "tabTextStyles": {
+      "color": "#666",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-top": "0px",
+      "margin-left": "8px"
+    },
+    "tabCurrentStyles": {
+      "position": "relative",
+      "margin-top": "0px",
+      "margin-left": "2px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "min-width": "100px",
+      "background": "#3c76b7",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border-top": "0px solid #f0f0f0",
+      "border-left": "0px solid #f0f0f0",
+      "border-right": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #3c76b7"
+    },
+    "tabCurrentTextStyles": {
+      "color": "#FFF",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-left": "8px",
+      "margin-top": "0px"
+    }
+  },
+  "tab$Content": {
+    "styles": {
+      "padding": "20px 0px"
+    }
+  },
+  "table": {
+    "styles": {
+      "background-color": "#FFF",
+      "margin": "10px 0px"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "right"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "layoutStyles": {},
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "log" : {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "margin": "10px 0px"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "right"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "datagrid": {
+    "styles": {},
+    "tableStyles": {
+      "border": "1px solid #cccccc"
+    },
+    "titleStyles": {
+      "height": "28px",
+      "cursor": "pointer",
+      "line-height": "28px",
+      "overflow": "hidden",
+      "opacity": 1,
+      "border-bottom": "1px solid #ccc",
+      "background-color": "#f0f0f0"
+    },
+    "contentStyles": {
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666"
+    },
+    "actionStyles": {
+      "background-color": "#f7f7f7"
+    },
+    "editStyles": {
+      "background-color": "#fff6f6",
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px"
+    },
+    "amountStyles": {
+      "border-top": "1px solid #ccc",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "background-color": "#f0f0f0"
+    },
+    "itemTitleStyles": {
+      "height": "40px",
+      "background-color": "#ffffff",
+      "line-height": "30px",
+      "padding": "0px 15px",
+      "color": "#fb4747",
+      "font-size": "18px",
+      "font-weight": "bold",
+      "border-bottom": "0px solid #cccccc"
+    },
+    "properties": {
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "0",
+      "align": "center"
+    }
+  },
+  "datagrid$Title": {
+    "styles": {
+      "background-color": "#f0f0f0"
+    }
+  },
+  "address": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "color": "#666",
+      "border": "0px solid #ccc"
+    }
+  },
+  "combox": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "color": "#666",
+      "border": "0px solid #ccc"
+    }
+  },
+  "textfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "calendar": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "number": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "personfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "min-height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "orgfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "min-height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "org": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "min-height": "26px",
+      "color": "#666",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "select": {
+    "styles": {
+      "border-bottom": "0px solid #999",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "margin-top": "5px",
+      "color": "#666"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "font-size": "14px"
+    }
+  },
+  "textarea": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "opinion": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "actionbar": {
+    "style": "xform_blue_simple",
+    "customIconStyle" : ""
+  },
+  "attachment" : {
+    "style" : "default"
+  }
+}

+ 445 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_cmcc.json

@@ -0,0 +1,445 @@
+{
+  "name": "集团样式",
+  "form": {
+    "styles":{
+      "background-color": "#f0f0f0"
+    }
+  },
+  "label": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#3c76b7",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "36px",
+        "line-height": "100px",
+        "font-weight": "bold",
+        "color": "#f81313",
+        "height": "100px"
+      }
+    },
+
+    "section": {
+      "name": "区段标题",
+      "styles": {
+        "background-color": "#f7f7f7",
+        "height": "35px",
+        "font-size" : "16px",
+        "line-height": "35px",
+        "padding": "0px 10px",
+        "font-weight": "normal",
+        "color": "#555",
+        "border-bottom": "0px"
+      }
+    }
+  },
+
+  "div": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#3c76b7",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "24px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#3c76b7",
+        "height": "60px"
+      }
+    },
+    "section": {
+      "name": "区段标题",
+      "styles": {
+        "background-color": "#f7f7f7",
+        "height": "35px",
+        "font-size" : "16px",
+        "line-height": "35px",
+        "padding": "0px 10px",
+        "font-weight": "normal",
+        "color": "#555",
+        "border-bottom": "0px"
+      }
+    }
+  },
+
+  "tab": {
+    "styles": {},
+    "tabAreaStyles": {
+      "height": "40px",
+      "border-bottom": "2px solid #3c76b7"
+    },
+    "contentAreaStyles": {
+      "line-height": "normal",
+      "clear": "both",
+      "overflow": "hidden"
+    },
+    "tabStyles": {
+      "position": "relative",
+      "margin-left": "4px",
+      "margin-top": "0px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "cursor": "pointer",
+      "min-width": "100px",
+      "background": "transparent ",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #3c76b7"
+    },
+    "tabTextStyles": {
+      "color": "#666",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-top": "0px",
+      "margin-left": "8px"
+    },
+    "tabCurrentStyles": {
+      "position": "relative",
+      "margin-top": "0px",
+      "margin-left": "2px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "min-width": "100px",
+      "background": "#3c76b7",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border-top": "0px solid #f0f0f0",
+      "border-left": "0px solid #f0f0f0",
+      "border-right": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #3c76b7"
+    },
+    "tabCurrentTextStyles": {
+      "color": "#FFF",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-left": "8px",
+      "margin-top": "0px"
+    }
+  },
+  "tab$Content": {
+    "styles": {
+      "padding": "20px 0px"
+    }
+  },
+  "table": {
+    "styles": {
+      "background-color": "#FFF",
+      "margin": "10px 10px",
+      "border" : "1px solid #e1e1e1"
+    },
+    "titleStyles":{
+      "background-color": "#f7f7f7",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "layoutStyles": {},
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "log" : {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "margin": "10px 10px",
+      "border" : "1px solid #e1e1e1"
+    },
+    "titleStyles":{
+      "background-color": "#f7f7f7",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "datagrid": {
+    "styles": {},
+    "tableStyles": {
+      "border": "1px solid #cccccc"
+    },
+    "titleStyles": {
+      "height": "28px",
+      "cursor": "pointer",
+      "line-height": "28px",
+      "overflow": "hidden",
+      "opacity": 1,
+      "border-bottom": "1px solid #ccc",
+      "background-color": "#f0f0f0"
+    },
+    "contentStyles": {
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666"
+    },
+    "actionStyles": {
+      "background-color": "#f7f7f7"
+    },
+    "editStyles": {
+      "background-color": "#fff6f6",
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px"
+    },
+    "amountStyles": {
+      "border-top": "1px solid #ccc",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "background-color": "#f0f0f0"
+    },
+    "itemTitleStyles": {
+      "height": "40px",
+      "background-color": "#ffffff",
+      "line-height": "30px",
+      "padding": "0px 15px",
+      "color": "#fb4747",
+      "font-size": "18px",
+      "font-weight": "bold",
+      "border-bottom": "0px solid #cccccc"
+    },
+    "properties": {
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "0",
+      "align": "center"
+    }
+  },
+  "datagrid$Title": {
+    "styles": {
+      "background-color": "#f0f0f0"
+    }
+  },
+  "address": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "height": "30px",
+      "color": "#666",
+      "border": "0px solid #ccc"
+    }
+  },
+  "combox": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "height": "30px",
+      "color": "#666",
+      "border": "0px solid #ccc"
+    }
+  },
+  "textfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "calendar": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "number": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "personfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "30px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "min-height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "orgfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "30px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "min-height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "org": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "30px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "min-height": "30px",
+      "color": "#666",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc"
+    }
+  },
+  "select": {
+    "styles": {
+      "border-bottom": "0px solid #999",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "margin-top": "5px",
+      "color": "#666"
+    },
+    "inputStyles": {
+      "height": "30px",
+      "font-size": "100%"
+    }
+  },
+  "textarea": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "opinion": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "font-size" : "100%",
+      "border": "1px solid transparent",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "actionbar": {
+    "style": "cmcc",
+    "customIconStyle" : "white"
+  },
+  "attachment" : {
+    "style" : "cmcc"
+  }
+}

+ 44 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_default.json

@@ -0,0 +1,44 @@
+{
+  "name": "传统样式",
+  "form": {
+    "styles":{
+      "background-color": "#f0f0f0"
+    }
+  },
+  "table": {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "border": "1px solid #ddd"
+    },
+    "titleTdStyles":{
+      "background-color": "#eee",
+      "color": "#333",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "right"
+    },
+    "contentTdStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "contentTdOverStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#535861"
+    },
+    "contentTdSelectedStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#535861"
+    },
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "2",
+      "align": "center"
+    }
+  },
+  "actionbar": {
+    "style": "xform_blue_simple",
+    "customIconStyle" : ""
+  }
+}

+ 467 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_official.json

@@ -0,0 +1,467 @@
+{
+  "name": "公文样式",
+  "form": {
+    "styles":{
+      "background-color": "#ffffff",
+      "font-family": "宋体"
+    }
+  },
+  "label": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#fd1113",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold",
+        "text-align": "center"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "36px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#fd1113",
+        "height": "60px",
+        "font-family": "宋体"
+      }
+    },
+
+    "section": {
+      "name": "区段标题",
+      "styles": {
+        "height": "40px",
+        "background-color": "#f7f7f7",
+        "line-height": "40px",
+        "padding": "0px 20px",
+        "font-weight": "bold",
+        "color": "#666",
+        "border-bottom": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "div": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#fd1113",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold",
+        "text-align": "center"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "36px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#fd1113",
+        "height": "60px"
+      }
+    },
+    "section": {
+      "name": "区段",
+      "styles": {
+        "padding": "20px 0px",
+        "background-color": "#FFF",
+        "border": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "tab": {
+    "styles": {},
+    "tabAreaStyles": {
+      "height": "40px",
+      "border-bottom": "2px solid #cc3d3d"
+    },
+    "contentAreaStyles": {
+      "line-height": "normal",
+      "clear": "both",
+      "overflow": "hidden"
+    },
+    "tabStyles": {
+      "position": "relative",
+      "margin-left": "4px",
+      "margin-top": "0px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "cursor": "pointer",
+      "min-width": "100px",
+      "background": "transparent ",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #cc0000"
+    },
+    "tabTextStyles": {
+      "color": "#666",
+      "font-weight": "bold",
+      "font-size": "18px",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-top": "0px",
+      "margin-left": "8px"
+    },
+    "tabCurrentStyles": {
+      "position": "relative",
+      "margin-top": "0px",
+      "margin-left": "2px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "min-width": "100px",
+      "background": "#cc0000",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border-top": "0px solid #f0f0f0",
+      "border-left": "0px solid #f0f0f0",
+      "border-right": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #cc3d3d"
+    },
+    "tabCurrentTextStyles": {
+      "color": "#FFF",
+      "font-weight": "bold",
+      "font-size": "18px",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-left": "8px",
+      "margin-top": "0px"
+    }
+  },
+  "tab$Content": {
+    "styles": {
+      "padding": "20px 0px"
+    }
+  },
+  "table": {
+    "styles": {
+      "background-color": "#FFF",
+      "border": "1px solid #fd1113"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#fd1113",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "font-size": "18px"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333",
+      "font-size": "18px",
+      "min-height": "30px"
+    },
+    "layoutStyles": {},
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "5",
+      "align": "center"
+    }
+  },
+  "log" : {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "border": "1px solid #fd1113"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#fd1113",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "font-size": "18px"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333",
+      "font-size": "18px",
+      "min-height": "30px"
+    },
+    "properties": {
+      "width": "100%",
+      "border": "0",
+      "cellpadding": "5",
+      "align": "center"
+    }
+  },
+  "datagrid": {
+    "styles": {
+
+    },
+    "tableStyles": {
+      "border-left": "1px solid #fd1113",
+      "border-top": "1px solid #fd1113"
+    },
+    "titleStyles": {
+      "height": "28px",
+      "cursor": "pointer",
+      "line-height": "28px",
+      "overflow": "hidden",
+      "opacity": 1,
+      "color": "#fd1113",
+      "border-right": "1px solid #fd1113",
+      "border-bottom": "1px solid #fd1113",
+      "background-color": "#f0f0f0"
+    },
+    "contentStyles": {
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px",
+      "border-right": "1px solid #fd1113",
+      "border-bottom": "1px solid #fd1113"
+    },
+    "actionStyles": {
+      "background-color": "#f7f7f7",
+      "border-right": "1px solid #fd1113",
+      "border-bottom": "1px solid #fd1113"
+    },
+    "editStyles": {
+      "background-color": "#fff6f6",
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px",
+      "border-right": "1px solid #fd1113",
+      "border-bottom": "1px solid #fd1113"
+    },
+    "amountStyles": {
+      "border-top": "1px solid #ccc",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "background-color": "#f0f0f0",
+      "border-right": "1px solid #fd1113",
+      "border-bottom": "1px solid #fd1113"
+    },
+    "itemTitleStyles": {
+      "height": "40px",
+      "background-color": "#ffffff",
+      "line-height": "30px",
+      "padding": "0px 15px",
+      "color": "#fd1113",
+      "font-size": "18px",
+      "font-weight": "bold",
+      "border-bottom": "0px solid #cccccc"
+    },
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "0",
+      "align": "center"
+    }
+  },
+  "datagrid$Title": {
+    "styles": {
+      "background-color": "#f0f0f0"
+    }
+  },
+  "textfield": {
+    "styles": {
+      "border-bottom": "0px",
+      "border": "0px solid #999999",
+      "height": "auto",
+      "font-size": "18px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "font-size": "18px",
+      "color": "#666",
+      "font-family": "宋体"
+    }
+  },
+  "calendar": {
+    "styles": {
+      "border-bottom": "0px",
+      "border": "0px solid #999999",
+      "height": "auto",
+      "font-size": "18px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "font-size": "18px",
+      "color": "#666",
+      "font-family": "宋体"
+    }
+  },
+  "number": {
+    "styles": {
+      "border-bottom": "0px",
+      "border": "0px solid #999999",
+      "height": "auto",
+      "font-size": "18px",
+      "line-height": "30px"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "font-size": "18px",
+      "color": "#666",
+      "font-family": "宋体"
+    }
+  },
+  "address": {
+    "styles": {
+      "border-bottom": "0px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "border": "0px solid #999999"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "combox": {
+    "styles": {
+      "border-bottom": "0px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "border": "0px solid #999999"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "personfield": {
+    "styles": {
+      "border-bottom": "0px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "border": "0px solid #999999"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "orgfield": {
+    "styles": {
+      "border-bottom": "0px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "border": "0px solid #999999"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "org": {
+    "styles": {
+      "border-bottom": "0px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "border": "0px solid #999999"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "select": {
+    "styles": {
+      "border-bottom": "0px",
+      "margin-top": "5px",
+      "height": "auto",
+      "line-height": "30px",
+      "font-size": "18px",
+      "color": "#333"
+    },
+    "inputStyles": {
+      "height": "30px",
+      "line-height": "30px",
+      "font-size": "18px",
+      "color": "#666",
+      "font-family": "宋体"
+    }
+  },
+  "textarea": {
+    "styles": {
+      "border": "0px solid #999999",
+      "font-size": "18px"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "opinion": {
+    "styles": {
+      "border": "0px solid #999999",
+      "font-size": "18px"
+    },
+    "inputStyles": {
+      "border": "1px solid #999999",
+      "color": "#666",
+      "font-size": "18px",
+      "font-family": "宋体"
+    }
+  },
+  "actionbar": {
+    "style": "xform_red_simple"
+  },
+  "sidebar": {
+    "style": "xform_side_red_simple",
+    "customIconStyle" : ""
+  },
+  "attachment" : {
+    "style" : "default"
+  }
+}

+ 418 - 0
o2web/source/x_component_query_ViewDesigner/$View/skin/styles_red-simple.json

@@ -0,0 +1,418 @@
+{
+  "name": "红色简洁",
+  "form": {
+    "styles":{
+      "background-color": "#f0f0f0"
+    }
+  },
+  "label": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#cc3d3d",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "24px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#cc3d3d",
+        "height": "60px"
+      }
+    },
+
+    "section": {
+      "name": "区段标题",
+      "styles": {
+        "height": "40px",
+        "background-color": "#f7f7f7",
+        "line-height": "40px",
+        "padding": "0px 20px",
+        "font-weight": "bold",
+        "color": "#666",
+        "border-bottom": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "div": {
+    "banner": {
+      "name": "横幅",
+      "styles": {
+        "background-color": "#cc3d3d",
+        "height": "40px",
+        "line-height": "40px",
+        "color": "#ffffff",
+        "font-size": "18px",
+        "padding": "0px 10px",
+        "font-weight": "bold"
+      }
+    },
+
+    "title": {
+      "name": "标题",
+      "styles": {
+        "text-align": "center",
+        "font-size": "24px",
+        "line-height": "60px",
+        "font-weight": "bold",
+        "color": "#cc3d3d",
+        "height": "60px"
+      }
+    },
+    "section": {
+      "name": "区段",
+      "styles": {
+        "padding": "20px 0px",
+        "background-color": "#FFF",
+        "border": "1px solid #cccccc"
+      }
+    }
+  },
+
+  "tab": {
+    "styles": {},
+    "tabAreaStyles": {
+      "height": "40px",
+      "border-bottom": "2px solid #cc3d3d"
+    },
+    "contentAreaStyles": {
+      "line-height": "normal",
+      "clear": "both",
+      "overflow": "hidden"
+    },
+    "tabStyles": {
+      "position": "relative",
+      "margin-left": "4px",
+      "margin-top": "0px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "cursor": "pointer",
+      "min-width": "100px",
+      "background": "transparent ",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #cc3d3d"
+    },
+    "tabTextStyles": {
+      "color": "#666",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-top": "0px",
+      "margin-left": "8px"
+    },
+    "tabCurrentStyles": {
+      "position": "relative",
+      "margin-top": "0px",
+      "margin-left": "2px",
+      "margin-right": "0px",
+      "float": "left",
+      "height": "40px",
+      "min-width": "100px",
+      "background": "#cc3d3d",
+      "border-top-left-radius": "5px",
+      "border-top-right-radius": "5px",
+      "border-top": "0px solid #f0f0f0",
+      "border-left": "0px solid #f0f0f0",
+      "border-right": "0px solid #f0f0f0",
+      "border-bottom": "1px solid #cc3d3d"
+    },
+    "tabCurrentTextStyles": {
+      "color": "#FFF",
+      "font-weight": "bold",
+      "line-height": "40px",
+      "text-align": "center",
+      "margin-right": "8px",
+      "margin-left": "8px",
+      "margin-top": "0px"
+    }
+  },
+  "tab$Content": {
+    "styles": {
+      "padding": "20px 0px"
+    }
+  },
+  "table": {
+    "styles": {
+      "background-color": "#FFF",
+      "margin": "10px 0px"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "right"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "layoutStyles": {},
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "log" : {
+    "tableStyles": {
+      "background-color": "#FFF",
+      "margin": "10px 0px"
+    },
+    "titleStyles":{
+      "background-color": "#fff",
+      "color": "#333",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "right"
+    },
+    "contentStyles": {
+      "background-color": "#FFFFFF",
+      "color": "#333"
+    },
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "5",
+      "align": "center"
+    }
+  },
+  "datagrid": {
+    "styles": {},
+    "tableStyles": {
+      "border": "1px solid #cccccc"
+    },
+    "titleStyles": {
+      "height": "28px",
+      "cursor": "pointer",
+      "line-height": "28px",
+      "overflow": "hidden",
+      "opacity": 1,
+      "border-bottom": "1px solid #ccc",
+      "background-color": "#f0f0f0"
+    },
+    "contentStyles": {
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px",
+      "color": "#666"
+    },
+    "actionStyles": {
+      "background-color": "#f7f7f7"
+    },
+    "editStyles": {
+      "background-color": "#fff6f6",
+      "text-align": "center",
+      "height": "30px",
+      "line-height": "30px"
+    },
+    "amountStyles": {
+      "border-top": "1px solid #ccc",
+      "font-weight": "bold",
+      "height": "30px",
+      "line-height": "30px",
+      "text-align": "center",
+      "background-color": "#f0f0f0"
+    },
+    "itemTitleStyles": {
+      "height": "40px",
+      "background-color": "#ffffff",
+      "line-height": "30px",
+      "padding": "0px 15px",
+      "color": "#fb4747",
+      "font-size": "18px",
+      "font-weight": "bold",
+      "border-bottom": "0px solid #cccccc"
+    },
+    "properties": {
+      "width": "90%",
+      "border": "0",
+      "cellpadding": "3",
+      "cellspacing": "0",
+      "align": "center"
+    }
+  },
+  "datagrid$Title": {
+    "styles": {
+      "background-color": "#f0f0f0"
+    }
+  },
+  "address": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "border": "0px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "combox": {
+    "styles": {
+      "border-bottom": "1px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "border": "0px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "textfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "calendar": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "number": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "height": "26px",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "personfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "min-height": "26px",
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "orgfield": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "org": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "min-height": "20px",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "select": {
+    "styles": {
+      "border-bottom": "0px solid #999",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px",
+      "margin-top": "5px",
+      "color": "#666",
+      "line-height": "26px"
+    },
+    "inputStyles": {
+
+    }
+  },
+  "textarea": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "opinion": {
+    "styles": {
+      "border-bottom": "0px solid #ccc",
+      "border-top": "0px",
+      "border-left": "0px",
+      "border-right": "0px"
+    },
+    "inputStyles": {
+      "border-bottom": "1px solid #ccc",
+      "color": "#666"
+    }
+  },
+  "actionbar": {
+    "style": "xform_red_simple",
+    "customIconStyle" : ""
+  },
+  "attachment" : {
+    "style" : "default"
+  }
+}

+ 12 - 0
o2web/source/x_component_query_ViewDesigner/$View/toolbars.json

@@ -0,0 +1,12 @@
+[
+  {
+    "type": "MWFToolBarButton",
+    "img": "export.png",
+    "title": "导出Excel",
+    "action": "exportView",
+    "text": "导出Excel",
+    "id": "action_export",
+    "condition": "",
+    "read": true
+  }
+]

+ 33 - 0
o2web/source/x_component_query_ViewDesigner/$View/view.html

@@ -46,6 +46,27 @@
                 <td class="editTableTitle">每页行数:</td>
                 <td class="editTableTitle">每页行数:</td>
                 <td class="editTableValue"><input type="number" name="pageSize" value="text{$.pageSize || 20}" class="editTableInput"/></td>
                 <td class="editTableValue"><input type="number" name="pageSize" value="text{$.pageSize || 20}" class="editTableInput"/></td>
             </tr>
             </tr>
+<!--            <tr>-->
+<!--                <td class="editTableTitle">视图样式:</td>-->
+<!--                <td class="editTableValue">-->
+<!--                    <select class="MWFViewStyle" name="viewStyleType"></select>-->
+<!--                </td>-->
+<!--            </tr>-->
+            <tr>
+                <td class="editTableTitle">隐藏操作条:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden!==false)?'checked':''} type="radio" value="true"/>是
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden===false)?'checked':''} type="radio" value="false"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">选择:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.select" text{($.data.select!=='single' || $.data.select!=='multi' )?'checked':''} type="radio" value="none"/>无
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='single')?'checked':''} type="radio" value="single"/>单选
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='multi')?'checked':''} type="radio" value="multi"/>多选
+                </td>
+            </tr>
             <!--<tr>-->
             <!--<tr>-->
             <!--<td class="editTableTitle">最大行数:</td>-->
             <!--<td class="editTableTitle">最大行数:</td>-->
             <!--<td class="editTableValue"><input type="text" name="max" value="text{$.max}" class="editTableInput"/></td>-->
             <!--<td class="editTableValue"><input type="text" name="max" value="text{$.max}" class="editTableInput"/></td>-->
@@ -113,6 +134,7 @@
                 </td>
                 </td>
             </tr>
             </tr>
         </table>
         </table>
+
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
         <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
             <tr>
             <tr>
                 <td class="editTableTitle">权限:</td>
                 <td class="editTableTitle">权限:</td>
@@ -561,6 +583,17 @@
         </div>
         </div>
     </div>
     </div>
 
 
+<!--    <div title="样式"  class="MWFTab">-->
+<!--        <div class="MWFMaplist" name="tableStyles" collapse="true" title="表格样式"></div>-->
+<!--        <div class="MWFMaplist" name="titleTdStyles" collapse="true" title="标题单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdStyles" collapse="true" title="内容单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdOverStyles" collapse="true" title="内容单元格鼠标over事件样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdSelectedStyles" collapse="true" title="内容单元格选中样式"></div>-->
+<!--    </div>-->
+
+    <div title="事件"  class="MWFTab">
+        <div class="MWFEventsArea" name="data.events"></div>
+    </div>
 
 
     <div title="JSON"  class="MWFTab">
     <div title="JSON"  class="MWFTab">
         <div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
         <div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>

+ 43 - 1
o2web/source/x_component_query_ViewDesigner/$View/view.json

@@ -39,7 +39,49 @@
     "calculate": {},
     "calculate": {},
     "afterGridScriptText": "",
     "afterGridScriptText": "",
     "afterGroupGridScriptText": "",
     "afterGroupGridScriptText": "",
-    "afterCalculateGridScriptText": ""
+    "afterCalculateGridScriptText": "",
+    "events": {
+      "queryLoad" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoad": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPageData" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPage": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "selectRow" : {
+        "code": "",
+        "html": ""
+      },
+      "unselectRow" : {
+        "code": "",
+        "html": ""
+      }
+    }
   },
   },
   "availableIdentityList": [],
   "availableIdentityList": [],
   "availableUnitList": []
   "availableUnitList": []

+ 149 - 0
o2web/source/x_component_query_ViewDesigner/Property.js

@@ -62,6 +62,11 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                     this.loadColumnExportEditor();
                     this.loadColumnExportEditor();
 
 
                     this.loadJSONArea();
                     this.loadJSONArea();
+
+                    this.loadEventsEditor();
+                    this.loadActionStylesArea();
+                    this.loadActionArea();
+                    this.loadStylesList();
                 }
                 }
             }.bind(this));
             }.bind(this));
         }else{
         }else{
@@ -703,6 +708,150 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
         this.data.filterList.push(op);
         this.data.filterList.push(op);
         var filter = new MWF.xApplication.query.ViewDesigner.Property.Filter(op, table, this);
         var filter = new MWF.xApplication.query.ViewDesigner.Property.Filter(op, table, this);
         filter.editMode();
         filter.editMode();
+    },
+    loadActionStylesArea: function(){
+        var _self = this;
+        var actionAreas = this.propertyContent.getElements(".MWFActionStylesArea");
+        actionAreas.each(function(node){
+            var name = node.get("name");
+            var actionStyles = this.data[name];
+            MWF.require("MWF.widget.Maplist", function(){
+                var maps = [];
+                Object.each(actionStyles, function(v, k){
+                    var mapNode = new Element("div").inject(node);
+                    mapNode.empty();
+
+                    var maplist = new MWF.widget.Maplist(mapNode, {
+                        "title": k,
+                        "collapse": true,
+                        "onChange": function(){
+                            var oldData = _self.data[name];
+                            maps.each(function(o){
+                                _self.data[name][o.key] = o.map.toJson();
+                            }.bind(this));
+                            _self.changeData(name, node, oldData);
+                        }
+                    });
+                    maps.push({"key": k, "map": maplist});
+                    maplist.load(v);
+                }.bind(this));
+            }.bind(this));
+
+
+        }.bind(this));
+    },
+    loadEventsEditor: function(){
+        MWF.xApplication.process = MWF.xApplication.process || {};
+        MWF.APPFD = MWF.xApplication.process.FormDesigner = MWF.xApplication.process.FormDesigner || {};
+        MWF.xDesktop.requireApp("process.FormDesigner", "lp."+o2.language, null, false);
+
+        var events = this.propertyContent.getElement(".MWFEventsArea");
+        if (events){
+            var name = events.get("name");
+            var eventsObj = this.data;
+            Array.each( name.split("."), function(n){
+                if(eventsObj)eventsObj = eventsObj[n];
+            })
+            MWF.xDesktop.requireApp("process.FormDesigner", "widget.EventsEditor", function(){
+                var eventsEditor = new MWF.xApplication.process.FormDesigner.widget.EventsEditor(events, this.designer, {
+                    //"maxObj": this.propertyNode.parentElement.parentElement.parentElement,
+                    "maxObj": this.designer.contentNode
+                });
+                eventsEditor.load(eventsObj, this.data, name);
+            }.bind(this));
+        }
+    },
+    loadActionArea: function(){
+        MWF.xApplication.process = MWF.xApplication.process || {};
+        MWF.APPFD = MWF.xApplication.process.FormDesigner = MWF.xApplication.process.FormDesigner || {};
+        MWF.xDesktop.requireApp("process.FormDesigner", "lp."+o2.language, null, false);
+
+        var actionAreas = this.propertyContent.getElements(".MWFActionArea");
+        actionAreas.each(function(node){
+            var name = node.get("name");
+            var actionContent = this.data[name];
+            MWF.xDesktop.requireApp("process.FormDesigner", "widget.ActionsEditor", function(){
+
+                // debugger;
+                // var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, {
+                //     "maxObj": this.propertyNode.parentElement.parentElement.parentElement,
+                //     "noCreate": true,
+                //     "noDelete": true,
+                //     "noCode": true,
+                //     "onChange": function(){
+                //         this.data[name] = actionEditor.data;
+                //     }.bind(this)
+                // });
+                // actionEditor.load(this.module.defaultToolBarsData);
+
+                var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, this.data, {
+                    "maxObj": this.propertyNode.parentElement.parentElement.parentElement,
+                    "noEditShow" : true,
+                    "noReadShow" : true,
+                    "onChange": function(){
+                        this.data[name] = actionEditor.data;
+                        this.changeData(name);
+                    }.bind(this)
+                });
+                actionEditor.load(actionContent);
+            }.bind(this));
+
+        }.bind(this));
+
+        var actionAreas = this.propertyContent.getElements(".MWFDefaultActionArea");
+        actionAreas.each(function(node){
+            var name = node.get("name");
+            var actionContent = this.data[name] || this.module.defaultToolBarsData;
+            MWF.xDesktop.requireApp("process.FormDesigner", "widget.ActionsEditor", function(){
+
+                var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, this.data, {
+                    "maxObj": this.propertyNode.parentElement.parentElement.parentElement,
+                    "isSystemTool" : true,
+                    "systemToolsAddress" : "/x_component_query_ViewDesigner/$View/toolbars.json",
+                    "noCreate": true,
+                    "noDelete": false,
+                    "noCode": true,
+                    "noReadShow": true,
+                    "noEditShow": true,
+                    "onChange": function(){
+                        this.data[name] = actionEditor.data;
+                        this.changeData(name);
+                    }.bind(this)
+                });
+                actionEditor.load(actionContent);
+
+                // var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, {
+                //     "maxObj": this.propertyNode.parentElement.parentElement.parentElement,
+                //     "onChange": function(){
+                //         this.data[name] = actionEditor.data;
+                //     }.bind(this)
+                // });
+                // actionEditor.load(actionContent);
+            }.bind(this));
+
+        }.bind(this));
+
+    },
+    loadStylesList: function(){
+        var styleSelNodes = this.propertyContent.getElements(".MWFViewStyle");
+        styleSelNodes.each(function(node){
+            debugger;
+            if (this.module.stylesList){
+                if (!this.data.data.viewStyleType) this.data.data.viewStyleType = "default";
+                // var mode = ( this.form.options.mode || "" ).toLowerCase() === "mobile" ? "mobile" : "pc";
+                Object.each(this.module.stylesList, function(s, key){
+                    // if( s.mode.contains( mode ) ){
+                        new Element("option", {
+                            "text": s.name,
+                            "value": key,
+                            "selected": ((!this.data.data.viewStyleType && key=="default") || (this.data.data.viewStyleType==key))
+                        }).inject(node)
+                    // }
+                }.bind(this));
+            }else{
+                node.getParent("tr").setStyle("display", "none");
+            }
+        }.bind(this));
     }
     }
     //initWhereEntryData: function(){
     //initWhereEntryData: function(){
     //    if (!this.data.data.restrictWhereEntry) this.data.data.restrictWhereEntry = {
     //    if (!this.data.data.restrictWhereEntry) this.data.data.restrictWhereEntry = {

+ 887 - 8
o2web/source/x_component_query_ViewDesigner/View.js

@@ -69,6 +69,20 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
     },
     },
     parseData: function(){
     parseData: function(){
         this.json = this.data;
         this.json = this.data;
+        if( !this.json.data.events ){
+            var url = "/x_component_query_ViewDesigner/$View/view.json";
+            MWF.getJSON(url, {
+                "onSuccess": function(obj){
+                    this.json.data.events = obj.data.events;
+                }.bind(this),
+                "onerror": function(text){
+                    this.notice(text, "error");
+                }.bind(this),
+                "onRequestFailure": function(xhr){
+                    this.notice(xhr.responseText, "error");
+                }.bind(this)
+            },false);
+        }
     },
     },
 
 
     showProperty: function(){
     showProperty: function(){
@@ -107,14 +121,20 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
 
 
         this.domListNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.designer.propertyDomArea);
         this.domListNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.designer.propertyDomArea);
 
 
-        this.loadView();
+        this.loadTemplateStyle( function () {
 
 
-        this.selected();
-        this.setEvent();
+            this.loadActionbar();
+
+            this.loadView();
+
+            this.selected();
+            this.setEvent();
 
 
-        //if (this.options.showTab) this.page.showTabIm();
-        this.setViewWidth();
-        this.designer.addEvent("resize", this.setViewWidth.bind(this));
+            //if (this.options.showTab) this.page.showTabIm();
+            this.setViewWidth();
+
+            this.designer.addEvent("resize", this.setViewWidth.bind(this));
+        }.bind(this))
     },
     },
     setEvent: function(){
     setEvent: function(){
         this.areaNode.addEvent("click", this.selected.bind(this));
         this.areaNode.addEvent("click", this.selected.bind(this));
@@ -140,6 +160,7 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
 
 
                 this.designer.actions.loadView(this.data.id, null,function(json){
                 this.designer.actions.loadView(this.data.id, null,function(json){
                     var entries = {};
                     var entries = {};
+
                     json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
                     json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
 
 
                     if (this.json.data.group.column){
                     if (this.json.data.group.column){
@@ -154,7 +175,7 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
 
 
                             json.data.groupGrid.each(function(line, idx){
                             json.data.groupGrid.each(function(line, idx){
                                 var groupTr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
                                 var groupTr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
-                                var colSpan = this.items.length;
+                                var colSpan = this.items.length ;
                                 var td = new Element("td", {"styles": this.css.viewContentGroupTdNode, "colSpan": colSpan}).inject(groupTr);
                                 var td = new Element("td", {"styles": this.css.viewContentGroupTdNode, "colSpan": colSpan}).inject(groupTr);
                                 var groupAreaNode = new Element("div", {"styles": this.css.viewContentTdGroupNode}).inject(td);
                                 var groupAreaNode = new Element("div", {"styles": this.css.viewContentTdGroupNode}).inject(td);
                                 var groupIconNode = new Element("div", {"styles": this.css.viewContentTdGroupIconNode}).inject(groupAreaNode);
                                 var groupIconNode = new Element("div", {"styles": this.css.viewContentTdGroupIconNode}).inject(groupAreaNode);
@@ -172,6 +193,9 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                                 line.list.each(function(entry){
                                 line.list.each(function(entry){
                                     var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
                                     var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
                                     tr.setStyle("display", "none");
                                     tr.setStyle("display", "none");
+
+                                    //this.createViewCheckboxTd( tr );
+
                                     var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
                                     var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
 
 
                                     Object.each(entries, function(c, k){
                                     Object.each(entries, function(c, k){
@@ -228,6 +252,8 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                             json.data.grid.each(function(line, idx){
                             json.data.grid.each(function(line, idx){
                                 var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
                                 var tr = new Element("tr", {"styles": this.css.viewContentTrNode}).inject(this.viewContentTableNode);
 
 
+                                //this.createViewCheckboxTd( tr );
+
                                 Object.each(entries, function(c, k){
                                 Object.each(entries, function(c, k){
                                     var d = line.data[k];
                                     var d = line.data[k];
                                     if (d!=undefined){
                                     if (d!=undefined){
@@ -401,7 +427,8 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
     setContentHeight: function(){
     setContentHeight: function(){
         var size = this.areaNode.getSize();
         var size = this.areaNode.getSize();
         var titleSize = this.viewTitleNode.getSize();
         var titleSize = this.viewTitleNode.getSize();
-        var height = size.y-titleSize.y-2;
+        var actionbarSize = this.actionbarNode ? this.actionbarNode.getSize() : {x:0, y:0};
+        var height = size.y-titleSize.y-actionbarSize.y-2;
 
 
         this.viewContentScrollNode.setStyle("height", height);
         this.viewContentScrollNode.setStyle("height", height);
 
 
@@ -424,11 +451,63 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
         }
         }
     //    }
     //    }
     },
     },
+    loadViewSelectAllNode : function(){
+        var _self = this;
+        var td = new Element("td.viewTitleCheckboxTd",{ "styles": this.css.viewTitleColumnAreaNode }).inject( this.viewTitleTrNode );
+        td.setStyles({
+            "width":"30px", "text-align" : "center",
+            "display" : this.json.data.selectAllEnable ? "table-cell" : "none"
+        });
+        new Element("input",{
+            "type" : "checkbox",
+            "events" : {
+                "change" : function(){
+                    _self.viewContentTableNode.getElements(".viewContentCheckbox").set("checked", this.checked )
+                }
+            }
+        }).inject(td);
+    },
+    createViewCheckboxTd : function( tr ){
+        var td = new Element("td.viewContentCheckboxTd", {"styles": this.css.viewContentTdNode}).inject(tr, "top");
+        td.setStyles({
+            "width":"30px", "text-align" : "center",
+            "display" : this.json.data.selectAllEnable ? "table-cell" : "none"
+        });
+        new Element("input.viewContentCheckbox",{
+            "type" : "checkbox"
+        }).inject(td);
+    },
     loadView: function(){
     loadView: function(){
         this.loadViewNodes();
         this.loadViewNodes();
+        //this.loadViewSelectAllNode();
         this.loadViewColumns();
         this.loadViewColumns();
 //        this.addTopItemNode.addEvent("click", this.addTopItem.bind(this));
 //        this.addTopItemNode.addEvent("click", this.addTopItem.bind(this));
     },
     },
+    loadActionbar: function(){
+        this.actionbarNode = new Element("div#actionbarNode", {"styles": this.css.actionbarNode}).inject(this.areaNode);
+        this.actionbarList = [];
+        if( !this.json.data.actionbarHidden ){
+            this.showActionbar( true );
+        }
+    },
+    hideActionbar : function(){
+        this.actionbarNode.hide();
+        this.setContentHeight();
+    },
+    showActionbar : function( noSetHeight ){
+        this.actionbarNode.show();
+        if( !this.json.data.actionbarList )this.json.data.actionbarList = [];
+        if( !this.actionbarList || this.actionbarList.length == 0 ){
+            if( this.json.data.actionbarList.length ){
+                this.json.data.actionbarList.each( function(json){
+                    this.actionbarList.push( new MWF.xApplication.query.ViewDesigner.View.Actionbar( json, this.json.data.actionbarList, this) )
+                }.bind(this));
+            }else{
+                this.actionbarList.push( new MWF.xApplication.query.ViewDesigner.View.Actionbar( null, this.json.data.actionbarList, this) )
+            }
+        }
+        if( !noSetHeight )this.setContentHeight();
+    },
     setViewWidth: function(){
     setViewWidth: function(){
         this.viewAreaNode.setStyle("width", "auto");
         this.viewAreaNode.setStyle("width", "auto");
         this.viewTitleNode.setStyle("width", "auto");
         this.viewTitleNode.setStyle("width", "auto");
@@ -528,6 +607,54 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
                 }
                 }
             }.bind(this));
             }.bind(this));
         }
         }
+        if( name=="data.actionbarHidden" ){
+            if( this.json.data.actionbarHidden ){
+                this.hideActionbar()
+            }else{
+                this.showActionbar()
+            }
+        }
+        if( name=="data.selectAllEnable" ){
+            if( this.json.data.selectAllEnable ){
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","table-cell");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","table-cell");
+            }else{
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","none");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","none");
+            }
+        }
+        if (name=="data.viewStyleType"){
+
+            var file = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].file : null;
+            var extendFile = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].extendFile : null;
+            this.loadTemplateStyles( file, extendFile, function( templateStyles ){
+                this.templateStyles = templateStyles;
+
+                var oldFile, oldExtendFile;
+                if( oldValue && this.stylesList[oldValue] ){
+                    oldFile = this.stylesList[oldValue].file;
+                    oldExtendFile = this.stylesList[oldValue].extendFile;
+                }
+                this.loadTemplateStyles( oldFile, oldExtendFile, function( oldTemplateStyles ){
+
+                    this.json.data.styleConfig = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType] : null;
+
+                    if (oldTemplateStyles["form"]) this.clearTemplateStyles(oldTemplateStyles["form"]);
+                    if (this.templateStyles["form"]) this.setTemplateStyles(this.templateStyles["form"]);
+
+                    // this.setAllStyles();
+
+                    // this.moduleList.each(function(module){
+                    //     if (oldTemplateStyles[module.moduleName]){
+                    //         module.clearTemplateStyles(oldTemplateStyles[module.moduleName]);
+                    //     }
+                    //     module.setStyleTemplate();
+                    //     module.setAllStyles();
+                    // }.bind(this));
+                }.bind(this))
+
+            }.bind(this))
+        }
     },
     },
 
 
     saveAs: function(){
     saveAs: function(){
@@ -588,6 +715,147 @@ MWF.xApplication.query.ViewDesigner.View = new Class({
             this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
             this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
             if (callback) callback();
             if (callback) callback();
         }.bind(this));
         }.bind(this));
+    },
+
+
+    loadTemplateStyle : function( callback ){
+        this.loadStylesList(function(){
+            var oldStyleValue = "";
+            if ((!this.json.data.viewStyleType) || !this.stylesList[this.json.data.viewStyleType]) this.json.data.viewStyleType="default";
+            // if (this.options.mode=="Mobile"){
+            //     if (this.json.viewStyleType != "defaultMobile"){
+            //         var styles = this.stylesList[this.json.viewStyleType];
+            //         if( !styles || typeOf(styles.mode)!=="array" || !styles.mode.contains( "mobile" ) ){
+            //             oldStyleValue = this.json.viewStyleType;
+            //             this.json.viewStyleType = "defaultMobile";
+            //         }
+            //     }
+            // }
+
+            this.loadTemplateStyles( this.stylesList[this.json.data.viewStyleType].file, this.stylesList[this.json.data.viewStyleType].extendFile,
+                function( templateStyles ){
+                    this.templateStyles = templateStyles;
+                    // this.loadDomModules();
+
+                    if (this.json.data.viewStyleType && this.templateStyles && this.templateStyles["form"]){
+                        this.setTemplateStyles(this.templateStyles["form"]);
+                    }
+
+                    // this.setCustomStyles();
+                    this.node.setProperties(this.json.data.properties);
+
+                    if(callback)callback();
+
+                    // this.setNodeEvents();
+
+                    // if (this.options.mode=="Mobile"){
+                    //     if (oldStyleValue) this._setEditStyle("viewStyleType", null, oldStyleValue);
+                    // }
+                }.bind(this)
+            );
+        }.bind(this));
+    },
+    removeStyles: function(from, to){
+        if (this.json.data[to]){
+            Object.each(from, function(style, key){
+                if (this.json.data[to][key] && this.json.data[to][key]==style){
+                    delete this.json.data[to][key];
+                }
+            }.bind(this));
+        }
+    },
+    copyStyles: function(from, to){
+        if (!this.json.data[to]) this.json.data[to] = {};
+        Object.each(from, function(style, key){
+            if (!this.json.data[to][key]) this.json.data[to][key] = style;
+        }.bind(this));
+    },
+    clearTemplateStyles: function(styles){
+        if (styles){
+            if (styles.styles) this.removeStyles(styles.styles, "styles");
+            if (styles.properties) this.removeStyles(styles.properties, "properties");
+        }
+    },
+    setTemplateStyles: function(styles){
+        if (styles.styles) this.copyStyles(styles.styles, "styles");
+        if (styles.properties) this.copyStyles(styles.properties, "properties");
+    },
+
+    loadTemplateStyles : function( file, extendFile, callback ){
+        if( !file ){
+            if (callback) callback({});
+            return;
+        }
+        this.templateStylesList = this.templateStylesList || {};
+        if( this.templateStylesList[file] ){
+            if (callback) callback(this.templateStylesList[file]);
+            return;
+        }
+        this.loadTemplateStyleFile( file, function( json_file ){
+            this.loadTemplateExtendStyleFile( extendFile, function( json_extend ){
+                this.templateStylesList[file] = Object.merge( json_file, json_extend );
+                if (callback) callback(this.templateStylesList[file]);
+            }.bind(this))
+        }.bind(this))
+
+    },
+    loadTemplateStyleFile : function(file, callback ){
+        if( !file ){
+            if (callback) callback({});
+            return;
+        }
+        var stylesUrl = "/x_component_query_ViewDesigner/$View/skin/"+file;
+        MWF.getJSON(stylesUrl,{
+                "onSuccess": function(responseJSON){
+                    //this.templateStylesList[file] = responseJSON;
+                    if (callback) callback(responseJSON);
+                }.bind(this),
+                "onRequestFailure": function(){
+                    if (callback) callback({});
+                }.bind(this),
+                "onError": function(){
+                    if (callback) callback({});
+                }.bind(this)
+            }
+        );
+    },
+    loadTemplateExtendStyleFile : function(extendFile, callback ){
+        if( !extendFile ){
+            if (callback) callback({});
+            return;
+        }
+        var stylesUrl = "/x_component_query_ViewDesigner/$View/skin/"+extendFile;
+        MWF.getJSON(stylesUrl,{
+                "onSuccess": function(responseJSON){
+                    //this.templateStylesList[file] = responseJSON;
+                    if (callback) callback(responseJSON);
+                }.bind(this),
+                "onRequestFailure": function(){
+                    if (callback) callback({});
+                }.bind(this),
+                "onError": function(){
+                    if (callback) callback({});
+                }.bind(this)
+            }
+        );
+    },
+    loadStylesList: function(callback){
+        var configUrl = "/x_component_query_ViewDesigner/$View/skin/config.json";
+        MWF.getJSON(configUrl,{
+                "onSuccess": function(responseJSON){
+                    this.stylesList = responseJSON;
+                    if (callback) callback(this.stylesList);
+                }.bind(this),
+                "onRequestFailure": function(){
+                    this.stylesList = {};
+                    if (callback) callback(this.stylesList);
+                }.bind(this),
+                "onError": function(){
+                    this.stylesList = {};
+                    if (callback) callback(this.stylesList);
+                }.bind(this)
+            }
+        );
     }
     }
 
 
 });
 });
@@ -966,4 +1234,615 @@ MWF.xApplication.query.ViewDesigner.View.Column = new Class({
 
 
 });
 });
 
 
+MWF.require("MWF.widget.Toolbar", null, false);
+MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
+    Implements: [Options, Events],
+    options : {
+        "style" : "default",
+        "customImageStyle" : "default"
+    },
+    initialize: function(json, jsonList, view, options){
+        this.setOptions( options );
+        this.propertyPath = "/x_component_query_ViewDesigner/$View/actionbar.html";
+        this.path = "/x_component_query_ViewDesigner/$View/";
+        this.imagePath_default = "/x_component_query_ViewDesigner/$View/";
+        this.imagePath_custom = "/x_component_process_FormDesigner/Module/Actionbar/";
+        this.cssPath = "/x_component_query_ViewDesigner/$View/"+this.options.style+"/actionbar.wcss";
+
+        this.view = view;
+        this.json = json;
+        this.jsonList = jsonList;
+        this.css = this.view.css;
+        this.container = this.view.actionbarNode;
+        this.load();
+    },
+    load: function(){
+        this.systemTools = [];
+        this.customTools = [];
+        if( !this.json ){
+            this.loadDefaultJson(function(){
+                this._load()
+            }.bind(this));
+        }else{
+            this._load()
+        }
+    },
+    _load : function(){
+        this._createNode();
+        //this._createIconAction();
+        //if (!this.json.export) this.hideMode();
+        this.setEvent();
+    },
+    loadDefaultJson: function(callback){
+        var url = this.path+"actionbar.json";
+        MWF.getJSON(url, {
+            "onSuccess": function(obj){
+                this.view.designer.actions.getUUID(function(id){
+                    obj.id=id;
+                    //obj.isNewView = true;
+                    //obj.application = this.view.designer.application.id;
+                    this.json = obj;
+                    this.jsonList.push( this.json );
+                    if (callback) callback(obj);
+                }.bind(this));
+            }.bind(this),
+            "onerror": function(text){
+                this.view.designer.notice(text, "error");
+            }.bind(this),
+            "onRequestFailure": function(xhr){
+                this.view.designer.notice(xhr.responseText, "error");
+            }.bind(this)
+        });
+    },
+    setEvent: function(){
+        this.node.addEvents({
+            "click": function(e){this.selected(); e.stopPropagation();}.bind(this),
+            "mouseover": function(){if (!this.isSelected) this.node.setStyles(this.css.toolbarWarpNode_over)}.bind(this),
+            "mouseout": function(){if (!this.isSelected) this.node.setStyles(this.css.toolbarWarpNode) }.bind(this)
+        });
+    },
+    //_createIconAction: function(){
+    //    if (!this.actionArea){
+    //        this.actionArea = new Element("div", {"styles": this.css.actionAreaNode}).inject(this.container, "after");
+    //
+    //        //this._createAction({
+    //        //    "name": "move",
+    //        //    "icon": "move1.png",
+    //        //    "event": "mousedown",
+    //        //    "action": "move",
+    //        //    "title": MWF.APPDVD.LP.action.move
+    //        //});
+    //        //this._createAction({
+    //        //    "name": "add",
+    //        //    "icon": "add.png",
+    //        //    "event": "click",
+    //        //    "action": "addColumn",
+    //        //    "title": MWF.APPDVD.LP.action.add
+    //        //});
+    //        this._createAction({
+    //            "name": "delete",
+    //            "icon": "delete1.png",
+    //            "event": "click",
+    //            "action": "delete",
+    //            "title": MWF.APPDVD.LP.action["delete"]
+    //        });
+    //    }
+    //},
+    //_createAction: function(action){
+    //    var actionNode = new Element("div", {
+    //        "styles": this.css.actionNodeStyles,
+    //        "title": action.title
+    //    }).inject(this.actionArea);
+    //    actionNode.setStyle("background", "url("+this.view.path+this.view.options.style+"/action/"+action.icon+") no-repeat left center");
+    //    actionNode.addEvent(action.event, function(e){
+    //        this[action.action](e);
+    //    }.bind(this));
+    //    actionNode.addEvents({
+    //        "mouseover": function(e){
+    //            e.target.setStyle("border", "1px solid #999");
+    //        }.bind(this),
+    //        "mouseout": function(e){
+    //            e.target.setStyle("border", "1px solid #F1F1F1");
+    //        }.bind(this)
+    //    });
+    //},
+    //_setActionAreaPosition: function(){
+    //    var p = this.node.getPosition(this.view.areaNode.getOffsetParent());
+    //    var y = p.y-25;
+    //    var x = p.x;
+    //    this.actionArea.setPosition({"x": x, "y": y});
+    //},
+    //_showActions: function(){
+    //    if (this.actionArea){
+    //        this._setActionAreaPosition();
+    //        this.actionArea.setStyle("display", "block");
+    //    }
+    //},
+    //_hideActions: function(){
+    //    if (this.actionArea) this.actionArea.setStyle("display", "none");
+    //},
+
+    selected: function(){
+        if (this.view.currentSelectedModule){
+            if (this.view.currentSelectedModule==this){
+                return true;
+            }else{
+                this.view.currentSelectedModule.unSelected();
+            }
+        }
+        this.node.setStyles(this.css.toolbarWarpNode_selected);
+        //this.listNode.setStyles(this.css.cloumnListNode_selected);
+        new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 100}).toElementEdge(this.node);
+        //new Fx.Scroll(this.view.designer.propertyDomArea, {"wheelStops": false, "duration": 100}).toElement(this.listNode);
+
+        this.view.currentSelectedModule = this;
+        this.isSelected = true;
+        //this._showActions();
+        this.showProperty();
+    },
+    unSelected: function(){
+        this.view.currentSelectedModule = null;
+        this.node.setStyles(this.css.toolbarWarpNode)
+
+        //this.listNode.setStyles(this.css.cloumnListNode);
+        this.isSelected = false;
+        //this._hideActions();
+        this.hideProperty();
+    },
+
+    showProperty: function(){
+        if (!this.property){
+            this.property = new MWF.xApplication.query.ViewDesigner.Property(this, this.view.designer.propertyContentArea, this.view.designer, {
+                "path": this.propertyPath,
+                "onPostLoad": function(){
+                    this.property.show();
+                    //var processDiv = this.property.propertyContent.getElements("#"+this.json.id+"dataPathSelectedProcessArea");
+                    //var cmsDiv = this.property.propertyContent.getElements("#"+this.json.id+"dataPathSelectedCMSArea");
+                    //
+                    //if (this.view.json.type=="cms"){
+                    //    processDiv.setStyle("display", "none");
+                    //    cmsDiv.setStyle("display", "block");
+                    //}else{
+                    //    processDiv.setStyle("display", "block");
+                    //    cmsDiv.setStyle("display", "none");
+                    //}
+                }.bind(this)
+            });
+            this.property.load();
+        }else{
+            this.property.show();
+        }
+    },
+    hideProperty: function(){
+        if (this.property) this.property.hide();
+    },
+
+    resetTextNode: function(){
+        var listText = (this.json.selectType=="attribute") ? (this.json.attribute || "") : (this.json.path || "");
+        if (!listText) listText = "unnamed";
+
+        this.textNode.set("text", this.json.displayName);
+        this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
+    },
+    //"delete": function(e){
+    //    var _self = this;
+    //    if (!e) e = this.node;
+    //    this.view.designer.confirm("warn", e, MWF.APPDVD.LP.notice.deleteColumnTitle, MWF.APPDVD.LP.notice.deleteColumn, 300, 120, function(){
+    //        _self.destroy();
+    //
+    //        this.close();
+    //    }, function(){
+    //        this.close();
+    //    }, null);
+    //},
+    //destroy: function(){
+    //    if (this.view.currentSelectedModule==this) this.view.currentSelectedModule = null;
+    //    if (this.actionArea) this.actionArea.destroy();
+    //    if (this.listNode) this.listNode.destroy();
+    //    if (this.property) this.property.propertyContent.destroy();
+    //
+    //    var idx = this.view.items.indexOf(this);
+    //
+    //    if (this.view.viewContentTableNode){
+    //        var trs = this.view.viewContentTableNode.getElements("tr");
+    //        trs.each(function(tr){
+    //            tr.deleteCell(idx);
+    //        }.bind(this));
+    //    }
+    //
+    //    if (this.view.json.data.selectList) this.view.json.data.selectList.erase(this.json);
+    //    if (this.view.json.data.calculate) if (this.view.json.data.calculate.calculateList) this.view.json.data.calculate.calculateList.erase(this.json);
+    //    this.view.items.erase(this);
+    //    if (this.view.property) this.view.property.loadStatColumnSelect();
+    //
+    //    this.areaNode.destroy();
+    //    this.view.selected();
+    //
+    //    this.view.setViewWidth();
+    //
+    //    MWF.release(this);
+    //    delete this;
+    //},
+
+    //move: function(e){
+    //    this._createMoveNode();
+    //
+    //    //this._setNodeMove(columnNodes, e);
+    //},
+    //_createMoveNode: function(){
+    //    this.moveNode = new Element("div", {"text": this.node.get("text")});
+    //    this.moveNode.inject(this.view.designer.content);
+    //    this.moveNode.setStyles({
+    //        "border": "2px dashed #ffa200",
+    //        "opacity": 0.7,
+    //        "height": "30px",
+    //        "line-height": "30px",
+    //        "padding": "0px 10px",
+    //        "position": "absolute"
+    //    });
+    //},
+    //_setMoveNodePosition: function(e){
+    //    var x = e.page.x+2;
+    //    var y = e.page.y+2;
+    //    this.moveNode.positionTo(x, y);
+    //},
+    //createMoveFlagNode: function(){
+    //    this.moveFlagNode = new Element("td", {"styles": this.css.moveFlagNode});
+    //},
+    //_setNodeMove: function(droppables, e){
+    //    this._setMoveNodePosition(e);
+    //    var movePosition = this.moveNode.getPosition();
+    //    var moveSize = this.moveNode.getSize();
+    //    var contentPosition = this.content.getPosition();
+    //    var contentSize = this.content.getSize();
+    //
+    //    var nodeDrag = new Drag.Move(this.moveNode, {
+    //        "droppables": droppables,
+    //        "limit": {
+    //            "x": [contentPosition.x, contentPosition.x+contentSize.x],
+    //            "y": [movePosition.y, movePosition.y+moveSize.y]
+    //        },
+    //        "onEnter": function(dragging, inObj){
+    //            if (!this.moveFlagNode) this.createMoveFlagNode();
+    //            this.moveFlagNode.inject(inObj, "before");
+    //        }.bind(this),
+    //        "onLeave": function(dragging, inObj){
+    //            if (this.moveFlagNode){
+    //                this.moveFlagNode.dispose();
+    //            }
+    //        }.bind(this),
+    //        "onDrop": function(dragging, inObj){
+    //            if (inObj){
+    //                this.areaNode.inject(inObj, "before");
+    //                var column = inObj.retrieve("column");
+    //                this.listNode.inject(column.listNode, "before");
+    //                var idx = this.view.json.data.selectList.indexOf(column.json);
+    //
+    //                this.view.json.data.selectList.erase(this.json);
+    //                this.view.items.erase(this);
+    //
+    //                this.view.json.data.selectList.splice(idx, 0, this.json);
+    //                this.view.items.splice(idx, 0, this);
+    //
+    //                if (this.moveNode) this.moveNode.destroy();
+    //                if (this.moveFlagNode) this.moveFlagNode.destroy();
+    //                this._setActionAreaPosition();
+    //            }else{
+    //                if (this.moveNode) this.moveNode.destroy();
+    //                if (this.moveFlagNode) this.moveFlagNode.destroy();
+    //            }
+    //        }.bind(this),
+    //        "onCancel": function(dragging){
+    //            if (this.moveNode) this.moveNode.destroy();
+    //            if (this.moveFlagNode) this.moveFlagNode.destroy();
+    //        }.bind(this)
+    //    });
+    //    nodeDrag.start(e);
+    //},
+
+    deletePropertiesOrStyles: function(name, key){
+        if (name=="properties"){
+            try{
+                this.node.removeProperty(key);
+            }catch(e){}
+        }
+    },
+    setPropertiesOrStyles: function(name){
+        if (name=="styles"){
+            try{
+                this.setCustomStyles();
+            }catch(e){}
+        }
+        if (name=="properties"){
+            try{
+                this.node.setProperties(this.json.properties);
+            }catch(e){}
+        }
+    },
+    setCustomNodeStyles: function(node, styles){
+        var border = node.getStyle("border");
+        node.clearStyles();
+        //node.setStyles(styles);
+        node.setStyle("border", border);
+
+        Object.each(styles, function(value, key){
+            var reg = /^border\w*/ig;
+            if (!key.test(reg)){
+                node.setStyle(key, value);
+            }
+        }.bind(this));
+    },
+    setCustomStyles: function(){
+        var border = this.node.getStyle("border");
+        this.node.clearStyles();
+        this.node.setStyles(this.css.moduleNode);
+
+        if (this.initialStyles) this.node.setStyles(this.initialStyles);
+        this.node.setStyle("border", border);
+
+        if (this.json.styles) Object.each(this.json.styles, function(value, key){
+            if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+            }
+
+            var reg = /^border\w*/ig;
+            if (!key.test(reg)){
+                if (key){
+                    if (key.toString().toLowerCase()==="display"){
+                        if (value.toString().toLowerCase()==="none"){
+                            this.node.setStyle("opacity", 0.3);
+                        }else{
+                            this.node.setStyle("opacity", 1);
+                            this.node.setStyle(key, value);
+                        }
+                    }else{
+                        this.node.setStyle(key, value);
+                    }
+                }
+            }
+            //this.node.setStyle(key, value);
+        }.bind(this));
+    },
+
+    _setEditStyle: function(name, obj, oldValue){
+        var title = "";
+        var text = "";
+        if (name==="name"){
+            title = this.json.name || this.json.id;
+            text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
+            this.treeNode.setText("<"+text+"> "+title);
+        }
+        if (name==="id"){
+            title = this.json.name || this.json.id;
+            if (!this.json.name){
+                text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
+                this.treeNode.setText("<"+text+"> "+this.json.id);
+            }
+            this.treeNode.setTitle(this.json.id);
+            this.node.set("id", this.json.id);
+        }
+
+        this._setEditStyle_custom(name, obj, oldValue);
+    },
+    reloadMaplist: function(){
+        if (this.property) Object.each(this.property.maplists, function(map, name){ map.reload(this.json[name]);}.bind(this));
+    },
+
+    getHtml: function(){
+        var copy = this.node.clone(true, true);
+        copy.clearStyles(true);
+
+        var html = copy.outerHTML;
+        copy.destroy();
+
+        return html;
+    },
+    getJson: function(){
+        var json = Object.clone(this.json);
+        var o = {};
+        o[json.id] = json;
+        return o;
+    },
+
+
+    _createNode: function(callback){
+        this.node = new Element("div", {
+            "id": this.json.id,
+            "MWFType": "actionbar",
+            "styles": this.css.toolbarWarpNode,
+            "events": {
+                "selectstart": function(e){
+                    e.preventDefault();
+                }
+            }
+
+        }).inject(this.container );
+
+        this.toolbarNode = new Element("div").inject(this.node);
+
+        this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
+        if (!this.json.actionStyles){
+            this.json.actionStyles = Object.clone(this.toolbarWidget.css);
+        }
+
+        //MWF.getJSON(this.path+"toolbars.json", function(json){
+        //    this.json.defaultTools = json;
+        //    this.setToolbars(json, this.toolbarNode);
+        //    debugger;
+        //    this.toolbarWidget.load();
+        //}.bind(this), false);
+        if (this.json.defaultTools){
+            var json = Array.clone(this.json.defaultTools);
+            //if (this.json.tools) json.append(this.json.tools);
+            this.setToolbars(json, this.toolbarNode);
+            if (this.json.tools){
+                this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+            }
+            this.toolbarWidget.load();
+            this._setEditStyle_custom("hideSystemTools");
+            //json = null;
+        }else{
+            MWF.getJSON(this.path+"toolbars.json", function(json){
+                this.json.defaultTools = json;
+                var json = Array.clone(this.json.defaultTools);
+                //if (this.json.tools) json.append(this.json.tools);
+                this.setToolbars(json, this.toolbarNode);
+                if (this.json.tools){
+                    this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+                }
+                this.toolbarWidget.load();
+                this._setEditStyle_custom("hideSystemTools");
+                //json = null;
+            }.bind(this), false);
+        }
+    },
+
+    _refreshActionbar: function(){
+        //if (this.form.options.mode == "Mobile"){
+        //    this.node.set("text", MWF.APPFD.LP.notice.notUseModuleInMobile+"("+this.moduleName+")");
+        //    this.node.setStyles({"height": "24px", "line-height": "24px", "background-color": "#999"});
+        //}else{
+            this.toolbarNode = this.node.getFirst("div");
+            this.toolbarNode.empty();
+            this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
+            if (!this.json.actionStyles) this.json.actionStyles = Object.clone(this.toolbarWidget.css);
+            this.toolbarWidget.css = this.json.actionStyles;
+
+            if (this.json.defaultTools){
+                var json = Array.clone(this.json.defaultTools);
+                //if (this.json.tools) json.append(this.json.tools);
+                this.setToolbars(json, this.toolbarNode);
+                if (this.json.tools){
+                    this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+                }
+                this.toolbarWidget.load();
+                //json = null;
+            }else{
+                MWF.getJSON(this.path+"toolbars.json", function(json){
+                    this.json.defaultTools = json;
+                    var json = Array.clone(this.json.defaultTools);
+                    //if (this.json.tools) json.append(this.json.tools);
+                    this.setToolbars(json, this.toolbarNode);
+                    if (this.json.tools){
+                        this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+                    }
+                    this.toolbarWidget.load();
+                    //json = null;
+                }.bind(this), false);
+            }
+        //}
+
+    },
+    _resetActionbar: function(){
+        //if (this.form.options.mode == "Mobile"){
+        //    this.node.set("text", MWF.APPFD.LP.notice.notUseModuleInMobile+"("+this.moduleName+")");
+        //    this.node.setStyles({"height": "24px", "line-height": "24px", "background-color": "#999"});
+        //}else{
+            this.toolbarNode = this.node.getFirst("div");
+            this.toolbarNode.empty();
+            this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
+            if (!this.json.actionStyles){
+                this.json.actionStyles = Object.clone(this.toolbarWidget.css);
+            }else{
+                this.toolbarWidget.css = Object.merge( Object.clone(this.json.actionStyles), this.toolbarWidget.css );
+                this.json.actionStyles = Object.clone(this.toolbarWidget.css);
+            }
+
+            if (this.json.defaultTools){
+                var json = Array.clone(this.json.defaultTools);
+                //if (this.json.tools) json.append(this.json.tools);
+                this.setToolbars(json, this.toolbarNode);
+                if (this.json.tools){
+                    this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+                }
+                this.toolbarWidget.load();
+                //json = null;
+            }else{
+                MWF.getJSON(this.path+"toolbars.json", function(json){
+                    this.json.defaultTools = json;
+                    var json = Array.clone(this.json.defaultTools);
+                    //if (this.json.tools) json.append(this.json.tools);
+                    this.setToolbars(json, this.toolbarNode);
+                    if (this.json.tools){
+                        this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode);
+                    }
+                    this.toolbarWidget.load();
+                    //json = null;
+                }.bind(this), false);
+            }
+        //}
+    },
+    setToolbars: function(tools, node){
+        tools.each(function(tool){
+            var actionNode = new Element("div", {
+                "MWFnodetype": tool.type,
+                "MWFButtonImage": this.imagePath_default+""+this.options.style+"/actionbar/"+tool.img,
+                "title": tool.title,
+                "MWFButtonAction": tool.action,
+                "MWFButtonText": tool.text
+            }).inject(node);
+            if( this.json.iconOverStyle ){
+                actionNode.set("MWFButtonImageOver" , this.imagePath_default+""+this.options.style+"/actionbar/"+this.json.iconOverStyle+"/"+tool.img );
+            }
+            this.systemTools.push(actionNode);
+            if (tool.sub){
+                var subNode = node.getLast();
+                this.setToolbars(tool.sub, subNode);
+            }
+        }.bind(this));
+    },
+    setCustomToolbars: function(tools, node){
+        //var style = (this.json.style || "default").indexOf("red") > -1 ? "red" : "blue";
+        var path = "";
+        if( this.json.customIconStyle ){
+            path = this.json.customIconStyle+ "/";
+        }
+
+        tools.each(function(tool){
+            var actionNode = new Element("div", {
+                "MWFnodetype": tool.type,
+                "MWFButtonImage": this.imagePath_custom+""+this.options.customImageStyle +"/custom/"+path+tool.img,
+                "title": tool.title,
+                "MWFButtonAction": tool.action,
+                "MWFButtonText": tool.text
+            }).inject(node);
+            if( this.json.customIconOverStyle ){
+                actionNode.set("MWFButtonImageOver" , this.imagePath_custom+""+this.options.customImageStyle +"/custom/"+this.json.customIconOverStyle+ "/" +tool.img );
+            }
+            this.customTools.push(actionNode);
+            if (tool.sub){
+                var subNode = node.getLast();
+                this.setToolbars(tool.sub, subNode);
+            }
+        }.bind(this));
+    },
+    _setEditStyle_custom: function(name){
+        if (name=="hideSystemTools"){
+            if (this.json.hideSystemTools){
+                this.systemTools.each(function(tool){
+                    tool.setStyle("display", "none");
+                });
+            }else{
+                this.systemTools.each(function(tool){
+                    tool.setStyle("display", "block");
+                });
+            }
+        }
+        if (name=="defaultTools" || name=="tools" || name==="actionStyles"){
+            this._refreshActionbar();
+        }
+
+    }
 
 
+});

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

@@ -48,7 +48,28 @@ MWF.xApplication.query.ViewDesigner.LP = {
         "numberKey": "项目名称不能为数字,请重新输入",
         "numberKey": "项目名称不能为数字,请重新输入",
 
 
         "inputName": "请输入视图名称",
         "inputName": "请输入视图名称",
-        "noModifyName": "不能修改名称或者别名"
+        "noModifyName": "不能修改名称或者别名",
+
+        "deleteEventTitle": "删除事件确认",
+        "deleteEvent": "是否确定删除当前事件吗?"
+    },
+    "actionbar": {
+        "readhide": "设置阅读时是否显示",
+        "edithide": "设置编辑时是否显示",
+        "hideCondition": "设置隐藏条件",
+        "title": "标题",
+        "img": "图标",
+        "action": "操作",
+        "condition": "显示条件",
+        "editScript": "操作脚本编辑",
+        "editCondition": "隐藏条件编辑(返回true隐藏操作)",
+        "up" : "上移",
+        "property" : "属性",
+        "addCustomTool" : "添加自定义操作",
+        "delete" : "删除",
+        "setProperties" : "设置操作属性",
+        "restoreDefaultTool" : "恢复删除的系统操作",
+        "selectDefaultTool" : "选择系统操作"
     },
     },
     "mastInputPath": "请输入数据路径",
     "mastInputPath": "请输入数据路径",
     "mastInputTitle": "请输入标题",
     "mastInputTitle": "请输入标题",