Răsfoiți Sursa

Merge branch 'fix/Query.view_error' into 'develop'

Merge of fix/[数据中心]修复设置分类的时候可能造成的问题,修复删除分类列后视图出错的问题 to develop

See merge request o2oa/o2oa!418
蔡祥熠 5 ani în urmă
părinte
comite
81299d60c9

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

@@ -603,6 +603,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                 }
             }.bind(this));
             select.addEvent("change", function(e){
+                debugger;
                 var v = select.options[select.selectedIndex].value;
                 if (v!="none"){
                     var flag = false;
@@ -629,6 +630,7 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
             var group = this.view.data.data.group;
             if (group.column==this.data.column) radios[0].set("checked", true);
             radios.addEvent("click", function(e){
+                debugger;
                 if (this.checked){
                     if (this.value=="true") {
                         _self.view.data.data.group.column = _self.data.column;
@@ -641,6 +643,9 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
                                 });
                             }
                         });
+                        ( _self.view.data.data.selectList ).each(function(s) {
+                            if( s.column !== _self.data.column )s.groupEntry = false;
+                        });
                         this.set("checked", true);
                     }else{
                         if (group.column ==_self.data.column) _self.view.data.data.group = {};

+ 13 - 1
o2web/source/x_component_query_ViewDesigner/View.js

@@ -1303,7 +1303,6 @@ MWF.xApplication.query.ViewDesigner.View.Column = new Class({
         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();
@@ -1324,6 +1323,19 @@ MWF.xApplication.query.ViewDesigner.View.Column = new Class({
             }.bind(this));
         }
 
+        if (this.view.json.data.group.column === this.json.column){
+            this.view.json.data.group.column = null;
+        }
+
+        var sortList = this.view.json.data.orderList || [];
+        var deleteItem = null;
+        sortList.each(function(order){
+            if (order.column==this.json.column){
+                deleteItem = order;
+            }
+        }.bind(this));
+        if (deleteItem) sortList.erase(deleteItem);
+
         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);