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

+ 1 - 0
o2web/source/x_component_query_StatementDesigner/$Statement/toolbars.json

@@ -0,0 +1 @@
+[]

+ 1 - 0
o2web/source/x_component_query_StatementDesigner/$Statement/view.json

@@ -20,6 +20,7 @@
     "afterGridScriptText": "",
     "afterGridScriptText": "",
     "afterGroupGridScriptText": "",
     "afterGroupGridScriptText": "",
     "afterCalculateGridScriptText": "",
     "afterCalculateGridScriptText": "",
+    "actionbarHidden" : true,
     "events": {
     "events": {
       "queryLoad" : {
       "queryLoad" : {
         "code": "",
         "code": "",

+ 151 - 9
o2web/source/x_component_query_StatementDesigner/Statement.js

@@ -85,8 +85,27 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
         }.bind(this));
         }.bind(this));
 
 
         this.loadStatement();
         this.loadStatement();
+        // this.showProperty();
+        this.selected();
+    },
+    selected: function(){
+        if (this.currentSelectedModule){
+            if (this.currentSelectedModule==this){
+                return true;
+            }else{
+                this.currentSelectedModule.unSelected();
+            }
+        }
+
+        this.currentSelectedModule = this;
+        this.isSelected = true;
         this.showProperty();
         this.showProperty();
     },
     },
