Przeglądaj źródła

修改刷新计算评分bug,修改

11wqe1 1 miesiąc temu
rodzic
commit
1493c93edb

+ 0 - 1
src/components/easy2/commpont/evaTable.vue

@@ -4,7 +4,6 @@
         <el-table
           :data="eList"
           :header-cell-style="{ background: '#F0F4FA' }"
-          :row-class-name="tableRowClassName"
           border
           stripe
           style="width: 100%"

+ 73 - 32
src/components/easy2/studyStudent.vue

@@ -16767,6 +16767,7 @@ export default {
       oidArray: [],
       refreshKey: 0,
       AIloading: [],
+      // 为了刷新ai评分loading的时候用的
       worksStudentCopy: [],
       loopLoading: [],
       markScoreVisible: false,
@@ -16796,6 +16797,48 @@ export default {
       diffKey:"1"
     };
   },
+  watch:{
+    taskCount(newVal) {
+        console.log('newVal',newVal);
+        this.AIloading = [];
+        this.loopLoading = [];
+
+        this.worksStudent.forEach((e, index) => {
+          this.loopLoading.push({ loading: false });
+          this.AIloading.push([]);
+          e.forEach(k => {
+            this.AIloading[index].push({ loading: false, sco: 0 });
+          });
+        });    
+        if(this.tType == 1){
+          this.refreshAssembly();
+        }    
+    },
+    worksStudent: {
+      handler(newVal, oldVal) {
+          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // console.log('worksStudent',sum1,sum2);
+          
+          if(sum1 != sum2){
+              this.AIloading = [];
+              this.loopLoading = [];
+
+              this.worksStudent.forEach((e, index) => {
+                this.loopLoading.push({ loading: false });
+                this.AIloading.push([]);
+                e.forEach(k => {
+                  this.AIloading[index].push({ loading: false, sco: 0 });
+                });
+              });
+              if(this.tType == 1){
+                this.refreshAssembly();
+              }
+          }
+      },
+      deep:true,
+    }
+  },
   methods: {
     getAIJ() {
       this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
@@ -16898,7 +16941,6 @@ export default {
       }
 
       this.$message.success("重置完成");
-      // this.refreshAssembly();
 
       this.worksStudent.forEach((e, index) => {
         if (toolIndex == index) {
@@ -17381,9 +17423,8 @@ export default {
       });
     },
     // 组件刷新
-    refreshAssembly(val) {
+    refreshAssembly() {
       this.refreshKey++;
-      // console.log(this.refreshKey)
     },
     updateLoading(payload) {
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
@@ -17721,7 +17762,7 @@ export default {
       }
     },
     jumpGj(i, j, k, l) {
-      this.refreshAssembly();
+      // this.refreshAssembly();
       for (var z = 0; z < this.navList.length; z++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
@@ -20806,24 +20847,14 @@ export default {
             this.joinGroup(gindex);
           }
           this.worksStudent = _worksStudent;
-          if (((this.worksStudentCopy == 0) &&
-            (this.worksStudent.length != 0)) ||
-            (this.worksStudentCopy[this.taskCount].length != this.worksStudent[this.taskCount].length)
-          ) {
-            console.log("88888999999");
-            this.worksStudentCopy = this.worksStudent;
-            this.AIloading = [];
-            this.loopLoading = [];
-
-            this.worksStudent.forEach((e, index) => {
-              this.loopLoading.push({ loading: false });
-              this.AIloading.push([]);
-              e.forEach(k => {
-                this.AIloading[index].push({ loading: false, sco: 0 });
-              });
-            });
-            this.refreshAssembly();
-          }
+
+          // if (((this.worksStudentCopy.length == 0) &&
+          //   (this.worksStudent.length != 0)) ||
+          //   (this.worksStudentCopy[this.taskCount].length != this.worksStudent[this.taskCount].length)
+          // ) {
+          //   this.worksStudentCopy = this.worksStudent;
+           
+          // }
           this.selectWorksStudent();
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
             this.$nextTick(() => {
@@ -21599,7 +21630,6 @@ export default {
       }
     },
     openTask(s, n, i) {
-      this.refreshAssembly();
       if (this.IsFollow && this.tType == 2) {
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         return;
@@ -22321,6 +22351,21 @@ export default {
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
 
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
+
           let _this = this;
           if (_this.timer) {
             clearInterval(_this.timer);
@@ -24839,8 +24884,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0 + "px";
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
       }
       this.Stbodywidth =
@@ -26466,12 +26512,7 @@ export default {
     
   },
   mounted() {
-    if (this.tType == 1) {
-       // 开局关闭学生查看内容
-      this.StulookMode(false)
-      // 开局打开跟随模式
-      this.followingMode(true)
-    }
+
     this.updateSplitScreenData(2);
     this.splitScreenData.myUid = uuidv4();
     document.body.addEventListener("click", e => {
@@ -26495,7 +26536,7 @@ export default {
 
     this.setOperationTime();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.getHomeWork();
     this.selectUser();

+ 18 - 4
src/components/easy3/studyStudent.vue

@@ -17748,7 +17748,20 @@ export default {
           //   this.courseDetail = res.data[0][0];
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
-
+           // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
           let _this = this;
           if (_this.timer) {
             clearInterval(_this.timer);
@@ -20239,8 +20252,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
       }
       this.Stbodywidth =
@@ -21825,7 +21839,7 @@ export default {
     }
     this.setOperationTime();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.getHomeWork();
     this.selectUser();

+ 18 - 4
src/components/studyStudent.vue

@@ -17690,7 +17690,20 @@ export default {
           //   this.courseDetail = res.data[0][0];
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
-
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
           let _this = this;
           if (_this.timer) {
             clearInterval(_this.timer);
@@ -20175,8 +20188,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
       }
       this.Stbodywidth =
@@ -21757,7 +21771,7 @@ export default {
 
     this.setOperationTime();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.getHomeWork();
     this.selectUser();

+ 0 - 1
src/components/studySutdentClass/commpont/evaTable.vue

@@ -4,7 +4,6 @@
         <el-table
           :data="eList"
           :header-cell-style="{ background: '#F0F4FA' }"
-          :row-class-name="tableRowClassName"
           border
           stripe
           style="width: 100%"

+ 63 - 33
src/components/studySutdentClass/studyStudent.vue

@@ -16377,6 +16377,48 @@ export default {
       diffKey:"1"
     };
   },
+  watch:{
+    taskCount(newVal) {
+      console.log('newVal',newVal);
+        this.AIloading = [];
+        this.loopLoading = [];
+
+        this.worksStudent.forEach((e, index) => {
+          this.loopLoading.push({ loading: false });
+          this.AIloading.push([]);
+          e.forEach(k => {
+            this.AIloading[index].push({ loading: false, sco: 0 });
+          });
+        });   
+        if(this.tType == 1){
+          this.refreshAssembly();
+        }        
+    },
+    worksStudent: {
+      handler(newVal, oldVal) {
+          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // console.log('worksStudent',sum1,sum2);
+          
+          if(sum1 != sum2){
+              this.AIloading = [];
+              this.loopLoading = [];
+
+              this.worksStudent.forEach((e, index) => {
+                this.loopLoading.push({ loading: false });
+                this.AIloading.push([]);
+                e.forEach(k => {
+                  this.AIloading[index].push({ loading: false, sco: 0 });
+                });
+              });
+              if(this.tType == 1){
+                this.refreshAssembly();
+              }
+          }
+      },
+      deep:true,
+    }
+  },
   methods: {
     //查看应用中心作业
     openCocoFlow(w){
@@ -16480,7 +16522,7 @@ export default {
       }
 
       this.$message.success("重置完成");
-      // this.refreshAssembly();
+
 
       this.worksStudent.forEach((e, index) => {
         if (toolIndex == index) {
@@ -16959,9 +17001,8 @@ export default {
       });
     },
     // 组件刷新
-    refreshAssembly(val) {
+    refreshAssembly() {
       this.refreshKey++;
-      // console.log(this.refreshKey)
     },
     updateLoading(payload) {
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
@@ -17294,7 +17335,7 @@ export default {
       }
     },
     jumpGj(i, j, k, l) {
-      this.refreshAssembly();
+      // this.refreshAssembly();
       for (var z = 0; z < this.navList.length; z++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
@@ -20284,26 +20325,7 @@ export default {
             this.joinGroup(gindex);
           }
           this.worksStudent = _worksStudent;
-          if ((
-            (this.worksStudentCopy == 0) &&
-            (this.worksStudent.length != 0)) ||
-            (this.worksStudentCopy[this.taskCount].length !=
-            this.worksStudent[this.taskCount].length)
-          ) {
-            console.log("88888999999");
-            this.worksStudentCopy = this.worksStudent;
-            this.AIloading = [];
-            this.loopLoading = [];
-
-            this.worksStudent.forEach((e, index) => {
-              this.loopLoading.push({ loading: false });
-              this.AIloading.push([]);
-              e.forEach(k => {
-                this.AIloading[index].push({ loading: false, sco: 0 });
-              });
-            });
-            this.refreshAssembly();
-          }
+  
           this.selectWorksStudent();
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
             this.$nextTick(() => {
@@ -21776,7 +21798,20 @@ export default {
           }
 
 
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
 
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
 
 
           //  else {
@@ -24280,8 +24315,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+            if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+            }
         }
       }
       this.Stbodywidth =
@@ -25847,12 +25883,6 @@ export default {
 
   },
   mounted() {
-    if (this.tType == 1) {
-       // 开局关闭学生查看内容
-      this.StulookMode(false)
-      // 开局打开跟随模式
-      this.followingMode(true)
-    }
     document.body.addEventListener("click", (e) => {
       if (this.isUpdateToolDetail1) {
         this.updateToolDetail(this.toolDetailIndex);
@@ -25871,7 +25901,7 @@ export default {
     }
     this.setOperationTime();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.getHomeWork();
     this.selectUser();