lsc 1 anno fa
parent
commit
f86b7825a3
24 ha cambiato i file con 890 aggiunte e 707 eliminazioni
  1. 1 1
      dist/index.html
  2. 0 0
      dist/static/css/app.ee1bc2b6a53d91844028093d234d7335.css
  3. 0 0
      dist/static/css/app.ee1bc2b6a53d91844028093d234d7335.css.map
  4. 0 0
      dist/static/js/app.a1bdc5c3b9bbea871f69.js
  5. 0 0
      dist/static/js/app.e2a598fa2587d95100c1.js
  6. 0 0
      dist/static/js/app.e2a598fa2587d95100c1.js.map
  7. 0 0
      dist/static/js/manifest.3512a67a6213c2df4180.js.map
  8. 159 137
      src/components/pages/components/classStudentComponents/worksDetail3.vue
  9. 159 135
      src/components/pages/components/studentWorksDetail.vue
  10. 163 138
      src/components/pages/components/worksDetail2.vue
  11. 158 136
      src/components/pages/components/worksDetail3.vue
  12. 1 1
      src/components/pages/dataBoard/course/chartList/courseAna.vue
  13. 8 1
      src/components/pages/dataBoard/course/chartList/teaFre.vue
  14. 9 6
      src/components/pages/dataBoard/course/chartList/workTime.vue
  15. 0 1
      src/components/pages/dataBoard/school/courseInfo/index.vue
  16. 1 2
      src/components/pages/dataBoard/school/loginCount/index.vue
  17. 7 0
      src/components/pages/dataBoard/school/loginTime/index.vue
  18. 18 5
      src/components/pages/dataBoard/school/studentInfo/index.vue
  19. 8 1
      src/components/pages/dataBoard/student/loginCount/index.vue
  20. 8 1
      src/components/pages/dataBoard/student/loginTime/index.vue
  21. 13 1
      src/components/pages/dataBoard/student/studentInfo2/index.vue
  22. 9 2
      src/components/pages/dataBoard/teacher/chartList/teaFre.vue
  23. 9 2
      src/components/pages/dataBoard/teacher/chartList/workTime.vue
  24. 159 137
      src/components/pages/myReport/components/MyLookComponent/worksDetail3.vue

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.87e5844cc1ee6ae0aa9d63a78789cb0d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.1b8e037bd3fbbd358d74.js></script><script type=text/javascript src=./static/js/app.a1bdc5c3b9bbea871f69.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.ee1bc2b6a53d91844028093d234d7335.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.1b8e037bd3fbbd358d74.js></script><script type=text/javascript src=./static/js/app.e2a598fa2587d95100c1.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.ee1bc2b6a53d91844028093d234d7335.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.ee1bc2b6a53d91844028093d234d7335.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.a1bdc5c3b9bbea871f69.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e2a598fa2587d95100c1.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e2a598fa2587d95100c1.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 159 - 137
src/components/pages/components/classStudentComponents/worksDetail3.vue

@@ -1024,10 +1024,10 @@
                 </div>
                 <div
                   v-if="
-                    worksDetail[sIndex].img.length == 0 &&
-                    worksDetail[sIndex].askInfo.length == 0 &&
-                    worksDetail[sIndex].answerInfo.length == 0 &&
-                    worksDetail[sIndex].wpptInfo.length == 0 &&
+                    // worksDetail[sIndex].img.length == 0 &&
+                    // worksDetail[sIndex].askInfo.length == 0 &&
+                    // worksDetail[sIndex].answerInfo.length == 0 &&
+                    // worksDetail[sIndex].wpptInfo.length == 0 &&
                     worksDetail[sIndex].chooseInfo.length > 0
                   "
                 >
@@ -1040,7 +1040,7 @@
                     <div
                       class="tool_right_box"
                       v-for="(tItem, tIndex) in worksDetail[sIndex]
-                        .chooseInfo[0].testJson"
+                              .chooseInfo[0].chooseInfo.testJson"
                       :key="tIndex"
                     >
                       <div>
@@ -1057,15 +1057,17 @@
                     </div>
                   </div>
                   <div class="allRightBox">
-                    <span>全部题的正确率:</span
+                    <span>全部题的正确率:</span
                     ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
                   </div>
                 </div>
-                <div v-else>
+                <div v-if="
+                            worksDetail[sIndex].eList.length
+                          ">
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../../assets/icon/pj/score.png" alt="" />
                   </div>
-                  <div style="height: 80%">
+                  <div>
                     <div
                       class="score_box"
                       v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1535,6 +1537,7 @@ export default {
           var wordInfo = res.data[12]; //文档作业
           var workEvaList = res.data[13];
           var workJson = {};
+          let checkJson = {}
 
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
@@ -1570,7 +1573,7 @@ export default {
               continue;
             }
 
-            this.checkJson[k] = {};
+            // checkJson[stagetask] = {};
 
             let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
             if (!workJson[stagetask]) {
@@ -1593,107 +1596,110 @@ export default {
                 stagetask: stagetask,
                 time: "",
               };
-            }
-            workJson[stagetask].time = res.data[0][k].time;
-            for (var i = 0; i < askInfo.length; i++) {
-              if (
-                res.data[0][k].stage == askInfo[i].stage &&
-                res.data[0][k].task == askInfo[i].task &&
-                res.data[0][k].tool == askInfo[i].tool
-              ) {
-                const element = askInfo[i];
-                let a = JSON.parse(element.content)[0];
-                let e = [];
-                for (var y = 0; y < a.askJson.length; y++) {
-                  if (a.askJson[y].type == "2") {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  } else {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  }
-                }
-                a.radio = e;
-                workJson[stagetask].askInfo.push({
-                  askInfo: a,
-                  score: askInfo[i].score
-                    ? JSON.parse(askInfo[i].score).wScore
-                    : askInfo[i].score,
-                });
-                this.checkJson[k].allRight = 0;
-                var isCount = 0;
-                for (var p = 0; p < a.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
-                      checkCount: [],
-                      checkPerson: [],
-                    };
-                  }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
-                    let _askItemCount = a.askJson[p].askCount;
-                    for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
-                    }
-                  }
-                  if (a.radio[p] instanceof Array) {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-                        .sort()
-                        .join(",") == a.radio[p].sort().join(",")
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    for (var q = 0; q < a.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ] = 1);
-                    }
-                  } else {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
-                        .answer == a.radio[p]
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ] = 1);
-                    }
-                  }
-                }
-                this.checkJson[k].allRight = isCount / a.radio.length;
+              checkJson[stagetask] = {
+                stagetask: stagetask,
               }
             }
