xiatian 4 years ago
parent
commit
c036ed1c26

+ 10 - 0
src/modules/examwork/view/onlineExam.vue

@@ -1646,6 +1646,15 @@ export default {
         callback(res);
       });
     },
+    compare: function (x, y) {
+      if (x < y) {
+        return -1;
+      } else if (x > y) {
+        return 1;
+      } else {
+        return 0;
+      }
+    },
     saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
@@ -1653,6 +1662,7 @@ export default {
       this.form.properties.EXAM_CYCLE_TIME_RANGE = JSON.stringify(
         this.examCycleTimeRangeArr
       );
+      this.examCycleWeekArr.sort(this.compare);
       this.form.properties.EXAM_CYCLE_WEEK = JSON.stringify(
         this.examCycleWeekArr
       );

+ 10 - 0
src/modules/examwork/view/onlineHomework.vue

@@ -1077,6 +1077,15 @@ export default {
         callback(res);
       });
     },
+    compare: function (x, y) {
+      if (x < y) {
+        return -1;
+      } else if (x > y) {
+        return 1;
+      } else {
+        return 0;
+      }
+    },
     saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
@@ -1084,6 +1093,7 @@ export default {
       this.form.properties.EXAM_CYCLE_TIME_RANGE = JSON.stringify(
         this.examCycleTimeRangeArr
       );
+      this.examCycleWeekArr.sort(this.compare);
       this.form.properties.EXAM_CYCLE_WEEK = JSON.stringify(
         this.examCycleWeekArr
       );

+ 10 - 0
src/modules/examwork/view/practiceExam.vue

@@ -678,6 +678,15 @@ export default {
         this.show_ckeditor = true;
       }
     },
+    compare: function (x, y) {
+      if (x < y) {
+        return -1;
+      } else if (x > y) {
+        return 1;
+      } else {
+        return 0;
+      }
+    },
     saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
@@ -685,6 +694,7 @@ export default {
       this.form.properties.EXAM_CYCLE_TIME_RANGE = JSON.stringify(
         this.examCycleTimeRangeArr
       );
+      this.examCycleWeekArr.sort(this.compare);
       this.form.properties.EXAM_CYCLE_WEEK = JSON.stringify(
         this.examCycleWeekArr
       );