Răsfoiți Sursa

修复流程意见分类内无排序的问题

unknown 5 ani în urmă
părinte
comite
9214ec8c31
1 a modificat fișierele cu 20 adăugiri și 8 ștergeri
  1. 20 8
      o2web/source/x_component_process_Xform/Log.js

+ 20 - 8
o2web/source/x_component_process_Xform/Log.js

@@ -185,25 +185,31 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class(
                         if (this.isNumber(value1) && this.isNumber(value2)) {
                             if (parseFloat(value1) !== parseFloat(value2)) {
                                 return parseFloat(value1) - parseFloat(value2);
+                            }else{
+                                if( this.json.sortTypeInCategory === "none" ){
+                                    return 0;
+                                }else{
+                                    return Date.parse(a.recordTime) - Date.parse(b.recordTime);
+                                }
                             }
                         } else if (!this.isNumber(value1) && !this.isNumber(value2)) {
                             if( this.json.sortTypeInCategory === "none" ){
-                                return -1;
+                                return 0;
                             }else{
-                                return Date.parse(a.fromTime) - Date.parse(b.fromTime);
+                                return Date.parse(a.recordTime) - Date.parse(b.recordTime);
                             }
                         } else {
                             return this.isNumber(value1) ? -1 : 1;
                         }
                     }
-                    return Date.parse(a.fromTime) - Date.parse(b.fromTime);
+                    return Date.parse(a.recordTime) - Date.parse(b.recordTime);
                 }else if( a.properties.fromOpinionGroup || b.properties.fromOpinionGroup ){
                     return a.properties.fromOpinionGroup ? -1 : 1;
                 }else{
                     if( this.json.sortTypeInCategory === "none" ){
-                        return -1;
+                        return 0;
                     }else{
-                        return Date.parse(a.fromTime) - Date.parse(b.fromTime);
+                        return Date.parse(a.recordTime) - Date.parse(b.recordTime);
                     }
                 }
             }.bind(this))
@@ -800,10 +806,16 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class(
                       if (this.isNumber(value1) && this.isNumber(value2)) {
                           if (parseFloat(value1) !== parseFloat(value2)) {
                               return parseFloat(value1) - parseFloat(value2);
-                          }
+                          }else{
+                                if( this.json.sortTypeInCategory === "none" ){
+                                    return 0;
+                                }else{
+                                    return Date.parse(a.fromTime) - Date.parse(b.fromTime);
+                                }
+                            }
                       } else if (!this.isNumber(value1) && !this.isNumber(value2)) {
                           if( this.json.sortTypeInCategory === "none" ){
-                              return -1;
+                              return 0;
                           }else{
                               return Date.parse(a.fromTime) - Date.parse(b.fromTime);
                           }
@@ -816,7 +828,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class(
                   return a.fromOpinionGroup ? -1 : 1;
               }else{
                   if( this.json.sortTypeInCategory === "none" ){
-                      return -1;
+                      return 0;
                   }else{
                       return Date.parse(a.fromTime) - Date.parse(b.fromTime);
                   }