Pārlūkot izejas kodu

修改课程中心协同老师可以使用跟随模式

11wqe1 3 nedēļas atpakaļ
vecāks
revīzija
85024e06e1

+ 21 - 5
src/components/easy2/studyStudent.vue

@@ -13507,7 +13507,9 @@
               @change="updateLookOpen"
             ></el-switch>
           </div>
-          <div class="switch_box" v-if="courseDetail.userid == userid">
+          <div class="switch_box" v-if="(courseDetail.userid == userid ||
+                (courseDetail.course_teacher &&
+                  courseDetail.course_teacher.indexOf(userid) != -1)) && !splitScreenData.isOpen">
             <span>开启跟随模式</span>
             <el-switch
               v-model="IsFollow"
@@ -17867,6 +17869,12 @@ export default {
           );
         }
       }
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) &&
+          this.IsFollow) {
+        this.setCTask();
+      }
     },
     addTools2(i) {
       if (i == 4) {
@@ -21672,7 +21680,10 @@ export default {
       this.getHomeWork();
       this.getCourseDetail(2);
       this.$forceUpdate();
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) &&
+          this.IsFollow) {
         this.setCTask();
       }
     },
@@ -21803,7 +21814,9 @@ export default {
           }</span>`
         );
       }
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
     },
@@ -21929,8 +21942,11 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectCourseDetail3", params)
         .then(res => {
-          this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
-
+          if ((this.courseDetail.userid == this.userid ||
+              (this.courseDetail.course_teacher && 
+              this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
+            this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          }
           if (type != 2) {
             loading.close();
             if (

+ 20 - 5
src/components/easy3/studyStudent.vue

@@ -10148,7 +10148,9 @@
               @change="updateLookOpen"
             ></el-switch>
           </div>
-          <div class="switch_box" v-if="courseDetail.userid == userid">
+          <div class="switch_box" v-if="(courseDetail.userid == userid ||
+              (courseDetail.course_teacher &&
+                courseDetail.course_teacher.indexOf(userid) != -1)) && !splitScreenData.isOpen">
             <span>开启跟随模式</span>
             <el-switch
               v-model="IsFollow"
@@ -13485,7 +13487,12 @@ export default {
 					this.insertMemorandum(`选择<span class="variable">阶段${i+1}${this.navList[i].dyName?':'+this.navList[i].dyName:''}</span>→<span class="variable">任务${j+1}${this.navList[i].task[j].taskName?':'+this.navList[i].task[j].taskName:''}</span>→<span class="variable">工具${k+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
 				}
       }
-
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) &&
+          this.IsFollow) {
+        this.setCTask();
+      }
       // var b = this.$refs["bz" + k][0];
       // a.scrollTop = b.offsetTop;
     },
@@ -17161,7 +17168,9 @@ export default {
       this.getHomeWork();
       this.getCourseDetail(2);
       this.$forceUpdate();
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
     },
