Просмотр исходного кода

视图排序列增加转换成数字排序

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

+ 16 - 1
o2web/source/x_component_query_ViewDesigner/$View/column.html

@@ -101,12 +101,27 @@
                 <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>
-                        <td class="editTableValue"><select name="orderType">
+                        <td class="editTableValue"><select name="orderType" onchange="
+                            var node = $(this).getParent('table').getElement('.MWFColumnExportNumberOrder');
+                            if(this.options[this.selectedIndex].value==='none'){
+                                node.hide();
+                                node.getElements('input')[1].click();
+                            }else{
+                                node.setStyle('display','table-row');
+                            }
+                        ">
                             <option value="none" text{(($.orderType)!='asc' && ($.orderType)!='desc') ?'selected':''}>无</option>
                             <option value="none" text{(($.orderType)!='asc' && ($.orderType)!='desc') ?'selected':''}>无</option>
                             <option value="asc" text{($.orderType)=='asc' ?'selected':''}>升序</option>
                             <option value="asc" text{($.orderType)=='asc' ?'selected':''}>升序</option>
                             <option value="desc" text{($.orderType)=='desc' ?'selected':''}>降序</option>
                             <option value="desc" text{($.orderType)=='desc' ?'selected':''}>降序</option>
                         </select></td>
                         </select></td>
                     </tr>
                     </tr>
+                    <tr class="MWFColumnExportNumberOrder" style="display: text{(($.orderType)!='asc' && ($.orderType)!='desc') ?'none':'table-row'}">
+                        <td class="editTableTitle">转换成数字排序:</td>
+                        <td class="editTableValue">
+                            <input class="MWFWorkDataCheck" name="numberOrder" type="radio" value="true" text{($.numberOrder)===true?'checked':''}/>是
+                            <input class="MWFWorkDataCheck" name="numberOrder" type="radio" value="false" text{($.numberOrder)!==true?'checked':''}/>否
+                        </td>
+                    </tr>
                     <tr class="MWFColumnExportGroup">
                     <tr class="MWFColumnExportGroup">
                         <td class="editTableTitle">分类:</td>
                         <td class="editTableTitle">分类:</td>
                         <td class="editTableValue">
                         <td class="editTableValue">

+ 158 - 159
o2web/source/x_component_query_ViewDesigner/Property.js

@@ -1,38 +1,38 @@
 MWF.require("MWF.widget.Common", null, false);
 MWF.require("MWF.widget.Common", null, false);
 MWF.require("MWF.widget.JsonTemplate", null, false);
 MWF.require("MWF.widget.JsonTemplate", null, false);
 MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
 MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
-	Extends: MWF.widget.Common,
-	Implements: [Options, Events],
-	options: {
-		"style": "default",
-		"path": "../x_component_query_FormDesigner/property/property.html"
-	},
-	
-	initialize: function(module, propertyNode, designer, options){
-		this.setOptions(options);
-		this.module = module;
-		this.view = module.view;
-		this.data = module.json;
+    Extends: MWF.widget.Common,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "path": "../x_component_query_FormDesigner/property/property.html"
+    },
+
+    initialize: function(module, propertyNode, designer, options){
+        this.setOptions(options);
+        this.module = module;
+        this.view = module.view;
+        this.data = module.json;
         this.data.vid = this.view.json.id;
         this.data.vid = this.view.json.id;
         this.data.vtype = this.view.json.type;
         this.data.vtype = this.view.json.type;
-		this.data.pid = this.view.json.id+this.data.id;
-		this.htmlPath = this.options.path;
-		this.designer = designer;
-		
-		this.propertyNode = propertyNode;
-	},
-
-	load: function(){
-		if (this.fireEvent("queryLoad")){
-			MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
-				this.htmlString = responseText;
+        this.data.pid = this.view.json.id+this.data.id;
+        this.htmlPath = this.options.path;
+        this.designer = designer;
+
+        this.propertyNode = propertyNode;
+    },
+
+    load: function(){
+        if (this.fireEvent("queryLoad")){
+            MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
+                this.htmlString = responseText;
                 this.fireEvent("postLoad");
                 this.fireEvent("postLoad");
-			}.bind(this));
-		}
+            }.bind(this));
+        }
         this.propertyNode.addEvent("keydown", function(e){e.stopPropagation();});
         this.propertyNode.addEvent("keydown", function(e){e.stopPropagation();});
