diff --git a/o2web/source/x_component_query_StatementDesigner/$Statement/toolbars.json b/o2web/source/x_component_query_StatementDesigner/$Statement/toolbars.json new file mode 100644 index 0000000000000000000000000000000000000000..0637a088a01e8ddab3bf3fa98dbe804cbde1a0dc --- /dev/null +++ b/o2web/source/x_component_query_StatementDesigner/$Statement/toolbars.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/o2web/source/x_component_query_StatementDesigner/$Statement/view.json b/o2web/source/x_component_query_StatementDesigner/$Statement/view.json index fdf29e3f67497617c26035f63ee84f2a92631fb6..219f5b0eb0dec0381aca2aea0cb3b398b1442a9a 100644 --- a/o2web/source/x_component_query_StatementDesigner/$Statement/view.json +++ b/o2web/source/x_component_query_StatementDesigner/$Statement/view.json @@ -20,6 +20,7 @@ "afterGridScriptText": "", "afterGroupGridScriptText": "", "afterCalculateGridScriptText": "", + "actionbarHidden" : true, "events": { "queryLoad" : { "code": "", diff --git a/o2web/source/x_component_query_StatementDesigner/Statement.js b/o2web/source/x_component_query_StatementDesigner/Statement.js index 549ecce3e03fe196d71c7ed7b0ad1bd4dc3e7dea..8310598a92b838a1278066598110e297bd7822a3 100644 --- a/o2web/source/x_component_query_StatementDesigner/Statement.js +++ b/o2web/source/x_component_query_StatementDesigner/Statement.js @@ -85,8 +85,27 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({ }.bind(this)); 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(); }, + unSelected: function(){ + this.currentSelectedModule = null; + this.isSelected = false; + this.hideProperty(); + }, showProperty: function(){ if (!this.property){ 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(); } }, + hideProperty: function(){ + if (this.property) this.property.hide(); + }, loadStatement: function(){ //this.statementDesignerNode = new Element("div", {"styles": this.css.statementDesignerNode}).inject(this.areaNode); this.loadStatementHtml(function(){ @@ -291,6 +313,10 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({ // }.bind(this), false); // }, setEvent: function(){ + this.designerArea.addEvent("click", function (e) { + this.selected(); + e.stopPropagation(); + }.bind(this)); this.formatTypeArea.getElements("input").addEvent("click", function(e){ if (e.target.checked){ var v = e.target.get("value"); @@ -549,7 +575,8 @@ MWF.xApplication.query.StatementDesigner.View = new Class({ this.node = this.statement.viewArea; //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(){ // new MWF.widget.ScrollBar(this.areaNode, {"distance": 100}); @@ -587,7 +614,7 @@ MWF.xApplication.query.StatementDesigner.View = new Class({ this.loadPaging(); - this.selected(); + // this.selected(); this.setEvent(); //if (this.options.showTab) this.page.showTabIm(); @@ -614,6 +641,41 @@ MWF.xApplication.query.StatementDesigner.View = new Class({ },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(){ if (!this.property){ @@ -856,10 +918,6 @@ MWF.xApplication.query.StatementDesigner.View = new Class({ }.bind(this)); //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight(); }, - unSelected: function(){ - this.currentSelectedModule = null; - this.hideProperty(); - }, loadViewColumns: function(){ // for (var i=0; i<10; i++){ if (this.json.data.selectList) { @@ -1099,13 +1157,97 @@ MWF.xApplication.query.StatementDesigner.View = 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({ - 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({ - 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(); + } }); \ No newline at end of file diff --git a/o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss b/o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss index 1aef1aa33ce63b82c33bf5292f65bd9545d877ed..81c513acd81b23a22c61acf5c2dd221005cbb23c 100644 --- a/o2web/source/x_component_query_ViewDesigner/$View/default/css.wcss +++ b/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" : { "overflow": "hidden" }, diff --git a/o2web/source/x_component_query_ViewDesigner/View.js b/o2web/source/x_component_query_ViewDesigner/View.js index d014cf20056841a160f46388451d5dd16c02f29b..ac45fd7a04101a72ba900336c36b47392b613282 100644 --- a/o2web/source/x_component_query_ViewDesigner/View.js +++ b/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.listNode.getLast().set("text", this.json.displayName+"("+listText+")"); }, - + getJsonPath : function(){ + return this.path+"toolbars.json"; + }, _createNode: function(callback){ this.node = new Element("div", { "id": this.json.id, @@ -1898,7 +1900,7 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({ this._setEditStyle_custom("hideSystemTools"); //json = null; }else{ - MWF.getJSON(this.path+"toolbars.json", function(json){ + MWF.getJSON( this.getJsonPath(), function(json){ this.json.defaultTools = json; var json = Array.clone(this.json.defaultTools); //if (this.json.tools) json.append(this.json.tools);