+            workJson[stagetask].time = res.data[0][k].time;
+            // for (var i = 0; i < askInfo.length; i++) {
+            //   if (
+            //     res.data[0][k].stage == askInfo[i].stage &&
+            //     res.data[0][k].task == askInfo[i].task &&
+            //     res.data[0][k].tool == askInfo[i].tool
+            //   ) {
+            //     const element = askInfo[i];
+            //     let a = JSON.parse(element.content)[0];
+            //     let e = [];
+            //     for (var y = 0; y < a.askJson.length; y++) {
+            //       if (a.askJson[y].type == "2") {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       } else {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       }
+            //     }
+            //     a.radio = e;
+            //     workJson[stagetask].askInfo.push({
+            //       askInfo: a,
+            //       score: askInfo[i].score
+            //         ? JSON.parse(askInfo[i].score).wScore
+            //         : askInfo[i].score,
+            //     });
+            //     checkJson[stagetask].allRight = 0;
+            //     var isCount = 0;
+            //     for (var p = 0; p < a.radio.length; p++) {
+            //       if (!checkJson[stagetask][p]) {
+            //         checkJson[stagetask][p] = {
+            //           checkCount: [],
+            //           checkPerson: [],
+            //         };
+            //       }
+            //       if (!checkJson[stagetask][p].checkCount.length) {
+            //         checkJson[stagetask][p].checkCount = [];
+            //         let _askItemCount = a.askJson[p].askCount;
+            //         for (var aic = 0; aic < _askItemCount; aic++) {
+            //           checkJson[stagetask][p].checkCount.push(0);
+            //         }
+            //       }
+            //       if (a.radio[p] instanceof Array) {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+            //             .sort()
+            //             .join(",") == a.radio[p].sort().join(",")
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         for (var q = 0; q < a.radio[p].length; q++) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ] = 1);
+            //         }
+            //       } else {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
+            //             .answer == a.radio[p]
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ] = 1);
+            //         }
+            //       }
+            //     }
+            //     checkJson[stagetask].allRight = isCount / a.radio.length;
+            //   }
+            // }
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -1717,20 +1723,20 @@ export default {
                     ? JSON.parse(chooseInfo[i].score).wScore
                     : chooseInfo[i].score,
                 });
-                this.checkJson[k].allRight = 0;
+                checkJson[stagetask].allRight = 0;
                 var isCount = 0;
                 for (var p = 0; p < t.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
                       checkCount: [],
                       checkPerson: [],
                     };
                   }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
                     let _askItemCount = t.testJson[p].testItem;
                     for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
+                      checkJson[stagetask][p].checkCount.push(0);
                     }
                   }
                   if (t.radio[p] instanceof Array) {
@@ -1738,55 +1744,55 @@ export default {
                       t.testJson[p].answer.sort().join(",") ==
                       t.radio[p].sort().join(",")
                     ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     for (var q = 0; q < t.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ] = 1);
                     }
                   } else {
                     if (t.testJson[p].answer == t.radio[p]) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ] = 1);
                     }
                   }
                 }
-                this.checkJson[k].allRight = isCount / t.radio.length;
+                checkJson[stagetask].allRight = isCount / t.radio.length;
               }
             }
           }
@@ -2006,8 +2012,10 @@ export default {
           //   );
           // });
           let result = [];
+          let checkJsonArray = []
           for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
             result.push(workJson[Object.keys(workJson)[wi]]);
+            checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
           }
           var resultNewArray = result.sort(function (x, y) {
             // 以stagetask字段为排序依据
@@ -2022,7 +2030,22 @@ export default {
             // 如果第一个数字相同,则比较第二个数字
             return parseInt(x_parts[1]) - parseInt(y_parts[1]);
           });
+          var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
+            // 以stagetask字段为排序依据
+            var x_parts = x.stagetask.split("-");
+            var y_parts = y.stagetask.split("-");
+
+            // 首先比较第一个数字
+            if (x_parts[0] !== y_parts[0]) {
+              return parseInt(x_parts[0]) - parseInt(y_parts[0]);
+            }
+
+            // 如果第一个数字相同,则比较第二个数字
+            return parseInt(x_parts[1]) - parseInt(y_parts[1]);
+          });
           result = resultNewArray;
+          checkJsonArray = checkJsonNewArray;
+          this.checkJson = checkJsonArray
           for (var l = 0; l < b.length; l++) {
             if (workEvaList.length > 0) {
               for (var p = 0; p < workEvaList.length; p++) {
@@ -2227,14 +2250,12 @@ export default {
     },
     //获取班级列表
     getClass() {
-      this.isLoading = true;
       let params = {
         oid: this.oid,
       };
       this.ajax
         .get(this.$store.state.api + "selectClassBySchool", params)
         .then((res) => {
-          this.isLoading = false;
           this.grade = res.data[0];
         })
         .catch((err) => {
@@ -2310,6 +2331,7 @@ export default {
           this.dyList = dyList;
           this.userAarray = res.data[1];
           this.lookWork();
+          this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -2706,18 +2728,18 @@ export default {
   },
   watch: {
     uid(newValue, oldValue) {
+      this.isLoading = true
       this.getCourseDetail();
       this.getClass();
       this.getGroup();
-      this.getWorks();
       // this.lookWork();
     },
   },
   mounted() {
+    this.isLoading = true
     this.getCourseDetail();
     this.getClass();
     this.getGroup();
-    this.getWorks();
     // this.lookWork();
   },
 };

+ 159 - 135
src/components/pages/components/studentWorksDetail.vue

@@ -1354,10 +1354,10 @@
                       </div>
                       <div
                         v-if="
-                          worksDetail[sIndex].img.length == 0 &&
-                          worksDetail[sIndex].askInfo.length == 0 &&
-                          worksDetail[sIndex].answerInfo.length == 0 &&
-                          worksDetail[sIndex].wpptInfo.length == 0 &&
+                          // worksDetail[sIndex].img.length == 0 &&
+                          // worksDetail[sIndex].askInfo.length == 0 &&
+                          // worksDetail[sIndex].answerInfo.length == 0 &&
+                          // worksDetail[sIndex].wpptInfo.length == 0 &&
                           worksDetail[sIndex].chooseInfo.length > 0
                         "
                       >
@@ -1374,7 +1374,7 @@
                           <div
                             class="tool_right_box"
                             v-for="(tItem, tIndex) in worksDetail[sIndex]
-                              .chooseInfo[0].testJson"
+                              .chooseInfo[0].chooseInfo.testJson"
                             :key="tIndex"
                           >
                             <div>
@@ -1393,15 +1393,17 @@
                           </div>
                         </div>
                         <div class="allRightBox">
-                          <span>全部题的正确率:</span
+                          <span>全部题的正确率:</span
                           ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
                         </div>
                       </div>
-                      <div v-else>
+                      <div v-if="
+                           worksDetail[sIndex].eList.length
+                          ">
                         <div class="ech" style="margin-left: 23px">
                           <img src="../../../assets/icon/pj/score.png" alt="" />
                         </div>
-                        <div style="height: 80%; overflow: auto">
+                        <div>
                           <div
                             class="score_box"
                             v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1909,7 +1911,8 @@ export default {
           var wordInfo = res.data[12]; //文档作业
           var workEvaList = res.data[13];
           var workJson = {};
-
+          let checkJson = {}
+          
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
             if (this.chapInfo.length == 0) {
@@ -1944,7 +1947,7 @@ export default {
               continue;
             }
 
-            this.checkJson[k] = {};
+            // checkJson[stagetask] = {};
 
             let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
             if (!workJson[stagetask]) {
@@ -1967,107 +1970,110 @@ export default {
                 stagetask: stagetask,
                 time: "",
               };
-            }
-            workJson[stagetask].time = res.data[0][k].time;
-            for (var i = 0; i < askInfo.length; i++) {
-              if (
-                res.data[0][k].stage == askInfo[i].stage &&
-                res.data[0][k].task == askInfo[i].task &&
-                res.data[0][k].tool == askInfo[i].tool
-              ) {
-                const element = askInfo[i];
-                let a = JSON.parse(element.content)[0];
-                let e = [];
-                for (var y = 0; y < a.askJson.length; y++) {
-                  if (a.askJson[y].type == "2") {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  } else {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  }
-                }
-                a.radio = e;
-                workJson[stagetask].askInfo.push({
-                  askInfo: a,
-                  score: askInfo[i].score
-                    ? JSON.parse(askInfo[i].score).wScore
-                    : askInfo[i].score,
-                });
-                this.checkJson[k].allRight = 0;
-                var isCount = 0;
-                for (var p = 0; p < a.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
-                      checkCount: [],
-                      checkPerson: [],
-                    };
-                  }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
-                    let _askItemCount = a.askJson[p].askCount;
-                    for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
-                    }
-                  }
-                  if (a.radio[p] instanceof Array) {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-                        .sort()
-                        .join(",") == a.radio[p].sort().join(",")
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    for (var q = 0; q < a.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ] = 1);
-                    }
-                  } else {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
-                        .answer == a.radio[p]
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ] = 1);
-                    }
-                  }
-                }
-                this.checkJson[k].allRight = isCount / a.radio.length;
+              checkJson[stagetask] = {
+                stagetask: stagetask,
               }
             }
