11wqe1 преди 1 месец
родител
ревизия
7f6dbc4eca
променени са 4 файла, в които са добавени 256 реда и са изтрити 51 реда
  1. 70 18
      src/components/easy2/studyStudent.vue
  2. 56 5
      src/components/easy3/studyStudent.vue
  3. 69 18
      src/components/studyStudent.vue
  4. 61 10
      src/components/studySutdentClass/studyStudent.vue

+ 70 - 18
src/components/easy2/studyStudent.vue

@@ -485,10 +485,10 @@
           <div
             class="vedioBox"
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
                 vChapterData[taskCount].length > 0 ||
-                fileC[taskCount].length > 0
+                fileC[taskCount].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             style="border-radius: 0 0 20px 20px"
           >
@@ -13492,6 +13492,15 @@
               @change="updateFollow"
             ></el-switch>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
       </div>
       <div slot="footer">
@@ -16370,6 +16379,8 @@ export default {
   },
   data() {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       wordCloudKey: 0,
       bg: null,
@@ -22693,6 +22704,35 @@ export default {
           console.error(err);
         });
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
       let params = [
         {
@@ -22705,7 +22745,7 @@ export default {
         .then(res => {
           if (this.IsFollow == true) {
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success"
             });
           } else {
@@ -22774,6 +22814,7 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
           }else {
@@ -26146,6 +26187,25 @@ export default {
     followingMode(flag) {
       this.IsFollow = flag;
       this.updateFollow();
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
+    getScoreList() {
+      let params = {
+        cid: this.id
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestCourseByCid", params)
+        .then(res => {
+          let result = res.data;
+          this.scoreList.datalist = result[0];
+          this.scoreList.isScoreList = result[1];
+        })
+        .catch(err => {
+          console.error(err);
+        });
     }
   },
   directives: {
@@ -26403,23 +26463,15 @@ export default {
         return c;
       };
     },
-    getScoreList() {
-      let params = {
-        cid: this.id
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectTestCourseByCid", params)
-        .then(res => {
-          let result = res.data;
-          this.scoreList.datalist = result[0];
-          this.scoreList.isScoreList = result[1];
-        })
-        .catch(err => {
-          console.error(err);
-        });
-    }
+    
   },
   mounted() {
+    if (this.tType == 1) {
+       // 开局关闭学生查看内容
+      this.StulookMode(false)
+      // 开局打开跟随模式
+      this.followingMode(true)
+    }
     this.updateSplitScreenData(2);
     this.splitScreenData.myUid = uuidv4();
     document.body.addEventListener("click", e => {

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

@@ -462,10 +462,10 @@
           <div
             class="vedioBox"
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
               vChapterData[0].length > 0 ||
-              fileC[0].length > 0
+              fileC[0].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             style="border-radius: 0 0 20px 20px"
           >
@@ -10124,6 +10124,15 @@
               @change="updateFollow"
             ></el-switch>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
       </div>
       <div slot="footer">
@@ -12714,6 +12723,8 @@ export default {
   },
   data() {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
 			toolsList: toolsList,
       wordCloudKey: 0,
@@ -18120,6 +18131,35 @@ export default {
           console.error(err);
         });
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
       let params = [
         {
@@ -18132,7 +18172,7 @@ export default {
         .then((res) => {
           if (this.IsFollow == true) {
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
             });
           } else {
@@ -18201,6 +18241,7 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
           }else {
@@ -21503,6 +21544,10 @@ export default {
     followingMode(flag) {
       this.IsFollow = flag;
       this.updateFollow();
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
     }
   },
   directives: {
@@ -21756,6 +21801,12 @@ 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);
@@ -25717,7 +25768,7 @@ ol {
   width: 100%;
 }
 
-.toolChild > div::before {
+/* .toolChild > div::before { */
   /* content: "";
   width: 15px;
   height: 1px;
@@ -25726,7 +25777,7 @@ ol {
   top: 24px;
   left: -20px;
   display: block; */
-}
+/* } */
 
 .isGjCss {
   /* color: #0061ff; */

+ 69 - 18
src/components/studyStudent.vue

@@ -463,10 +463,10 @@
           <div
             class="vedioBox"
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
               vChapterData[taskCount].length > 0 ||
-              fileC[taskCount].length > 0
+              fileC[taskCount].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             style="border-radius: 0 0 20px 20px"
           >
@@ -10060,6 +10060,15 @@
               @change="updateFollow"
             ></el-switch>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
       </div>
       <div slot="footer">
@@ -12651,6 +12660,8 @@ export default {
   },
   data() {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       wordCloudKey: 0,
       bg: null,
@@ -18063,6 +18074,35 @@ export default {
           console.error(err);
         });
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
       let params = [
         {
@@ -18075,7 +18115,7 @@ export default {
         .then((res) => {
           if (this.IsFollow == true) {
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
             });
           } else {
@@ -18144,6 +18184,7 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
           }else {
@@ -21456,7 +21497,11 @@ export default {
     followingMode(flag) {
       this.IsFollow = flag;
       this.updateFollow();
-    }
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
   },
   directives: {
     // 使用局部注册指令的方式
@@ -21698,6 +21743,12 @@ 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);
@@ -23566,10 +23617,10 @@ export default {
   justify-content: center;
 }
 
-.answerBg > div:nth-child(1) {
+/* .answerBg > div:nth-child(1) { */
   /* font-size: 22px;
   padding: 25px 0 10px; */
-}
+/* } */
 
 .answerContent {
   width: 215px;
@@ -23739,8 +23790,8 @@ export default {
   width: 400px;
 }
 
-.e_add_btn {
-}
+/* .e_add_btn {
+} */
 
 .e_add_content {
   display: flex;
@@ -25132,8 +25183,8 @@ ol {
   top: -25px;
 }
 
-.group_workBox {
-}
+/* .group_workBox {
+} */
 
 .group_workBox + .group_workBox {
   margin-top: 20px;
@@ -25256,8 +25307,8 @@ ol {
   border-radius: 5px;
 }
 
-.groupBox {
-}
+/* .groupBox {
+} */
 
 .groupContent + .groupContent {
   margin-top: 30px;
@@ -25598,9 +25649,9 @@ ol {
   margin-left: 15px;
   width: calc(100% - 50px);
 }
-.stageNav{
+/* .stageNav{ */
   /* font-weight: bold; */
-}
+/* } */
 .stageItemTitle > div:first-child {
   min-width: 55px;
 }
@@ -25647,11 +25698,11 @@ ol {
   overflow: hidden;
   transition: all 0.5s;
 }
-.toolChild {
+/* .toolChild { */
   /* margin: 0 0 0 17px;
   padding: 0 0 0 20px;
   border-left: 1px solid #d7d7d7; */
-}
+/* } */
 
 .toolChild > div + div{
   margin-top:5px;
@@ -25674,7 +25725,7 @@ ol {
   width:100%;
 }
 
-.toolChild > div::before {
+/* .toolChild > div::before { */
   /* content: "";
   width: 15px;
   height: 1px;
@@ -25683,7 +25734,7 @@ ol {
   top: 24px;
   left: -20px;
   display: block; */
-}
+/* } */
 
 .isGjCss {
   /* color: #0061ff; */

+ 61 - 10
src/components/studySutdentClass/studyStudent.vue

@@ -462,10 +462,10 @@
           <div
             class="vedioBox"
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
               vChapterData[0].length > 0 ||
-              fileC[0].length > 0
+              fileC[0].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             style="border-radius: 0 0 20px 20px"
           >
@@ -13305,6 +13305,15 @@
               @change="updateFollow"
             ></el-switch>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
       </div>
       <div slot="footer">
@@ -15965,6 +15974,8 @@ export default {
   },
   data() {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
 			toolsList: toolsList,
       wordCloudKey: 0,
@@ -22159,6 +22170,35 @@ export default {
           console.error(err);
         });
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
       let params = [
         {
@@ -22171,7 +22211,7 @@ export default {
         .then((res) => {
           if (this.IsFollow == true) {
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
             });
           } else {
@@ -22240,6 +22280,7 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
           } else {
@@ -25543,7 +25584,11 @@ export default {
     followingMode(flag) {
       this.IsFollow = flag;
       this.updateFollow();
-    }
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
   },
   directives: {
     // 使用局部注册指令的方式
@@ -25802,6 +25847,12 @@ 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);
@@ -25899,9 +25950,9 @@ export default {
   align-items: center !important;
 }
 
-.dialog_diy >>> .el-dialog {
+/* .dialog_diy >>> .el-dialog { */
   /* margin-top: 10vh !important; */
-}
+/* } */
 
 .body_student {
   width: 77%;
@@ -27683,10 +27734,10 @@ export default {
   justify-content: center;
 }
 
-.answerBg > div:nth-child(1) {
+/* .answerBg > div:nth-child(1) { */
   /* font-size: 22px;
   padding: 25px 0 10px; */
-}
+/* } */
 
 .answerContent {
   width: 215px;
@@ -27855,8 +27906,8 @@ export default {
   width: 400px;
 }
 
-.e_add_btn {
-}
+/* .e_add_btn {
+} */
 
 .e_add_content {
   display: flex;