zengyicheng 1 ano atrás
pai
commit
25965fdb24

+ 11 - 17
src/components/easy2/studyStudent.vue

@@ -104,11 +104,7 @@
                   <div v-if="nav.tool[0].tool != undefined">
                     <div
                       class="closeTri1"
-                      v-if="
-                        navIndex == taskCount &&
-                        nav.id == navId &&
-                        stageIndex == courseType
-                      "
+                      v-if="nav.isOpen"
                       @click="openTask(stageIndex, navIndex, nav.id)"
                     >
                       <img src="../../assets/icon/newIcons/bDown.png" alt />
@@ -153,12 +149,7 @@
                 <div
                   v-if="nav.tool[0].tool != undefined"
                   class="toolChild"
-                  :class="{
-                    toolActive:
-                      navIndex == taskCount &&
-                      nav.id == navId &&
-                      stageIndex == courseType,
-                  }"
+                  :class="{ toolActive: nav.isOpen }"
                 >
                   <div v-for="(t, toolIndex2) in nav.tool" :key="toolIndex2">
                     <div
@@ -14974,15 +14965,16 @@ export default {
           }
         }
       }
+      if(this.navList[s].task[n].isOpen == true){
+        this.navList[s].task[n].isOpen =
+        !this.navList[s].task[n].isOpen;
+        return;
+      }
       this.courseType = s;
       this.navId = i;
       this.taskCount = n;
-      this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-        this.taskCount
-      ].isLook =
-        !this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-          this.taskCount
-        ].isLook;
+      this.navList[this.courseType].task[this.taskCount].isOpen =
+        !this.navList[this.courseType].task[this.taskCount].isOpen;
       if (this.IsLookOpen) {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
@@ -15821,6 +15813,7 @@ export default {
                 taskName: q,
                 id: l + "-" + r,
                 isLook: r === 0 ? true : false,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             } else {
@@ -15828,6 +15821,7 @@ export default {
                 taskName: e,
                 id: l + "-" + r,
                 isLook: r === 0 ? true : false,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             }

+ 11 - 11
src/components/easy3/studyStudent.vue

@@ -104,11 +104,7 @@
                   <div v-if="nav.tool[0].tool != undefined">
                     <div
                       class="closeTri1"
-                      v-if="
-                        navIndex == taskCount &&
-                        nav.id == navId &&
-                        stageIndex == courseType
-                      "
+                      v-if="nav.isOpen"
                       @click="openTask(stageIndex, navIndex, nav.id)"
                     >
                       <img src="../../assets/icon/newIcons/bDown.png" alt />
@@ -153,12 +149,7 @@
                 <div
                   v-if="nav.tool[0].tool != undefined"
                   class="toolChild"
-                  :class="{
-                    toolActive:
-                      navIndex == taskCount &&
-                      nav.id == navId &&
-                      stageIndex == courseType,
-                  }"
+                  :class="{ toolActive: nav.isOpen }"
                 >
                   <div v-for="(t, toolIndex2) in nav.tool" :key="toolIndex2">
                     <div
@@ -14963,9 +14954,16 @@ export default {
           }
         }
       }
+      if(this.navList[s].task[n].isOpen == true){
+        this.navList[s].task[n].isOpen =
+        !this.navList[s].task[n].isOpen;
+        return;
+      }
       this.courseType = s;
       this.navId = i;
       this.taskCount = n;