+            workJson[stagetask].time = res.data[0][k].time;
+            // for (var i = 0; i < askInfo.length; i++) {
+            //   if (
+            //     res.data[0][k].stage == askInfo[i].stage &&
+            //     res.data[0][k].task == askInfo[i].task &&
+            //     res.data[0][k].tool == askInfo[i].tool
+            //   ) {
+            //     const element = askInfo[i];
+            //     let a = JSON.parse(element.content)[0];
+            //     let e = [];
+            //     for (var y = 0; y < a.askJson.length; y++) {
+            //       if (a.askJson[y].type == "2") {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       } else {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       }
+            //     }
+            //     a.radio = e;
+            //     workJson[stagetask].askInfo.push({
+            //       askInfo: a,
+            //       score: askInfo[i].score
+            //         ? JSON.parse(askInfo[i].score).wScore
+            //         : askInfo[i].score,
+            //     });
+            //     checkJson[stagetask].allRight = 0;
+            //     var isCount = 0;
+            //     for (var p = 0; p < a.radio.length; p++) {
+            //       if (!checkJson[stagetask][p]) {
+            //         checkJson[stagetask][p] = {
+            //           checkCount: [],
+            //           checkPerson: [],
+            //         };
+            //       }
+            //       if (!checkJson[stagetask][p].checkCount.length) {
+            //         checkJson[stagetask][p].checkCount = [];
+            //         let _askItemCount = a.askJson[p].askCount;
+            //         for (var aic = 0; aic < _askItemCount; aic++) {
+            //           checkJson[stagetask][p].checkCount.push(0);
+            //         }
+            //       }
+            //       if (a.radio[p] instanceof Array) {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+            //             .sort()
+            //             .join(",") == a.radio[p].sort().join(",")
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         for (var q = 0; q < a.radio[p].length; q++) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ] = 1);
+            //         }
+            //       } else {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
+            //             .answer == a.radio[p]
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ] = 1);
+            //         }
+            //       }
+            //     }
+            //     checkJson[stagetask].allRight = isCount / a.radio.length;
+            //   }
+            // }
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -2091,20 +2097,20 @@ export default {
                     ? JSON.parse(chooseInfo[i].score).wScore
                     : chooseInfo[i].score,
                 });
-                this.checkJson[k].allRight = 0;
+                checkJson[stagetask].allRight = 0;
                 var isCount = 0;
                 for (var p = 0; p < t.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
                       checkCount: [],
                       checkPerson: [],
                     };
                   }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
                     let _askItemCount = t.testJson[p].testItem;
                     for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
+                      checkJson[stagetask][p].checkCount.push(0);
                     }
                   }
                   if (t.radio[p] instanceof Array) {
@@ -2112,55 +2118,55 @@ export default {
                       t.testJson[p].answer.sort().join(",") ==
                       t.radio[p].sort().join(",")
                     ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     for (var q = 0; q < t.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ] = 1);
                     }
                   } else {
                     if (t.testJson[p].answer == t.radio[p]) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ] = 1);
                     }
                   }
                 }
-                this.checkJson[k].allRight = isCount / t.radio.length;
+                checkJson[stagetask].allRight = isCount / t.radio.length;
               }
             }
           }
@@ -2380,8 +2386,10 @@ export default {
           //   );
           // });
           let result = [];
+          let checkJsonArray = []
           for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
             result.push(workJson[Object.keys(workJson)[wi]]);
+            checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
           }
           var resultNewArray = result.sort(function (x, y) {
             // 以stagetask字段为排序依据
@@ -2396,7 +2404,22 @@ export default {
             // 如果第一个数字相同,则比较第二个数字
             return parseInt(x_parts[1]) - parseInt(y_parts[1]);
           });
+          var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
+            // 以stagetask字段为排序依据
+            var x_parts = x.stagetask.split("-");
+            var y_parts = y.stagetask.split("-");
+
+            // 首先比较第一个数字
+            if (x_parts[0] !== y_parts[0]) {
+              return parseInt(x_parts[0]) - parseInt(y_parts[0]);
+            }
+
+            // 如果第一个数字相同,则比较第二个数字
+            return parseInt(x_parts[1]) - parseInt(y_parts[1]);
+          });
           result = resultNewArray;
+          checkJsonArray = checkJsonNewArray;
+          this.checkJson = checkJsonArray
           for (var l = 0; l < b.length; l++) {
             if (workEvaList.length > 0) {
               for (var p = 0; p < workEvaList.length; p++) {
@@ -3233,6 +3256,7 @@ export default {
           }
           this.dyList = dyList;
           this.userAarray = res.data[1];
+          this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -3419,8 +3443,8 @@ export default {
   },
   created() {
     this.page = 1;
+    this.isLoading = true
     this.getCourseDetail();
-    this.getWorks();
   },
 };
 </script>

+ 163 - 138
src/components/pages/components/worksDetail2.vue

@@ -1357,10 +1357,10 @@
                       </div>
                       <div
                         v-if="
-                          worksDetail[sIndex].img.length == 0 &&
-                          worksDetail[sIndex].askInfo.length == 0 &&
-                          worksDetail[sIndex].answerInfo.length == 0 &&
-                          worksDetail[sIndex].wpptInfo.length == 0 &&
+                          // worksDetail[sIndex].img.length == 0 &&
+                          // worksDetail[sIndex].askInfo.length == 0 &&
+                          // worksDetail[sIndex].answerInfo.length == 0 &&
+                          // worksDetail[sIndex].wpptInfo.length == 0 &&
                           worksDetail[sIndex].chooseInfo.length > 0
                         "
                       >
@@ -1377,7 +1377,7 @@
                           <div
                             class="tool_right_box"
                             v-for="(tItem, tIndex) in worksDetail[sIndex]
-                              .chooseInfo[0].testJson"
+                              .chooseInfo[0].chooseInfo.testJson"
                             :key="tIndex"
                           >
                             <div>
@@ -1396,15 +1396,18 @@
                           </div>
                         </div>
                         <div class="allRightBox">
-                          <span>全部道题的正确率:</span
-                          ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
+                          <span>全部题的正确率:</span
+                          >
+                          <span>{{ checkJson[sIndex].allRight + "%" }}</span>
                         </div>
                       </div>
-                      <div v-else>
+                      <div v-if="
+                            worksDetail[sIndex].eList.length
+                          ">
                         <div class="ech" style="margin-left: 23px">
                           <img src="../../../assets/icon/pj/score.png" alt="" />
                         </div>
-                        <div style="height: 80%; overflow: auto">
+                        <div>
                           <div
                             class="score_box"
                             v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1796,6 +1799,7 @@ export default {
   watch: {
     typeCheck(newValue, oldValue) {
       this.loading = true;
+      this.isLoading = true
       this.tableData = [];
       if (newValue) {
         this.getWorks1();
@@ -1913,6 +1917,7 @@ export default {
           var wordInfo = res.data[12]; //文档作业
           var workEvaList = res.data[13];
           var workJson = {};
+          let checkJson = {}
 
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
@@ -1948,8 +1953,7 @@ export default {
               continue;
             }
 
-            this.checkJson[k] = {};
-
+            // checkJson[stagetask] = {};
             let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
             if (!workJson[stagetask]) {
               workJson[stagetask] = {
@@ -1971,107 +1975,112 @@ export default {
                 stagetask: stagetask,
                 time: "",
               };
-            }
-            workJson[stagetask].time = res.data[0][k].time;
-            for (var i = 0; i < askInfo.length; i++) {
-              if (
-                res.data[0][k].stage == askInfo[i].stage &&
-                res.data[0][k].task == askInfo[i].task &&
-                res.data[0][k].tool == askInfo[i].tool
-              ) {
-                const element = askInfo[i];
-                let a = JSON.parse(element.content)[0];
-                let e = [];
-                for (var y = 0; y < a.askJson.length; y++) {
-                  if (a.askJson[y].type == "2") {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  } else {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  }
-                }
-                a.radio = e;
-                workJson[stagetask].askInfo.push({
-                  askInfo: a,
-                  score: askInfo[i].score
-                    ? JSON.parse(askInfo[i].score).wScore
-                    : askInfo[i].score,
-                });
-                this.checkJson[k].allRight = 0;
-                var isCount = 0;
-                for (var p = 0; p < a.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
-                      checkCount: [],
-                      checkPerson: [],
-                    };
-                  }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
-                    let _askItemCount = a.askJson[p].askCount;
-                    for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
-                    }
-                  }
-                  if (a.radio[p] instanceof Array) {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-                        .sort()
-                        .join(",") == a.radio[p].sort().join(",")
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    for (var q = 0; q < a.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ] = 1);
-                    }
-                  } else {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
-                        .answer == a.radio[p]
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ] = 1);
-                    }
-                  }
-                }
-                this.checkJson[k].allRight = isCount / a.radio.length;
+              checkJson[stagetask] = {
+                stagetask: stagetask,
               }
             }