@@ -17273,7 +17282,9 @@ export default {
       this.selectPz();
       this.getHomeWork();
       this.getCourseDetail(2);
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
 			if(flag){
@@ -17404,7 +17415,11 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectCourseDetail3", params)
         .then((res) => {
-          this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          if ((this.courseDetail.userid == this.userid ||
+              (this.courseDetail.course_teacher && 
+              this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
+            this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          }
           if (type != 2) {
             loading.close();
             if (

+ 22 - 4
src/components/studyStudent.vue

@@ -10075,7 +10075,9 @@
               @change="updateLookOpen"
             ></el-switch>
           </div>
-          <div class="switch_box" v-if="courseDetail.userid == userid">
+          <div class="switch_box" v-if="(courseDetail.userid == userid ||
+                (courseDetail.course_teacher &&
+                  courseDetail.course_teacher.indexOf(userid) != -1)) && !splitScreenData.isOpen">
             <span>开启跟随模式</span>
             <el-switch
               v-model="IsFollow"
@@ -13412,6 +13414,12 @@ export default {
 					this.insertMemorandum(`选择<span class="variable">阶段${i+1}${this.navList[i].dyName?':'+this.navList[i].dyName:''}</span>→<span class="variable">任务${j+1}${this.navList[i].task[j].taskName?':'+this.navList[i].task[j].taskName:''}</span>→<span class="variable">工具${k+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
 				}
       }
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) &&
+          this.IsFollow) {
+        this.setCTask();
+      }
 
       // var b = this.$refs["bz" + k][0];
       // a.scrollTop = b.offsetTop;
@@ -17086,12 +17094,15 @@ export default {
       this.getHomeWork();
       this.getCourseDetail(2);
       this.$forceUpdate();
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
     },
 
     openTask(s, n, i,ctype) {
+      // 这段代码没用开启了跟随学生侧边栏会隐藏掉
       if (this.IsFollow && this.tType == 2) {
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         return;
@@ -17204,7 +17215,9 @@ export default {
       this.selectPz();
       this.getHomeWork();
       this.getCourseDetail(2);
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
 			if(flag){
@@ -17336,7 +17349,11 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectCourseDetail3", params)
         .then((res) => {
-          this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          if ((this.courseDetail.userid == this.userid ||
+              (this.courseDetail.course_teacher && 
+              this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
+            this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          }
 
           if (type != 2) {
             loading.close();
@@ -18417,6 +18434,7 @@ export default {
           state: JSON.stringify(_state),
         },
       ];
+      // 这两个接口是一样的type无所谓了
       this.ajax
         .post(
           this.$store.state.api +

+ 20 - 6
src/components/studySutdentClass/studyStudent.vue

@@ -13320,7 +13320,9 @@
               @change="updateLookOpen"
             ></el-switch>
           </div>
-          <div class="switch_box" v-if="courseDetail.userid == userid">
+          <div class="switch_box" v-if=" (courseDetail.userid == userid ||
+              (courseDetail.course_teacher &&
+                courseDetail.course_teacher.indexOf(userid) != -1)) && !splitScreenData.isOpen">
             <span>开启跟随模式</span>
             <el-switch
               v-model="IsFollow"
@@ -17415,7 +17417,12 @@ export default {
 					this.insertMemorandum(`选择<span class="variable">阶段${i+1}${this.navList[i].dyName?':'+this.navList[i].dyName:''}</span>→<span class="variable">任务${j+1}${this.navList[i].task[j].taskName?':'+this.navList[i].task[j].taskName:''}</span>→<span class="variable">工具${k+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
 				}
       }
-
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) &&
+          this.IsFollow) {
+        this.setCTask();
+      }
       // var b = this.$refs["bz" + k][0];
       // a.scrollTop = b.offsetTop;
     },
@@ -21135,7 +21142,9 @@ export default {
       this.getHomeWork();
       this.getCourseDetail(2);
       this.$forceUpdate();
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
     },
@@ -21252,7 +21261,9 @@ export default {
 			}else{
 				this.insertMemorandum(`进入<span class="variable">阶段${s+1}${this.navList[s].dyName?':'+this.navList[s].dyName:''}</span>→<span class="variable">任务${n+1}${this.navList[s].task[n].taskName?':'+this.navList[s].task[n].taskName:''}</span>`)
 			}
-      if (this.courseDetail.userid == this.userid && this.IsFollow) {
+      if ((this.courseDetail.userid == this.userid ||
+          (this.courseDetail.course_teacher && 
+          this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
         this.setCTask();
       }
     },
@@ -21377,8 +21388,11 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectCourseDetail3", params)
         .then((res) => {
-          this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
-
+          if ((this.courseDetail.userid == this.userid ||
+              (this.courseDetail.course_teacher && 
+              this.courseDetail.course_teacher.indexOf(this.userid) != -1)) && this.IsFollow) {
+            this.addCourseState(1, JSON.parse(res.data[0][0].chapters));
+          }
           if (type != 2) {
             loading.close();
             if (