+    unSelected: function(){
+        this.currentSelectedModule = null;
+        this.isSelected = false;
+        this.hideProperty();
+    },
     showProperty: function(){
     showProperty: function(){
         if (!this.property){
         if (!this.property){
             this.property = new MWF.xApplication.query.StatementDesigner.Property(this, this.designer.designerContentArea, this.designer, {
             this.property = new MWF.xApplication.query.StatementDesigner.Property(this, this.designer.designerContentArea, this.designer, {
@@ -100,6 +119,9 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             this.property.show();
             this.property.show();
         }
         }
     },
     },
+    hideProperty: function(){
+        if (this.property) this.property.hide();
+    },
     loadStatement: function(){
     loadStatement: function(){
         //this.statementDesignerNode = new Element("div", {"styles": this.css.statementDesignerNode}).inject(this.areaNode);
         //this.statementDesignerNode = new Element("div", {"styles": this.css.statementDesignerNode}).inject(this.areaNode);
         this.loadStatementHtml(function(){
         this.loadStatementHtml(function(){
@@ -291,6 +313,10 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
     //     }.bind(this), false);
     //     }.bind(this), false);
     // },
     // },
     setEvent: function(){
     setEvent: function(){
+        this.designerArea.addEvent("click", function (e) {
+            this.selected();
+            e.stopPropagation();
+        }.bind(this));
         this.formatTypeArea.getElements("input").addEvent("click", function(e){
         this.formatTypeArea.getElements("input").addEvent("click", function(e){
             if (e.target.checked){
             if (e.target.checked){
                 var v = e.target.get("value");
                 var v = e.target.get("value");
@@ -549,7 +575,8 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
         this.node = this.statement.viewArea;
         this.node = this.statement.viewArea;
         //this.tab = this.designer.tab;
         //this.tab = this.designer.tab;
 
 
-        this.areaNode = new Element("div", {"styles": {"height": "100%", "overflow": "auto"}});
+        this.areaNode = new Element("div", {"styles": {"height": "calc(100% - 10px)", "overflow": "auto", "width" : "calc(100% - 10px)" }});
+        this.areaNode.setStyles(this.css.areaNode);
 
 
         //MWF.require("MWF.widget.ScrollBar", function(){
         //MWF.require("MWF.widget.ScrollBar", function(){
         //    new MWF.widget.ScrollBar(this.areaNode, {"distance": 100});
         //    new MWF.widget.ScrollBar(this.areaNode, {"distance": 100});
@@ -587,7 +614,7 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
 
 
             this.loadPaging();
             this.loadPaging();
 
 
-            this.selected();
+            // this.selected();
             this.setEvent();
             this.setEvent();
 
 
             //if (this.options.showTab) this.page.showTabIm();
             //if (this.options.showTab) this.page.showTabIm();
@@ -614,6 +641,41 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
             },false);
             },false);
         }
         }
     },
     },
+    setEvent: function(){
+        this.areaNode.addEvents({
+            "click": function(e){ this.selected();  e.stopPropagation(); }.bind(this),
+            "mouseover": function(){ if (!this.isSelected) this.areaNode.setStyles(this.css.areaNode_over)}.bind(this),
+            "mouseout": function(){if (!this.isSelected) this.areaNode.setStyles(this.css.areaNode)}.bind(this)
+        });
+        this.refreshNode.addEvent("click", function(e){
+            this.loadViewData();
+            e.stopPropagation();
+        }.bind(this));
+        this.addColumnNode.addEvent("click", function(e){
+            this.addColumn();
+            e.stopPropagation();
+        }.bind(this));
+    },
+    selected: function(){
+        debugger;
+        if (this.statement.currentSelectedModule){
+            if (this.statement.currentSelectedModule==this){
+                return true;
+            }else{
+                this.statement.currentSelectedModule.unSelected();
+            }
+        }
+        this.areaNode.setStyles(this.css.areaNode_selected);
+        this.statement.currentSelectedModule = this;
+        this.isSelected = true;
+        this.showProperty();
+    },
+    unSelected: function(){
+        this.statement.currentSelectedModule = null;
+        this.isSelected = false;
+        this.areaNode.setStyles(this.css.areaNode);
+        this.hideProperty();
+    },
 
 
     showProperty: function(){
     showProperty: function(){
         if (!this.property){
         if (!this.property){
@@ -856,10 +918,6 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
         }.bind(this));
         }.bind(this));
         //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
         //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
     },
     },
-    unSelected: function(){
-        this.currentSelectedModule = null;
-        this.hideProperty();
-    },
     loadViewColumns: function(){
     loadViewColumns: function(){
         //    for (var i=0; i<10; i++){
         //    for (var i=0; i<10; i++){
         if (this.json.data.selectList) {
         if (this.json.data.selectList) {
@@ -1099,13 +1157,97 @@ MWF.xApplication.query.StatementDesigner.View = new Class({
 });
 });
 
 
 MWF.xApplication.query.StatementDesigner.View.Column = new Class({
 MWF.xApplication.query.StatementDesigner.View.Column = new Class({
-    Extends: MWF.xApplication.query.ViewDesigner.View.Column
+    Extends: MWF.xApplication.query.ViewDesigner.View.Column,
+    selected: function(){
+        if (this.view.statement.currentSelectedModule){
+            if (this.view.statement.currentSelectedModule==this){
+                return true;
+            }else{
+                this.view.statement.currentSelectedModule.unSelected();
+            }
+        }
+        this.node.setStyles(this.css.viewTitleColumnNode_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.statement.currentSelectedModule = this;
+        this.isSelected = true;
+        this._showActions();
+        this.showProperty();
+    },
+    unSelected: function(){
+        this.view.statement.currentSelectedModule = null;
+        //this.node.setStyles(this.css.viewTitleColumnNode);
+        if (this.isError){
+            this.node.setStyles(this.css.viewTitleColumnNode_error)
+        }else{
+            this.node.setStyles(this.css.viewTitleColumnNode)
+        }
+
+        this.listNode.setStyles(this.css.cloumnListNode);
+        this.isSelected = false;
+        this._hideActions();
+        this.hideProperty();
+    }
 });
 });
 
 
 MWF.xApplication.query.StatementDesigner.View.Actionbar = new Class({
 MWF.xApplication.query.StatementDesigner.View.Actionbar = new Class({
-    Extends: MWF.xApplication.query.ViewDesigner.View.Actionbar
+    Extends: MWF.xApplication.query.ViewDesigner.View.Actionbar,
+    getJsonPath : function(){
+        return "../x_component_query_StatementDesigner/$statement/toolbars.json";
+    },
+    selected: function(){
+        if (this.view.statement.currentSelectedModule){
+            if (this.view.statement.currentSelectedModule==this){
+                return true;
+            }else{
+                this.view.statement.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.statement.currentSelectedModule = this;
+        this.isSelected = true;
+        //this._showActions();
+        this.showProperty();
+    },
+    unSelected: function(){
+        this.view.statement.currentSelectedModule = null;
+        this.node.setStyles(this.css.toolbarWarpNode)
+
+        //this.listNode.setStyles(this.css.cloumnListNode);
+        this.isSelected = false;
+        //this._hideActions();
+        this.hideProperty();
+    },
 });
 });
 
 
 MWF.xApplication.query.StatementDesigner.View.Paging = new Class({
 MWF.xApplication.query.StatementDesigner.View.Paging = new Class({
-    Extends: MWF.xApplication.query.ViewDesigner.View.Paging
+    Extends: MWF.xApplication.query.ViewDesigner.View.Paging,
+    selected: function(){
+        if (this.view.statement.currentSelectedModule){
+            if (this.view.statement.currentSelectedModule==this){
+                return true;
+            }else{
+                this.view.statement.currentSelectedModule.unSelected();
+            }
+        }
+        this.node.setStyles(this.css.pagingWarpNode_selected);
+        new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 100}).toElementEdge(this.node);
+
+        this.view.statement.currentSelectedModule = this;
+        this.isSelected = true;
+        this.showProperty();
+    },
+    unSelected: function(){
+        this.view.statement.currentSelectedModule = null;
+        this.node.setStyles(this.css.pagingWarpNode);
+
+        this.isSelected = false;
+        this.hideProperty();
+    }
 });
 });

+ 10 - 0
o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss

@@ -1,4 +1,14 @@
 {
 {
+
+    "areaNode" : {
+        "border": "1px solid #fff"
+    },
+    "areaNode_selected": {
+        "border": "1px solid red"
+    },
+    "areaNode_over": {
+        "border": "1px dotted blue"
+    },
     "actionbarNode" : {
     "actionbarNode" : {
         "overflow": "hidden"
         "overflow": "hidden"
     },
     },

+ 4 - 2
o2web/source/x_component_query_ViewDesigner/View.js

@@ -1858,7 +1858,9 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
         this.textNode.set("text", this.json.displayName);
         this.textNode.set("text", this.json.displayName);
         this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
         this.listNode.getLast().set("text", this.json.displayName+"("+listText+")");
     },
     },
-
+    getJsonPath : function(){
+        return this.path+"toolbars.json";
+    },
     _createNode: function(callback){
     _createNode: function(callback){
         this.node = new Element("div", {
         this.node = new Element("div", {
             "id": this.json.id,
             "id": this.json.id,
@@ -1898,7 +1900,7 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
             this._setEditStyle_custom("hideSystemTools");
             this._setEditStyle_custom("hideSystemTools");
             //json = null;
             //json = null;
         }else{
         }else{
-            MWF.getJSON(this.path+"toolbars.json", function(json){
+            MWF.getJSON( this.getJsonPath(), function(json){
                 this.json.defaultTools = json;
                 this.json.defaultTools = json;
                 var json = Array.clone(this.json.defaultTools);
                 var json = Array.clone(this.json.defaultTools);
                 //if (this.json.tools) json.append(this.json.tools);
                 //if (this.json.tools) json.append(this.json.tools);