+            workJson[stagetask].time = res.data[0][k].time;
+            // for (var i = 0; i < askInfo.length; i++) {
+            //   if (
+            //     res.data[0][k].stage == askInfo[i].stage &&
+            //     res.data[0][k].task == askInfo[i].task &&
+            //     res.data[0][k].tool == askInfo[i].tool
+            //   ) {
+            //     const element = askInfo[i];
+            //     let a = JSON.parse(element.content)[0];
+            //     let e = [];
+            //     for (var y = 0; y < a.askJson.length; y++) {
+            //       if (a.askJson[y].type == "2") {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       } else {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       }
+            //     }
+            //     a.radio = e;
+            //     workJson[stagetask].askInfo.push({
+            //       askInfo: a,
+            //       score: askInfo[i].score
+            //         ? JSON.parse(askInfo[i].score).wScore
+            //         : askInfo[i].score,
+            //     });
+            //     // checkJson[stagetask].allRight = 0;
+            //     checkJson[stagetask].allRight = 0
+            //     var isCount = 0;
+            //     for (var p = 0; p < a.radio.length; p++) {
+            //       if (!checkJson[stagetask][p]) {
+            //         checkJson[stagetask][p] = {
+            //           checkCount: [],
+            //           checkPerson: [],
+            //         };
+            //       }
+            //       if (!checkJson[stagetask][p].checkCount.length) {
+            //         checkJson[stagetask][p].checkCount = [];
+            //         let _askItemCount = a.askJson[p].askCount;
+            //         for (var aic = 0; aic < _askItemCount; aic++) {
+            //           checkJson[stagetask][p].checkCount.push(0);
+            //         }
+            //       }
+            //       if (a.radio[p] instanceof Array) {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+            //             .sort()
+            //             .join(",") == a.radio[p].sort().join(",")
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         for (var q = 0; q < a.radio[p].length; q++) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ] = [res.data[0][k].sName]);
+            //               checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ] = 1);
+            //         }
+            //       } else {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
+            //             .answer == a.radio[p]
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ] = [res.data[0][k].sName]);
+            //               checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ] = 1);
+            //         }
+            //       }
+            //     }
+            //     checkJson[stagetask].allRight = isCount / a.radio.length;
+            //   }
+            // }
+            console.log(checkJson);
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -2095,20 +2104,20 @@ export default {
                     ? JSON.parse(chooseInfo[i].score).wScore
                     : chooseInfo[i].score,
                 });
-                this.checkJson[k].allRight = 0;
+                checkJson[stagetask].allRight = 0;
                 var isCount = 0;
                 for (var p = 0; p < t.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
                       checkCount: [],
                       checkPerson: [],
                     };
                   }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
                     let _askItemCount = t.testJson[p].testItem;
                     for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
+                      checkJson[stagetask][p].checkCount.push(0);
                     }
                   }
                   if (t.radio[p] instanceof Array) {
@@ -2116,55 +2125,55 @@ export default {
                       t.testJson[p].answer.sort().join(",") ==
                       t.radio[p].sort().join(",")
                     ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     for (var q = 0; q < t.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
+                          checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ] = 1);
                     }
                   } else {
                     if (t.testJson[p].answer == t.radio[p]) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
+                          checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ] = 1);
                     }
                   }
                 }
-                this.checkJson[k].allRight = isCount / t.radio.length;
+                checkJson[stagetask].allRight = isCount / t.radio.length;
               }
             }
           }
@@ -2384,8 +2393,10 @@ export default {
           //   );
           // });
           let result = [];
+          let checkJsonArray = []
           for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
             result.push(workJson[Object.keys(workJson)[wi]]);
+            checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
           }
           var resultNewArray = result.sort(function (x, y) {
             // 以stagetask字段为排序依据
@@ -2400,7 +2411,22 @@ export default {
             // 如果第一个数字相同,则比较第二个数字
             return parseInt(x_parts[1]) - parseInt(y_parts[1]);
           });
+          var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
+            // 以stagetask字段为排序依据
+            var x_parts = x.stagetask.split("-");
+            var y_parts = y.stagetask.split("-");
+
+            // 首先比较第一个数字
+            if (x_parts[0] !== y_parts[0]) {
+              return parseInt(x_parts[0]) - parseInt(y_parts[0]);
+            }
+
+            // 如果第一个数字相同,则比较第二个数字
+            return parseInt(x_parts[1]) - parseInt(y_parts[1]);
+          });
           result = resultNewArray;