+      this.navList[this.courseType].task[this.taskCount].isOpen =
+        !this.navList[this.courseType].task[this.taskCount].isOpen;
       if (this.IsLookOpen) {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
@@ -15676,6 +15674,7 @@ export default {
                 taskName: q,
                 id: l + "-" + r,
                 isLook: r === 0 ? true : false,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             } else {
@@ -15683,6 +15682,7 @@ export default {
                 taskName: e,
                 id: l + "-" + r,
                 isLook: r === 0 ? true : false,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             }

+ 31 - 23
src/components/studyStudent.vue

@@ -54,7 +54,11 @@
               </div>
             </el-tooltip>
           </div>
-          <div class="inviteBox" v-if="tcid && inviteCode" style="padding: 0 0 15px 0">
+          <div
+            class="inviteBox"
+            v-if="tcid && inviteCode"
+            style="padding: 0 0 15px 0"
+          >
             <div>
               <span>随机码:{{ inviteCode }}</span>
             </div>
@@ -104,9 +108,7 @@
                   <div v-if="nav.tool[0].tool != undefined">
                     <div
                       class="closeTri1"
-                      v-if="navIndex == taskCount &&
-                        nav.id == navId &&
-                        stageIndex == courseType"
+                      v-if="nav.isOpen"
                       @click="openTask(stageIndex, navIndex, nav.id)"
                     >
                       <img src="../assets/icon/newIcons/bDown.png" alt />
@@ -138,9 +140,12 @@
                       <div
                         :style="{
                           width:
-                            IsLookOpen && !(navIndex == taskCount &&
-                        nav.id == navId &&
-                        stageIndex == courseType)
+                            IsLookOpen &&
+                            !(
+                              navIndex == taskCount &&
+                              nav.id == navId &&
+                              stageIndex == courseType
+                            )
                               ? 'calc(100% - 75px)'
                               : 'auto',
                         }"
@@ -160,9 +165,7 @@
                 <div
                   v-if="nav.tool[0].tool != undefined"
                   class="toolChild"
-                  :class="{ toolActive: navIndex == taskCount &&
-                        nav.id == navId &&
-                        stageIndex == courseType }"
+                  :class="{ toolActive: nav.isOpen }"
                 >
                   <div v-for="(t, toolIndex) in nav.tool" :key="toolIndex">
                     <div
@@ -826,7 +829,9 @@
                 >
                   <div class="bzBox">
                     <div class="yCss"></div>
-                    <div :ref="'bz' + toolIndex" :id="'gj'+toolIndex">步骤{{ toolIndex + 1 }}</div>
+                    <div :ref="'bz' + toolIndex" :id="'gj' + toolIndex">
+                      步骤{{ toolIndex + 1 }}
+                    </div>
                     <div
                       v-if="timeWorkList[toolIndex].length > 0"
                       style="margin: 0 0 0 10px"
@@ -10887,11 +10892,11 @@ export default {
         !this.navList[i].task[j].tool[k].isTool;
       var a = document.scrollingElement;
 
-      let target = document.querySelector(`#gj${k}`)
+      let target = document.querySelector(`#gj${k}`);
       if (target) {
-        target.scrollIntoView(true)
+        target.scrollIntoView(true);
         setTimeout(() => {
-          a.scrollTop = a.scrollTop - 150
+          a.scrollTop = a.scrollTop - 150;
         }, 0);
       }
       // var b = this.$refs["bz" + k][0];
@@ -14168,15 +14173,16 @@ export default {
           }
         }
       }
+      if(this.navList[s].task[n].isOpen == true){
+        this.navList[s].task[n].isOpen =
+        !this.navList[s].task[n].isOpen;
+        return;
+      }
       this.courseType = s;
       this.navId = i;
       this.taskCount = n;
-      this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-        this.taskCount
-      ].isLook =
-        !this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-          this.taskCount
-        ].isLook;
+      this.navList[this.courseType].task[this.taskCount].isOpen =
+        !this.navList[this.courseType].task[this.taskCount].isOpen;
       if (this.IsLookOpen) {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
           this.taskCount
@@ -15054,6 +15060,7 @@ export default {
                 taskName: q,
                 id: l + "-" + r,
                 isLook: w[r].isLook,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             } else {
@@ -15061,6 +15068,7 @@ export default {
                 taskName: e,
                 id: l + "-" + r,
                 isLook: w[r].isLook,
+                isOpen: r === 0 ? true : false,
                 tool: [],
               });
             }
@@ -19136,10 +19144,10 @@ export default {
   border: 1px solid #ddebf8;
 }
 
-.noWorksName{
+.noWorksName {
   background: #fff;
-  color: #0061FF;
-  border: 1px solid #0061FF;
+  color: #0061ff;
+  border: 1px solid #0061ff;
 }
 
 .isWorksName2 {