-	},
-	editProperty: function(td){
-	},
+    },
+    editProperty: function(td){
+    },
     getHtmlString: function(callback){
     getHtmlString: function(callback){
         if (!this.htmlString){
         if (!this.htmlString){
             MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
             MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
@@ -43,7 +43,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             if (callback) callback();
             if (callback) callback();
         }
         }
     },
     },
-	show: function(){
+    show: function(){
         if (!this.propertyContent){
         if (!this.propertyContent){
             this.getHtmlString(function(){
             this.getHtmlString(function(){
                 if (this.htmlString){
                 if (this.htmlString){
@@ -75,17 +75,17 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             this.propertyContent.setStyle("display", "block");
             this.propertyContent.setStyle("display", "block");
         }
         }
 
 
-		
 
 
-	},
-	hide: function(){
-		//this.JsonTemplate = null;
-		//this.propertyNode.set("html", "");
+
+    },
+    hide: function(){
+        //this.JsonTemplate = null;
+        //this.propertyNode.set("html", "");
         if (this.propertyContent) this.propertyContent.setStyle("display", "none");
         if (this.propertyContent) this.propertyContent.setStyle("display", "none");
-	},
+    },
 
 
-	loadJSONArea: function(){
-		var jsonNode = this.propertyContent.getElement(".MWFJSONArea");
+    loadJSONArea: function(){
+        var jsonNode = this.propertyContent.getElement(".MWFJSONArea");
 
 
         if (jsonNode){
         if (jsonNode){
             this.propertyTab.pages.each(function(page){
             this.propertyTab.pages.each(function(page){
@@ -102,39 +102,39 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                 }
                 }
             }.bind(this));
             }.bind(this));
         }
         }
-	},
-	loadPropertyTab: function(){
-		var tabNodes = this.propertyContent.getElements(".MWFTab");
-		if (tabNodes.length){
-			var tmpNode = this.propertyContent.getFirst();
-			var tabAreaNode = new Element("div", {
-				"styles": this.view.css.propertyTabNode
-			}).inject(tmpNode, "before");
-			
-			MWF.require("MWF.widget.Tab", function(){
-				var tab = new MWF.widget.Tab(tabAreaNode, {"style": "formPropertyList"});
-				tab.load();
-				var tabPages = [];
-				tabNodes.each(function(node){
-					var page = tab.addTab(node, node.get("title"), false);
-					tabPages.push(page);
-					this.setScrollBar(page.contentNodeArea, "small", null, null);
-				}.bind(this));
-				tabPages[0].showTab();
-				
-				this.propertyTab = tab;
-				
-				this.designer.resizeNode();
-			}.bind(this), false);
-		}
-	},
-	
-	setEditNodeEvent: function(){
-		var property = this;
-	//	var inputs = this.process.propertyListNode.getElements(".editTableInput");
-		var inputs = this.propertyContent.getElements("input");
-		inputs.each(function(input){
-			var jsondata = input.get("name");
+    },
+    loadPropertyTab: function(){
+        var tabNodes = this.propertyContent.getElements(".MWFTab");
+        if (tabNodes.length){
+            var tmpNode = this.propertyContent.getFirst();
+            var tabAreaNode = new Element("div", {
+                "styles": this.view.css.propertyTabNode
+            }).inject(tmpNode, "before");
+
+            MWF.require("MWF.widget.Tab", function(){
+                var tab = new MWF.widget.Tab(tabAreaNode, {"style": "formPropertyList"});
+                tab.load();
+                var tabPages = [];
+                tabNodes.each(function(node){
+                    var page = tab.addTab(node, node.get("title"), false);
+                    tabPages.push(page);
+                    this.setScrollBar(page.contentNodeArea, "small", null, null);
+                }.bind(this));
+                tabPages[0].showTab();
+
+                this.propertyTab = tab;
+
+                this.designer.resizeNode();
+            }.bind(this), false);
+        }
+    },
+
+    setEditNodeEvent: function(){
+        var property = this;
+        //	var inputs = this.process.propertyListNode.getElements(".editTableInput");
+        var inputs = this.propertyContent.getElements("input");
+        inputs.each(function(input){
+            var jsondata = input.get("name");
             if (jsondata && jsondata.substr(0,1)!="_"){
             if (jsondata && jsondata.substr(0,1)!="_"){
                 if (this.module){
                 if (this.module){
                     var id = this.module.json.id;
                     var id = this.module.json.id;
@@ -187,36 +187,36 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                     }
                     }
                 }
                 }
             }
             }
-		}.bind(this));
-		
-		var selects = this.propertyContent.getElements("select");
-		selects.each(function(select){
-			var jsondata = select.get("name");
-			if (jsondata){
-				select.addEvent("change", function(e){
-					property.setSelectValue(jsondata, this);
-				});
+        }.bind(this));
+
+        var selects = this.propertyContent.getElements("select");
+        selects.each(function(select){
+            var jsondata = select.get("name");
+            if (jsondata){
+                select.addEvent("change", function(e){
+                    property.setSelectValue(jsondata, this);
+                });
                 //property.setSelectValue(jsondata, select);
                 //property.setSelectValue(jsondata, select);
-			}
-		});
-		
-		var textareas = this.propertyContent.getElements("textarea");
-		textareas.each(function(input){
-			var jsondata = input.get("name");
-			if (jsondata){
-				input.addEvent("change", function(e){
-					property.setValue(jsondata, this.value);
-				});
-				input.addEvent("blur", function(e){
-					property.setValue(jsondata, this.value);
-				});
+            }
+        });
+
+        var textareas = this.propertyContent.getElements("textarea");
+        textareas.each(function(input){
+            var jsondata = input.get("name");
+            if (jsondata){
+                input.addEvent("change", function(e){
+                    property.setValue(jsondata, this.value);
+                });
+                input.addEvent("blur", function(e){
+                    property.setValue(jsondata, this.value);
+                });
                 input.addEvent("keydown", function(e){
                 input.addEvent("keydown", function(e){
                     e.stopPropagation();
                     e.stopPropagation();
                 });
                 });
-			}
-		}.bind(this));
-		
-	},
+            }
+        }.bind(this));
+
+    },
     loadCalendar: function(node, jsondata){
     loadCalendar: function(node, jsondata){
         MWF.require("MWF.widget.Calendar", function(){
         MWF.require("MWF.widget.Calendar", function(){
             this.calendar = new MWF.widget.Calendar(node, {
             this.calendar = new MWF.widget.Calendar(node, {
@@ -252,14 +252,14 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
         }.bind(this));
         }.bind(this));
         o[key[len]] = value;
         o[key[len]] = value;
     },
     },
-	setRadioValue: function(name, input){
-		if (input.checked){
+    setRadioValue: function(name, input){
+        if (input.checked){
             var i = name.indexOf("*");
             var i = name.indexOf("*");
             var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
             var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
 
 
             var value = input.value;
             var value = input.value;
-			if (value=="false") value = false;
-			if (value=="true") value = true;
+            if (value=="false") value = false;
+            if (value=="true") value = true;
 
 
             var oldValue = this.data;
             var oldValue = this.data;
             for (var idx = 0; idx<names.length; idx++){
             for (var idx = 0; idx<names.length; idx++){
@@ -271,32 +271,32 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                 }
                 }
             }
             }
 
 
-			//var oldValue = this.data[name];
-			this.changeJsonDate(names, value);
+            //var oldValue = this.data[name];
+            this.changeJsonDate(names, value);
             this.changeData(name, input, oldValue);
             this.changeData(name, input, oldValue);
-		}
-	},
-	setCheckboxValue: function(name, input){
+        }
+    },
+    setCheckboxValue: function(name, input){
         var id = this.module.json.id;
         var id = this.module.json.id;
         var checkboxList = $$("input[name='"+id+name+"']");
         var checkboxList = $$("input[name='"+id+name+"']");
-		var values = [];
-		checkboxList.each(function(checkbox){
-			if (checkbox.get("checked")){
-				values.push(checkbox.value);
-			}
-		});
-		var oldValue = this.data[name];
-		//this.data[name] = values;
+        var values = [];
+        checkboxList.each(function(checkbox){
+            if (checkbox.get("checked")){
+                values.push(checkbox.value);
+            }
+        });
+        var oldValue = this.data[name];
+        //this.data[name] = values;
         this.changeJsonDate(name, values);
         this.changeJsonDate(name, values);
         this.changeData(name, input, oldValue);
         this.changeData(name, input, oldValue);
-	},
-	setSelectValue: function(name, select){
-		var idx = select.selectedIndex;
-		var options = select.getElements("option");
-		var value = "";
-		if (options[idx]){
-			value = options[idx].get("value");
-		}
+    },
+    setSelectValue: function(name, select){
+        var idx = select.selectedIndex;
+        var options = select.getElements("option");
+        var value = "";
+        if (options[idx]){
+            value = options[idx].get("value");
+        }
 
 
         var i = name.indexOf("*");
         var i = name.indexOf("*");
         var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
         var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
@@ -312,13 +312,13 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             }
             }
         }
         }
 
 
-		//var oldValue = this.data[name];
-		//this.data[name] = value;
+        //var oldValue = this.data[name];
+        //this.data[name] = value;
         this.changeJsonDate(names, value);
         this.changeJsonDate(names, value);
         this.changeData(name, select, oldValue);
         this.changeData(name, select, oldValue);
-	},
-	
-	setValue: function(name, value, obj){
+    },
+
+    setValue: function(name, value, obj){
         var names = name.split(".");
         var names = name.split(".");
         var oldValue = this.data;
         var oldValue = this.data;
         for (var idx = 0; idx<names.length; idx++){
         for (var idx = 0; idx<names.length; idx++){
@@ -330,23 +330,23 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             }
             }
         }
         }
 
 