+          checkJsonArray = checkJsonNewArray;
+          this.checkJson = checkJsonArray
           for (var l = 0; l < b.length; l++) {
             if (workEvaList.length > 0) {
               for (var p = 0; p < workEvaList.length; p++) {
@@ -2628,14 +2654,12 @@ export default {
     },
     //获取班级列表
     getClass() {
-      this.isLoading = true;
       let params = {
         oid: this.oid,
       };
       this.ajax
         .get(this.$store.state.api + "selectClassBySchool", params)
         .then((res) => {
-          this.isLoading = false;
           this.grade = res.data[0];
         })
         .catch((err) => {
@@ -2730,6 +2754,7 @@ export default {
           }
           this.dyList = dyList;
           this.userAarray = res.data[1];
+          this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -3545,10 +3570,10 @@ export default {
   },
   created() {
     this.page = 1;
+    this.isLoading = true
     this.getCourseDetail();
     this.getClass();
     this.getGroup();
-    this.getWorks();
   },
 };
 </script>

+ 158 - 136
src/components/pages/components/worksDetail3.vue

@@ -1024,10 +1024,10 @@
                 </div>
                 <div
                   v-if="
-                    worksDetail[sIndex].img.length == 0 &&
-                    worksDetail[sIndex].askInfo.length == 0 &&
-                    worksDetail[sIndex].answerInfo.length == 0 &&
-                    worksDetail[sIndex].wpptInfo.length == 0 &&
+                    // worksDetail[sIndex].img.length == 0 &&
+                    // worksDetail[sIndex].askInfo.length == 0 &&
+                    // worksDetail[sIndex].answerInfo.length == 0 &&
+                    // worksDetail[sIndex].wpptInfo.length == 0 &&
                     worksDetail[sIndex].chooseInfo.length > 0
                   "
                 >
@@ -1040,7 +1040,7 @@
                     <div
                       class="tool_right_box"
                       v-for="(tItem, tIndex) in worksDetail[sIndex]
-                        .chooseInfo[0].testJson"
+                              .chooseInfo[0].chooseInfo.testJson"
                       :key="tIndex"
                     >
                       <div>
@@ -1057,11 +1057,13 @@
                     </div>
                   </div>
                   <div class="allRightBox">
-                    <span>全部题的正确率:</span
+                    <span>全部题的正确率:</span
                     ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
                   </div>
                 </div>
-                <div v-else>
+                <div v-if="
+                            worksDetail[sIndex].eList.length
+                          ">
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../assets/icon/pj/score.png" alt="" />
                   </div>
@@ -1535,6 +1537,7 @@ export default {
           var wordInfo = res.data[12]; //文档作业
           var workEvaList = res.data[13];
           var workJson = {};
+          let checkJson = {}
 
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
@@ -1570,7 +1573,7 @@ export default {
               continue;
             }
 
-            this.checkJson[k] = {};
+            // checkJson[stagetask] = {};
 
             let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
             if (!workJson[stagetask]) {
@@ -1593,107 +1596,110 @@ export default {
                 stagetask: stagetask,
                 time: "",
               };
-            }
-            workJson[stagetask].time = res.data[0][k].time;
-            for (var i = 0; i < askInfo.length; i++) {
-              if (
-                res.data[0][k].stage == askInfo[i].stage &&
-                res.data[0][k].task == askInfo[i].task &&
-                res.data[0][k].tool == askInfo[i].tool
-              ) {
-                const element = askInfo[i];
-                let a = JSON.parse(element.content)[0];
-                let e = [];
-                for (var y = 0; y < a.askJson.length; y++) {
-                  if (a.askJson[y].type == "2") {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  } else {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  }
-                }
-                a.radio = e;
-                workJson[stagetask].askInfo.push({
-                  askInfo: a,
-                  score: askInfo[i].score
-                    ? JSON.parse(askInfo[i].score).wScore
-                    : askInfo[i].score,
-                });
-                this.checkJson[k].allRight = 0;
-                var isCount = 0;
-                for (var p = 0; p < a.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
-                      checkCount: [],
-                      checkPerson: [],
-                    };
-                  }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
-                    let _askItemCount = a.askJson[p].askCount;
-                    for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
-                    }
-                  }
-                  if (a.radio[p] instanceof Array) {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-                        .sort()
-                        .join(",") == a.radio[p].sort().join(",")
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    for (var q = 0; q < a.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ] = 1);
-                    }
-                  } else {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
-                        .answer == a.radio[p]
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ] = 1);
-                    }
-                  }
-                }
-                this.checkJson[k].allRight = isCount / a.radio.length;
+              checkJson[stagetask] = {
+                stagetask: stagetask,
               }
             }
+            workJson[stagetask].time = res.data[0][k].time;
+            // for (var i = 0; i < askInfo.length; i++) {
+            //   if (
+            //     res.data[0][k].stage == askInfo[i].stage &&
+            //     res.data[0][k].task == askInfo[i].task &&
+            //     res.data[0][k].tool == askInfo[i].tool
+            //   ) {
+            //     const element = askInfo[i];
+            //     let a = JSON.parse(element.content)[0];
+            //     let e = [];
+            //     for (var y = 0; y < a.askJson.length; y++) {
+            //       if (a.askJson[y].type == "2") {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       } else {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       }
+            //     }
+            //     a.radio = e;
+            //     workJson[stagetask].askInfo.push({
+            //       askInfo: a,
+            //       score: askInfo[i].score
+            //         ? JSON.parse(askInfo[i].score).wScore
+            //         : askInfo[i].score,
+            //     });
+            //     checkJson[stagetask].allRight = 0;
+            //     var isCount = 0;
+            //     for (var p = 0; p < a.radio.length; p++) {
+            //       if (!checkJson[stagetask][p]) {
+            //         checkJson[stagetask][p] = {
+            //           checkCount: [],
+            //           checkPerson: [],
+            //         };
+            //       }
+            //       if (!checkJson[stagetask][p].checkCount.length) {
+            //         checkJson[stagetask][p].checkCount = [];
+            //         let _askItemCount = a.askJson[p].askCount;
+            //         for (var aic = 0; aic < _askItemCount; aic++) {
+            //           checkJson[stagetask][p].checkCount.push(0);
+            //         }
+            //       }
+            //       if (a.radio[p] instanceof Array) {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+            //             .sort()
+            //             .join(",") == a.radio[p].sort().join(",")
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         for (var q = 0; q < a.radio[p].length; q++) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ] = 1);
+            //         }
+            //       } else {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
+            //             .answer == a.radio[p]
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ] = 1);
+            //         }
+            //       }
+            //     }
+            //     checkJson[stagetask].allRight = isCount / a.radio.length;
+            //   }
+            // }
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -1717,20 +1723,20 @@ export default {
                     ? JSON.parse(chooseInfo[i].score).wScore
                     : chooseInfo[i].score,
                 });
-                this.checkJson[k].allRight = 0;
+                checkJson[stagetask].allRight = 0;
                 var isCount = 0;
                 for (var p = 0; p < t.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
                       checkCount: [],
                       checkPerson: [],
                     };
                   }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
                     let _askItemCount = t.testJson[p].testItem;
                     for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
+                      checkJson[stagetask][p].checkCount.push(0);
                     }
                   }
                   if (t.radio[p] instanceof Array) {
@@ -1738,55 +1744,55 @@ export default {
                       t.testJson[p].answer.sort().join(",") ==
                       t.radio[p].sort().join(",")
                     ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     for (var q = 0; q < t.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ] = 1);
                     }
                   } else {
                     if (t.testJson[p].answer == t.radio[p]) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ] = 1);
                     }
                   }
                 }
-                this.checkJson[k].allRight = isCount / t.radio.length;
+                checkJson[stagetask].allRight = isCount / t.radio.length;
               }
             }
           }
@@ -2006,8 +2012,10 @@ export default {
           //   );
           // });
           let result = [];
+          let checkJsonArray = []
           for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
             result.push(workJson[Object.keys(workJson)[wi]]);
+            checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
           }
           var resultNewArray = result.sort(function (x, y) {
             // 以stagetask字段为排序依据
@@ -2022,7 +2030,22 @@ export default {
             // 如果第一个数字相同,则比较第二个数字
             return parseInt(x_parts[1]) - parseInt(y_parts[1]);
           });
+          var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
+            // 以stagetask字段为排序依据
+            var x_parts = x.stagetask.split("-");
+            var y_parts = y.stagetask.split("-");
+
+            // 首先比较第一个数字
+            if (x_parts[0] !== y_parts[0]) {
+              return parseInt(x_parts[0]) - parseInt(y_parts[0]);
+            }
+
+            // 如果第一个数字相同,则比较第二个数字
+            return parseInt(x_parts[1]) - parseInt(y_parts[1]);
+          });
           result = resultNewArray;
