zengyicheng 1 年間 前
コミット
cbc33aead8
1 ファイル変更43 行追加47 行削除
  1. 43 47
      src/components/pages/dataBoardNew/course/index.vue

+ 43 - 47
src/components/pages/dataBoardNew/course/index.vue

@@ -536,6 +536,7 @@ export default {
       courseWorksCountYearArray: [],
       courseWorksCountYearArray2: [],
       allCourseWorks: [],
+      allCourseWorks1: [],
       gradeList: [],
       subjectList2: [],
       thList: [],
@@ -816,38 +817,31 @@ export default {
       var Year = date.getFullYear();
       let courseWorksCountYearArray = {};
       let timeArray = [];
-      for (var i = 0; i < this.allCourseWorks.length; i++) {
-        timeArray.push(this.allCourseWorks[i].time);
+      for (var i = 0; i < this.allCourseWorks1.length; i++) {
+        timeArray.push(this.allCourseWorks1[i].time);
       }
-      for (var i = 0; i < this.allCourseWorks.length; i++) {
-        let _type = this.allCourseWorks[i].type
-          ? this.allCourseWorks[i].typeid.split(",")
+      for (var i = 0; i < this.allCourseWorks1.length; i++) {
+        let _type = this.allCourseWorks1[i].type
+          ? this.allCourseWorks1[i].type.split(",")
           : [];
+        let time = this.allCourseWorks1[i].time;
         if (this.lType1 == "all") {
-          timeArray.forEach((item) => {
-            courseWorksCountYearArray[item] =
-              courseWorksCountYearArray[item] + 1 || 1;
-          });
+          courseWorksCountYearArray[time] =
+            courseWorksCountYearArray[time] + 1 || 1;
         } else if (this.lType1 == "grade") {
           if (this.hasCommonValue(this.gradeList, _type)) {
-            timeArray.forEach((item) => {
-              courseWorksCountYearArray[item] =
-                courseWorksCountYearArray[item] + 1 || 1;
-            });
+            courseWorksCountYearArray[time] =
+              courseWorksCountYearArray[time] + 1 || 1;
           }
         } else if (this.lType1 == "subject") {
           if (this.hasCommonValue(this.subjectList2, _type)) {
-            timeArray.forEach((item) => {
-              courseWorksCountYearArray[item] =
-                courseWorksCountYearArray[item] + 1 || 1;
-            });
+            courseWorksCountYearArray[time] =
+              courseWorksCountYearArray[time] + 1 || 1;
           }
         } else {
           if (this.hasCommonValue(this.thList, _type)) {
-            timeArray.forEach((item) => {
-              courseWorksCountYearArray[item] =
-                courseWorksCountYearArray[item] + 1 || 1;
-            });
+            courseWorksCountYearArray[time] =
+              courseWorksCountYearArray[time] + 1 || 1;
           }
         }
       }
@@ -931,68 +925,68 @@ export default {
 
       var worksCount = 0,
         haveWorksCourse = [];
-      for (var i = 0; i < this.allCourseWorks.length; i++) {
-        if (!this.allCourseWorks[i].pcount > 0) {
-          continue;
-        }
-        let _type = this.allCourseWorks[i].type
-          ? this.allCourseWorks[i].typeid.split(",")
+      for (var i = 0; i < this.allCourseWorks1.length; i++) {
+        // if (!this.allCourseWorks[i].pcount > 0) {
+        //   continue;
+        // }
+        let _type = this.allCourseWorks1[i].type
+          ? this.allCourseWorks1[i].type.split(",")
           : [];
         if (this.lType1 == "all") {
-          if (this.allCourseWorks[i].id) {
-            worksCount += this.allCourseWorks[i].pcount;
+          if (this.allCourseWorks1[i].id) {
+            worksCount ++;
           }
           if (haveWorksCourse.length == 0) {
-            haveWorksCourse.push(this.allCourseWorks[i].courseId);
+            haveWorksCourse.push(this.allCourseWorks1[i].courseid);
           } else {
             if (
-              haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
+              haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
             ) {
-              haveWorksCourse.push(this.allCourseWorks[i].courseId);
+              haveWorksCourse.push(this.allCourseWorks1[i].courseid);
             }
           }
         } else if (this.lType1 == "grade") {
           if (this.hasCommonValue(this.gradeList, _type)) {
-            if (this.allCourseWorks[i].id) {
-              worksCount += this.allCourseWorks[i].pcount;
+            if (this.allCourseWorks1[i].id) {
+              worksCount ++
             }
             if (haveWorksCourse.length == 0) {
-              haveWorksCourse.push(this.allCourseWorks[i].courseId);
+              haveWorksCourse.push(this.allCourseWorks1[i].courseid);
             } else {
               if (
-                haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
+                haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
               ) {
-                haveWorksCourse.push(this.allCourseWorks[i].courseId);
+                haveWorksCourse.push(this.allCourseWorks1[i].courseid);
               }
             }
           }
         } else if (this.lType1 == "subject") {
           if (this.hasCommonValue(this.subjectList2, _type)) {
-            if (this.allCourseWorks[i].id) {
-              worksCount += this.allCourseWorks[i].pcount;
+            if (this.allCourseWorks1[i].id) {
+              worksCount ++
             }
             if (haveWorksCourse.length == 0) {
-              haveWorksCourse.push(this.allCourseWorks[i].courseId);
+              haveWorksCourse.push(this.allCourseWorks1[i].courseid);
             } else {
               if (
-                haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
+                haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
               ) {
-                haveWorksCourse.push(this.allCourseWorks[i].courseId);
+                haveWorksCourse.push(this.allCourseWorks1[i].courseid);
               }
             }
           }
         } else {
           if (this.hasCommonValue(this.thList, _type)) {
-            if (this.allCourseWorks[i].id) {
-              worksCount += this.allCourseWorks[i].pcount;
+            if (this.allCourseWorks1[i].id) {
+              worksCount ++
             }
             if (haveWorksCourse.length == 0) {
-              haveWorksCourse.push(this.allCourseWorks[i].courseId);
+              haveWorksCourse.push(this.allCourseWorks1[i].courseid);
             } else {
               if (
-                haveWorksCourse.indexOf(this.allCourseWorks[i].courseId) == -1
+                haveWorksCourse.indexOf(this.allCourseWorks1[i].courseid) == -1
               ) {
-                haveWorksCourse.push(this.allCourseWorks[i].courseId);
+                haveWorksCourse.push(this.allCourseWorks1[i].courseid);
               }
             }
           }
@@ -1307,7 +1301,9 @@ export default {
           this.themeLength = _tList.length;
 
           let allCourseWorks = res.data[7]; //作业总数量
+          let threeMouthCourseWorks = res.data[10]; //近三个月作业总数量
           this.allCourseWorks = allCourseWorks;
+          this.allCourseWorks1 = threeMouthCourseWorks;
           this.gradeList = _gradeList;
           this.subjectList2 = _subjectList;
           this.thList = _thList;