-		//var oldValue = this.data[name];
-		//this.data[name] = value;
+        //var oldValue = this.data[name];
+        //this.data[name] = value;
         this.changeJsonDate(names, value);
         this.changeJsonDate(names, value);
         this.changeData(name, obj, oldValue);
         this.changeData(name, obj, oldValue);
-	},
-	setEditNodeStyles: function(node){
-		var nodes = node.getChildren();
-		if (nodes.length){
-			nodes.each(function(el){
-				var cName = el.get("class");
-				if (cName){
-					if (this.view.css[cName]) el.setStyles(this.view.css[cName]);
-				}
-				this.setEditNodeStyles(el);
-			}.bind(this));
-		}
-	},
+    },
+    setEditNodeStyles: function(node){
+        var nodes = node.getChildren();
+        if (nodes.length){
+            nodes.each(function(el){
+                var cName = el.get("class");
+                if (cName){
+                    if (this.view.css[cName]) el.setStyles(this.view.css[cName]);
+                }
+                this.setEditNodeStyles(el);
+            }.bind(this));
+        }
+    },
     loadScriptArea: function(){
     loadScriptArea: function(){
         var scriptAreas = this.propertyContent.getElements(".MWFScriptArea");
         var scriptAreas = this.propertyContent.getElements(".MWFScriptArea");
         var formulaAreas = this.propertyContent.getElements(".MWFFormulaArea");
         var formulaAreas = this.propertyContent.getElements(".MWFFormulaArea");
@@ -638,11 +638,10 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                 }
                 }
             }.bind(this));
             }.bind(this));
 
 
