XMLWAN před 3 roky
rodič
revize
57a1d2e815
1 změnil soubory, kde provedl 12 přidání a 3 odebrání
  1. 12 3
      src/xt_pages/workforce/components/tableData.vue

+ 12 - 3
src/xt_pages/workforce/components/tableData.vue Zobrazit soubor

@@ -799,7 +799,14 @@ export default {
799 799
     }
800 800
   },
801 801
   methods: {
802
-       getWeekPanels() {
802
+    compare(p){ //这是比较函数
803
+      return function(m,n){
804
+          var a = m[p];
805
+          var b = n[p];
806
+          return a - b; //升序
807
+      }
808
+     },
809
+     getWeekPanels() {
803 810
          this.scheduleZone=[]
804 811
          var partionStr = this.partition_id
805 812
          var arr = this.zoneIdList.join(',')
@@ -991,15 +998,17 @@ export default {
991 998
                   },
992 999
                   total: 0
993 1000
                 }
994
-               
1001
+                 
995 1002
                 that.scheduleZone.push(thisPa)
996 1003
                
997 1004
               })
998 1005
             })
999 1006
           }
1000
-            console.log("34455555566666",this.scheduleZone)
1007
+          console.log("34455555566666",this.scheduleZone)
1008
+           this.scheduleZone.sort(this.compare('sort'))
1001 1009
         })
1002 1010
      },
1011
+   
1003 1012
     cellClass({ row, column, rowIndex, columnIndex }) {
1004 1013
       if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
1005 1014
         return "";