+          checkJsonArray = checkJsonNewArray;
+          this.checkJson = checkJsonArray
           for (var l = 0; l < b.length; l++) {
             if (workEvaList.length > 0) {
               for (var p = 0; p < workEvaList.length; p++) {
@@ -2229,14 +2252,12 @@ export default {
     },
     //获取班级列表
     getClass() {
-      this.isLoading = true;
       let params = {
         oid: this.oid,
       };
       this.ajax
         .get(this.$store.state.api + "selectClassBySchool", params)
         .then((res) => {
-          this.isLoading = false;
           this.grade = res.data[0];
         })
         .catch((err) => {
@@ -2312,6 +2333,7 @@ export default {
           this.dyList = dyList;
           this.userAarray = res.data[1];
           this.lookWork();
+          this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -2710,18 +2732,18 @@ export default {
   },
   watch: {
     uid(newValue, oldValue) {
+      this.isLoading = true
       this.getCourseDetail();
       this.getClass();
       this.getGroup();
-      this.getWorks();
       // this.lookWork();
     },
   },
   mounted() {
+    this.isLoading = true
     this.getCourseDetail();
     this.getClass();
     this.getGroup();
-    this.getWorks();
     // this.lookWork();
   },
 };

+ 1 - 1
src/components/pages/dataBoard/course/chartList/courseAna.vue

@@ -27,7 +27,7 @@ export default {
           {
             type: "pie",
             radius: '50%',
-            avoidLabelOverlap: false,
+            avoidLabelOverlap: true,
             emphasis: {
               label: {
                 show: true,

+ 8 - 1
src/components/pages/dataBoard/course/chartList/teaFre.vue

@@ -25,6 +25,13 @@ export default {
         course: [],
       },
       option: {
+        title: {
+          text: '授课频次',
+          textStyle: {
+            fontSize: 12,
+          },
+          padding: [10, 0, 0, 10]
+        },
         tooltip: {
           trigger: "axis",
         },
@@ -38,7 +45,7 @@ export default {
           type: "value",
         },
         grid: {
-          top: "5%",
+          top: "15%",
           left: "5%",
           right: "5%",
           bottom: "5%",

+ 9 - 6
src/components/pages/dataBoard/course/chartList/workTime.vue

@@ -1,11 +1,7 @@
 <template>
   <div class="data_body">
     <div style="width: 100%; height: 100%">
-      <div
-        id="charts_canvas"
-        class="echart"
-        style="width: 100%; height: 100%"
-      ></div>
+      <div id="charts_canvas" class="echart" style="width: 100%; height: 100%"></div>
     </div>
   </div>
 </template>
@@ -25,6 +21,13 @@ export default {
         type: [],
       },
       option: {
+        title: {
+          text: '授课时长',
+          textStyle: {
+            fontSize: 12,
+          },
+          padding: [10, 0, 0, 10]
+        },
         tooltip: {
           trigger: "axis",
           axisPointer: {
@@ -32,7 +35,7 @@ export default {
           },
         },
         grid: {
-          top: "5%",
+          top: "10%",
           left: "5%",
           right: "5%",
           bottom: "5%",

+ 0 - 1
src/components/pages/dataBoard/school/courseInfo/index.vue

@@ -24,7 +24,6 @@ export default {
                     text: '课程数量',
                     textStyle:{
                         fontSize: 12,
-                        marginLeft: 12
                     },
                     padding: [5, 0, 0, 10]
                 },

+ 1 - 2
src/components/pages/dataBoard/school/loginCount/index.vue

@@ -27,9 +27,8 @@ export default {
                     text: '登录频次',
                     textStyle:{
                         fontSize: 12,
-                        marginLeft: 12
                     },
-                    padding: [0, 0, 0, 20]
+                    padding: [0, 0, 0, 10]
                 },
                 tooltip: {
                     trigger: 'axis'

+ 7 - 0
src/components/pages/dataBoard/school/loginTime/index.vue

@@ -21,6 +21,13 @@ export default {
                 sdata: [],
             },
             option: {
+                title: {
+                    text: '在线时长',
+                    textStyle:{
+                        fontSize: 12,
+                    },
+                    padding: [10, 0, 0, 10]
+                },
                 tooltip: {
                     position: 'top'
                 },

+ 18 - 5
src/components/pages/dataBoard/school/studentInfo/index.vue

@@ -3,7 +3,8 @@
         <div style="width: 100%; height: 100%" v-if="this.ooption.xdata.length">
             <div id="charts_canvas" class="echart" style="width: 100%; height: 100%; "></div>
         </div>
-        <div style="width: 100%; height: 100%;display: flex;align-items: center;justify-content: center;" v-show="!this.ooption.xdata.length">暂无数据</div>
+        <div style="width: 100%; height: 100%;display: flex;align-items: center;justify-content: center;"
+            v-show="!this.ooption.xdata.length">暂无数据</div>
     </div>
 </template>
   
@@ -29,6 +30,9 @@ export default {
             option: {
                 tooltip: {},
                 radar: {
+                    axisName: {
+                        color: "#000"
+                    },
                     // shape: 'circle',
                     indicator: [
                         // { name: '目标一', max: 5 },
@@ -40,11 +44,20 @@ export default {
                 },
                 series: [
                     {
-                        areaStyle: {},
                         name: '学生综合评价',
                         type: 'radar',
                         data: [
                             {
+                                areaStyle: {
+                                    opacity: 0.2,
+                                    color: '#0061FF'
+                                },
+                                itemStyle: {
+                                    color: '#0061FF',
+                                    lineStyle: {
+                                    color: '#0061FF'
+                                    }
+                                },
                                 // 5, 4, 3, 5, 5, 2
                                 value: [],
                                 name: ''
@@ -79,8 +92,8 @@ export default {
                 xdata: [],
                 sdata: [],
             }
-            for(var i = 0;i<array.length;i++){
-                if(array[i].evid == this.eva){
+            for (var i = 0; i < array.length; i++) {
+                if (array[i].evid == this.eva) {
                     this.ooption.xdata = array[i].indicator
                     this.ooption.sdata = array[i].value
                     break;
@@ -88,7 +101,7 @@ export default {
             }
             setTimeout(() => {
                 // if (!this.chartObj) {
-                    this.setChart(this.ooption);
+                this.setChart(this.ooption);
                 // } else {
                 //     this.option.radar.indicator = this.ooption.xdata;
                 //     this.option.series[0].data[0].value = this.ooption.sdata;

+ 8 - 1
src/components/pages/dataBoard/student/loginCount/index.vue

@@ -21,11 +21,18 @@ export default {
                 student: [],
             },
             option: {
+                title: {
+                    text: '登录频次',
+                    textStyle:{
+                        fontSize: 12,
+                    },
+                    padding: [0, 0, 0, 10]
+                },
                 tooltip: {
                     trigger: 'axis'
                 },
                 grid: {
-                    top:'5%',
+                    top:'15%',
                     left: '5%',
                     right: '5%',
                     bottom: '5%',

+ 8 - 1
src/components/pages/dataBoard/student/loginTime/index.vue

@@ -16,9 +16,16 @@ export default {
                 sdata: [],
             },
             option: {
+                title: {
+                    text: '在线时长',
+                    textStyle:{
+                        fontSize: 12,
+                    },
+                    padding: [5, 0, 0, 10]
+                },
                 tooltip: {},
                 grid: {
-                    top: '5%',
+                    top: '10%',
                     left: '5%',
                     right: '5%',
                     bottom: '5%',

+ 13 - 1
src/components/pages/dataBoard/student/studentInfo2/index.vue

@@ -29,6 +29,9 @@ export default {
             option: {
                 tooltip: {},
                 radar: {
+                    axisName: {
+                        color: "#000"
+                    },
                     // shape: 'circle',
                     indicator: [
                         // { name: '目标一', max: 5 },
@@ -40,11 +43,20 @@ export default {
                 },
                 series: [
                     {
-                        areaStyle: {},
                         name: '学生综合评价',
                         type: 'radar',
                         data: [
                             {
+                                areaStyle: {
+                                    opacity: 0.2,
+                                    color: '#0061FF'
+                                },
+                                itemStyle: {
+                                    color: '#0061FF',
+                                    lineStyle: {
+                                    color: '#0061FF'
+                                    }
+                                },
                                 // 5, 4, 3, 5, 5, 2
                                 value: [],
                                 name: ''

+ 9 - 2
src/components/pages/dataBoard/teacher/chartList/teaFre.vue

@@ -25,6 +25,13 @@ export default {
         teacher: [],
       },
       option: {
+        title: {
+          text: '登录频次',
+          textStyle: {
+            fontSize: 12,
+          },
+          padding: [0, 0, 0, 10]
+        },
         tooltip: {
           trigger: "axis",
         },
@@ -38,10 +45,10 @@ export default {
           type: "value",
         },
         grid: {
-          top: "5%",
+          top: "15%",
           left: "5%",
           right: "5%",
-          bottom: "5%",
+          bottom: "0%",
           containLabel: true,
         },
         series: [

+ 9 - 2
src/components/pages/dataBoard/teacher/chartList/workTime.vue

@@ -25,6 +25,13 @@ export default {
         teacher: [],
       },
       option: {
+        title: {
+          text: '在线时长',
+          textStyle: {
+            fontSize: 12,
+          },
+          padding: [10, 0, 0, 10]
+        },
         tooltip: {
           trigger: "axis",
           axisPointer: {
@@ -32,7 +39,7 @@ export default {
           },
         },
         grid: {
-          top: "5%",
+          top: "10%",
           left: "5%",
           right: "5%",
           bottom: "5%",
@@ -49,7 +56,7 @@ export default {
         },
         series: [
           {
-            name: "2011",
+            name: "在线时长(时)",
             type: "bar",
             // data: [60, 110, 25, 130, 65, 80],
             data:[],

+ 159 - 137
src/components/pages/myReport/components/MyLookComponent/worksDetail3.vue

@@ -1024,10 +1024,10 @@
                 </div>
                 <div
                   v-if="
-                    worksDetail[sIndex].img.length == 0 &&
-                    worksDetail[sIndex].askInfo.length == 0 &&
-                    worksDetail[sIndex].answerInfo.length == 0 &&
-                    worksDetail[sIndex].wpptInfo.length == 0 &&
+                    // worksDetail[sIndex].img.length == 0 &&
+                    // worksDetail[sIndex].askInfo.length == 0 &&
+                    // worksDetail[sIndex].answerInfo.length == 0 &&
+                    // worksDetail[sIndex].wpptInfo.length == 0 &&
                     worksDetail[sIndex].chooseInfo.length > 0
                   "
                 >
@@ -1040,7 +1040,7 @@
                     <div
                       class="tool_right_box"
                       v-for="(tItem, tIndex) in worksDetail[sIndex]
-                        .chooseInfo[0].testJson"
+                              .chooseInfo[0].chooseInfo.testJson"
                       :key="tIndex"
                     >
                       <div>
@@ -1057,15 +1057,17 @@
                     </div>
                   </div>
                   <div class="allRightBox">
-                    <span>全部题的正确率:</span
+                    <span>全部题的正确率:</span
                     ><span>{{ checkJson[sIndex].allRight + "%" }}</span>
                   </div>
                 </div>
-                <div v-else>
+                <div v-if="
+                            worksDetail[sIndex].eList.length
+                          ">
                   <div class="ech" style="margin-left: 23px">
                     <img src="../../../../../assets/icon/pj/score.png" alt="" />
                   </div>
-                  <div style="height: 80%">
+                  <div>
                     <div
                       class="score_box"
                       v-for="(item, index) in worksDetail[sIndex].eList"
@@ -1534,6 +1536,7 @@ export default {
           var wordInfo = res.data[12]; //文档作业
           var workEvaList = res.data[13];
           var workJson = {};
+          let checkJson = {}
 
           for (var k = 0; k < res.data[0].length; k++) {
             this.allWorks = res.data[0][k];
@@ -1569,7 +1572,7 @@ export default {
               continue;
             }
 
-            this.checkJson[k] = {};
+            // checkJson[stagetask] = {};
 
             let stagetask = res.data[0][k].stage + "-" + res.data[0][k].task;
             if (!workJson[stagetask]) {
@@ -1592,107 +1595,110 @@ export default {
                 stagetask: stagetask,
                 time: "",
               };
-            }
-            workJson[stagetask].time = res.data[0][k].time;
-            for (var i = 0; i < askInfo.length; i++) {
-              if (
-                res.data[0][k].stage == askInfo[i].stage &&
-                res.data[0][k].task == askInfo[i].task &&
-                res.data[0][k].tool == askInfo[i].tool
-              ) {
-                const element = askInfo[i];
-                let a = JSON.parse(element.content)[0];
-                let e = [];
-                for (var y = 0; y < a.askJson.length; y++) {
-                  if (a.askJson[y].type == "2") {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  } else {
-                    e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
-                  }
-                }
-                a.radio = e;
-                workJson[stagetask].askInfo.push({
-                  askInfo: a,
-                  score: askInfo[i].score
-                    ? JSON.parse(askInfo[i].score).wScore
-                    : askInfo[i].score,
-                });
-                this.checkJson[k].allRight = 0;
-                var isCount = 0;
-                for (var p = 0; p < a.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
-                      checkCount: [],
-                      checkPerson: [],
-                    };
-                  }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
-                    let _askItemCount = a.askJson[p].askCount;
-                    for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
-                    }
-                  }
-                  if (a.radio[p] instanceof Array) {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
-                        .sort()
-                        .join(",") == a.radio[p].sort().join(",")
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    for (var q = 0; q < a.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p][q])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p][q])
-                          ] = 1);
-                    }
-                  } else {
-                    if (
-                      workJson[stagetask].askInfo[0].askInfo.askJson[p]
-                        .answer == a.radio[p]
-                    ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
-                    } else {
-                      this.checkJson[k][p].right = 0;
-                      isCount += 0;
-                    }
-                    if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
-                            parseInt(a.radio[p])
-                          ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(a.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ]++
-                        : (this.checkJson[k][p].checkCount[
-                            parseInt(a.radio[p])
-                          ] = 1);
-                    }
-                  }
-                }
-                this.checkJson[k].allRight = isCount / a.radio.length;
+              checkJson[stagetask] = {
+                stagetask: stagetask,
               }
             }
+            workJson[stagetask].time = res.data[0][k].time;
+            // for (var i = 0; i < askInfo.length; i++) {
+            //   if (
+            //     res.data[0][k].stage == askInfo[i].stage &&
+            //     res.data[0][k].task == askInfo[i].task &&
+            //     res.data[0][k].tool == askInfo[i].tool
+            //   ) {
+            //     const element = askInfo[i];
+            //     let a = JSON.parse(element.content)[0];
+            //     let e = [];
+            //     for (var y = 0; y < a.askJson.length; y++) {
+            //       if (a.askJson[y].type == "2") {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       } else {
+            //         e.push(JSON.parse(askInfo[i].content)[0].anwer[y]);
+            //       }
+            //     }
+            //     a.radio = e;
+            //     workJson[stagetask].askInfo.push({
+            //       askInfo: a,
+            //       score: askInfo[i].score
+            //         ? JSON.parse(askInfo[i].score).wScore
+            //         : askInfo[i].score,
+            //     });
+            //     checkJson[stagetask].allRight = 0;
+            //     var isCount = 0;
+            //     for (var p = 0; p < a.radio.length; p++) {
+            //       if (!checkJson[stagetask][p]) {
+            //         checkJson[stagetask][p] = {
+            //           checkCount: [],
+            //           checkPerson: [],
+            //         };
+            //       }
+            //       if (!checkJson[stagetask][p].checkCount.length) {
+            //         checkJson[stagetask][p].checkCount = [];
+            //         let _askItemCount = a.askJson[p].askCount;
+            //         for (var aic = 0; aic < _askItemCount; aic++) {
+            //           checkJson[stagetask][p].checkCount.push(0);
+            //         }
+            //       }
+            //       if (a.radio[p] instanceof Array) {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p].answer
+            //             .sort()
+            //             .join(",") == a.radio[p].sort().join(",")
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         for (var q = 0; q < a.radio[p].length; q++) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p][q])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p][q])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p][q])
+            //               ] = 1);
+            //         }
+            //       } else {
+            //         if (
+            //           workJson[stagetask].askInfo[0].askInfo.askJson[p]
+            //             .answer == a.radio[p]
+            //         ) {
+            //           checkJson[stagetask][p].right = 100;
+            //           isCount += checkJson[stagetask][p].right;
+            //         } else {
+            //           checkJson[stagetask][p].right = 0;
+            //           isCount += 0;
+            //         }
+            //         if (parseInt(a.radio[p]) || parseInt(a.radio[p]) == 0) {
+            //           checkJson[stagetask][p].checkPerson[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ].push(res.data[0][k].sName)
+            //             : (checkJson[stagetask][p].checkPerson[
+            //                 parseInt(a.radio[p])
+            //               ] = [res.data[0][k].sName]);
+            //           checkJson[stagetask][p].checkCount[parseInt(a.radio[p])]
+            //             ? checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ]++
+            //             : (checkJson[stagetask][p].checkCount[
+            //                 parseInt(a.radio[p])
+            //               ] = 1);
+            //         }
+            //       }
+            //     }
+            //     checkJson[stagetask].allRight = isCount / a.radio.length;
+            //   }
+            // }
             for (var i = 0; i < chooseInfo.length; i++) {
               if (
                 res.data[0][k].stage == chooseInfo[i].stage &&
@@ -1716,20 +1722,20 @@ export default {
                     ? JSON.parse(chooseInfo[i].score).wScore
                     : chooseInfo[i].score,
                 });
-                this.checkJson[k].allRight = 0;
+                checkJson[stagetask].allRight = 0;
                 var isCount = 0;
                 for (var p = 0; p < t.radio.length; p++) {
-                  if (!this.checkJson[k][p]) {
-                    this.checkJson[k][p] = {
+                  if (!checkJson[stagetask][p]) {
+                    checkJson[stagetask][p] = {
                       checkCount: [],
                       checkPerson: [],
                     };
                   }
-                  if (!this.checkJson[k][p].checkCount.length) {
-                    this.checkJson[k][p].checkCount = [];
+                  if (!checkJson[stagetask][p].checkCount.length) {
+                    checkJson[stagetask][p].checkCount = [];
                     let _askItemCount = t.testJson[p].testItem;
                     for (var aic = 0; aic < _askItemCount; aic++) {
-                      this.checkJson[k][p].checkCount.push(0);
+                      checkJson[stagetask][p].checkCount.push(0);
                     }
                   }
                   if (t.radio[p] instanceof Array) {
@@ -1737,55 +1743,55 @@ export default {
                       t.testJson[p].answer.sort().join(",") ==
                       t.radio[p].sort().join(",")
                     ) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     for (var q = 0; q < t.radio[p].length; q++) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p][q])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p][q])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p][q])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p][q])
                           ] = 1);
                     }
                   } else {
                     if (t.testJson[p].answer == t.radio[p]) {
-                      this.checkJson[k][p].right = 100;
-                      isCount += this.checkJson[k][p].right;
+                      checkJson[stagetask][p].right = 100;
+                      isCount += checkJson[stagetask][p].right;
                     } else {
-                      this.checkJson[k][p].right = 0;
+                      checkJson[stagetask][p].right = 0;
                       isCount += 0;
                     }
                     if (parseInt(t.radio[p]) || parseInt(t.radio[p]) == 0) {
-                      this.checkJson[k][p].checkPerson[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkPerson[
+                      checkJson[stagetask][p].checkPerson[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ].push(res.data[0][k].sName)
-                        : (this.checkJson[k][p].checkPerson[
+                        : (checkJson[stagetask][p].checkPerson[
                             parseInt(t.radio[p])
                           ] = [res.data[0][k].sName]);
-                      this.checkJson[k][p].checkCount[parseInt(t.radio[p])]
-                        ? this.checkJson[k][p].checkCount[
+                      checkJson[stagetask][p].checkCount[parseInt(t.radio[p])]
+                        ? checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ]++
-                        : (this.checkJson[k][p].checkCount[
+                        : (checkJson[stagetask][p].checkCount[
                             parseInt(t.radio[p])
                           ] = 1);
                     }
                   }
                 }
-                this.checkJson[k].allRight = isCount / t.radio.length;
+                checkJson[stagetask].allRight = isCount / t.radio.length;
               }
             }
           }
@@ -2005,8 +2011,10 @@ export default {
           //   );
           // });
           let result = [];
+          let checkJsonArray = []
           for (var wi = 0; wi < Object.keys(workJson).length; wi++) {
             result.push(workJson[Object.keys(workJson)[wi]]);
+            checkJsonArray.push(checkJson[Object.keys(checkJson)[wi]])
           }
           var resultNewArray = result.sort(function (x, y) {
             // 以stagetask字段为排序依据
@@ -2021,7 +2029,22 @@ export default {
             // 如果第一个数字相同,则比较第二个数字
             return parseInt(x_parts[1]) - parseInt(y_parts[1]);
           });
+          var checkJsonNewArray = checkJsonArray.sort(function (x, y) {
+            // 以stagetask字段为排序依据
+            var x_parts = x.stagetask.split("-");
+            var y_parts = y.stagetask.split("-");
+
+            // 首先比较第一个数字
+            if (x_parts[0] !== y_parts[0]) {
+              return parseInt(x_parts[0]) - parseInt(y_parts[0]);
+            }
+
+            // 如果第一个数字相同,则比较第二个数字
+            return parseInt(x_parts[1]) - parseInt(y_parts[1]);
+          });
           result = resultNewArray;
+          checkJsonArray = checkJsonNewArray;
+          this.checkJson = checkJsonArray
           for (var l = 0; l < b.length; l++) {
             if (workEvaList.length > 0) {
               for (var p = 0; p < workEvaList.length; p++) {
@@ -2228,14 +2251,12 @@ export default {
     },
     //获取班级列表
     getClass() {
-      this.isLoading = true;
       let params = {
         oid: this.oid,
       };
       this.ajax
         .get(this.$store.state.api + "selectClassBySchool", params)
         .then((res) => {
-          this.isLoading = false;
           this.grade = res.data[0];
         })
         .catch((err) => {
@@ -2311,6 +2332,7 @@ export default {
           this.dyList = dyList;
           this.userAarray = res.data[1];
           this.lookWork();
+          this.getWorks();
         })
         .catch((err) => {
           console.error(err);
@@ -2709,18 +2731,18 @@ export default {
   },
   watch: {
     uid(newValue, oldValue) {
+      this.isLoading = true
       this.getCourseDetail();
       this.getClass();
       this.getGroup();
-      this.getWorks();
       // this.lookWork();
     },
   },
   mounted() {
+    this.isLoading = true
     this.getCourseDetail();
     this.getClass();
     this.getGroup();
-    this.getWorks();
     // this.lookWork();
   },
 };

Some files were not shown because too many files changed in this diff