-            var radios = node.getElements("input");
+            var radios = node.getElements("input[name='"+this.module.json.id+"groupEntry']");
             var group = this.view.data.data.group;
             var group = this.view.data.data.group;
             if (group.column==this.data.column) radios[0].set("checked", true);
             if (group.column==this.data.column) radios[0].set("checked", true);
             radios.addEvent("click", function(e){
             radios.addEvent("click", function(e){
-                debugger;
                 if (this.checked){
                 if (this.checked){
                     if (this.value=="true") {
                     if (this.value=="true") {
                         _self.view.data.data.group.column = _self.data.column;
                         _self.view.data.data.group.column = _self.data.column;
@@ -931,11 +930,11 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                 // var mode = ( this.form.options.mode || "" ).toLowerCase() === "mobile" ? "mobile" : "pc";
                 // var mode = ( this.form.options.mode || "" ).toLowerCase() === "mobile" ? "mobile" : "pc";
                 Object.each(this.module.stylesList, function(s, key){
                 Object.each(this.module.stylesList, function(s, key){
                     // if( s.mode.contains( mode ) ){
                     // 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)
+                    new Element("option", {
+                        "text": s.name,
+                        "value": key,
+                        "selected": ((!this.data.data.viewStyleType && key=="default") || (this.data.data.viewStyleType==key))
+                    }).inject(node)
                     // }
                     // }
                 }.bind(this));
                 }.bind(this));
             }else{
             }else{
@@ -1250,26 +1249,26 @@ MWF.xApplication.query.ViewDesigner.Property.Filter = new Class({
         switch (this.property.data.type){
         switch (this.property.data.type){
             case "text":
             case "text":
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
-                "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
-                "<option value='@' "+((this.data.comparison=="@") ? "selected": "")+">包含(@)</option>";
+                    "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
+                    "<option value='@' "+((this.data.comparison=="@") ? "selected": "")+">包含(@)</option>";
                 break;
                 break;
             case "date":
             case "date":
                 html += "<option value=''></option><option value='&gt;' "+((this.data.comparison==">") ? "selected": "")+">大于(&gt;)</option>" +
                 html += "<option value=''></option><option value='&gt;' "+((this.data.comparison==">") ? "selected": "")+">大于(&gt;)</option>" +
-                "<option value='&lt;' "+((this.data.comparison=="<") ? "selected": "")+">小于(&lt;)</option>" +
-                "<option value='&gt;=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(&gt;=)</option>" +
-                "<option value='&lt;=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(&lt;=)</option>";
+                    "<option value='&lt;' "+((this.data.comparison=="<") ? "selected": "")+">小于(&lt;)</option>" +
+                    "<option value='&gt;=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(&gt;=)</option>" +
+                    "<option value='&lt;=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(&lt;=)</option>";
                 break;
                 break;
             case "number":
             case "number":
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
-                "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
-                "<option value='&gt;' "+((this.data.comparison==">") ? "selected": "")+">大于(&gt;)</option>" +
-                "<option value='&lt;' "+((this.data.comparison=="<") ? "selected": "")+">小于(&lt;)</option>" +
-                "<option value='&gt;=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(&gt;=)</option>" +
-                "<option value='&lt;=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(&lt;=)</option>";
+                    "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>" +
+                    "<option value='&gt;' "+((this.data.comparison==">") ? "selected": "")+">大于(&gt;)</option>" +
+                    "<option value='&lt;' "+((this.data.comparison=="<") ? "selected": "")+">小于(&lt;)</option>" +
+                    "<option value='&gt;=' "+((this.data.comparison==">=") ? "selected": "")+">大于等于(&gt;=)</option>" +
+                    "<option value='&lt;=' "+((this.data.comparison=="<=") ? "selected": "")+">小于等于(&lt;=)</option>";
                 break;
                 break;
             case "boolean":
             case "boolean":
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
                 html += "<option value=''></option><option value='==' "+((this.data.comparison=="==") ? "selected": "")+">等于(==)</option>" +
-                "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>";
+                    "<option value='!=' "+((this.data.comparison=="!=") ? "selected": "")+">不等于(!=)</option>";
                 break;
                 break;
         }
         }
         comparisonSelect.set("html", html);
         comparisonSelect.set("html", html);