lsc 1 year ago
parent
commit
4c67cacc56

+ 107 - 180
src/components/easy2/studyStudent.vue

@@ -157,11 +157,9 @@
           <img src="../../assets/icon/isNoMessage.png" alt />
         </div> -->
         <div class="study_top" :class="{ pzClass: pzDialog }">
-          <div class="vedioBox" v-if="vedio[taskCount].length > 0 ||
-            chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
-              .taskDetail != '' ||
-            chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
-              .chapterData.length > 0
+          <div class="vedioBox" v-if="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+            .taskDetail != '' ||
+            vChapterData[taskCount].length > 0
             ">
             <div class="checkbox">
               <div class="check" style="font-size: 25px" :id="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].id
@@ -169,11 +167,7 @@
                 学一学
               </div>
             </div>
-            <div class="student_head" v-if="vedio[taskCount].length > 0 ||
-              textList[taskCount].length > 0 ||
-              lineList[taskCount].length > 0 ||
-              file[taskCount].length > 0 ||
-              fileC[taskCount].length > 0 ||
+            <div class="student_head" v-if="vChapterData.length > 0 ||
               chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != ''
               ">
@@ -201,15 +195,9 @@
                 <div :class="contentDialog == false
                   ? 'box_course isContentCss'
                   : 'box_course'
-                  " v-if="vedio[taskCount].length > 0 ||
-    textList[taskCount].length > 0 ||
-    lineList[taskCount].length > 0 ||
-    file[taskCount].length > 0
-    ">
-                  <div class="wheel" style="height: auto;" v-if="vedio.length &&
-                    vedio[taskCount] &&
-                    vedio[taskCount].length > 0 &&
-                    showType == 0
+                  " v-if="vChapterData.length > 0 && vChapterData[taskCount] && showType !== ''">
+                  <div class="wheel" style="height: auto;" v-if="
+                    showType === 0
                     ">
                     <div class="workd_media" style="height: 650px; width: calc(100% - 50px)">
                       <video-player class="video-player vjs-custom-skin"
@@ -264,30 +252,9 @@
                   <img src="../../assets/navBtn2.png" style="width: 25px" alt="" />
                 </div>
                 <div v-if="contentDialog == true" :style="{
-                  width: (!vedio[taskCount].length > 0 &&
-                    !textList[taskCount].length > 0 &&
-                    !lineList[taskCount].length > 0 &&
-                    !file[taskCount].length > 0 && fileC[taskCount].length) ? 'calc(100%)' : 'calc(100% - 83%)', margin: (!vedio[taskCount].length > 0 &&
-                      !textList[taskCount].length > 0 &&
-                      !lineList[taskCount].length > 0 &&
-                      !file[taskCount].length > 0 && fileC[taskCount].length) ? '0 15px' : '0 15px 0 0'
+                  width: (vChapterData[taskCount].length > 0 && showType === '') ? 'calc(100%)' : 'calc(100% - 83%)', margin: (vChapterData[taskCount].length > 0 && showType === '') ? '0 15px' : '0 15px 0 0'
                 }">
-                  <div class="vedioList" v-if="(vedio.length &&
-                    vedio[taskCount] &&
-                    vedio[taskCount].length > 0) ||
-                    (textList.length &&
-                      textList[taskCount] &&
-                      textList[taskCount].length > 0) ||
-                    (lineList.length &&
-                      lineList[taskCount] &&
-                      lineList[taskCount].length > 0) ||
-                    (file.length &&
-                      file[taskCount] &&
-                      file[taskCount].length > 0) ||
-                    (fileC.length &&
-                      fileC[taskCount] &&
-                      fileC[taskCount].length > 0)
-                    " style="height: 650px">
+                  <div class="vedioList" v-if="vChapterData[taskCount].length > 0" style="height: 650px">
                     <div class="navCorOpenBox">
                       <div class="navTitile">内容列表:</div>
                       <div class="navCorOpen" @click="setContent(false)">
@@ -295,70 +262,46 @@
                       </div>
                     </div>
                     <div class="navBox">
-                      <div v-show="vedio.length &&
-                        vedio[taskCount] &&
-                        vedio[taskCount].length > 0
+                      <div v-show="vChapterData[taskCount].length > 0
                         ">
-                        <div class="vedioTimeBox" v-for="(media, vedioIndex) in vedio[taskCount]" :key="vedioIndex + '1'"
-                          @click="lookVedio(media.url, vedioIndex)">
-                          <div class="vedioName" :class="isClickNav == 'video' + vedioIndex
+                        <div class="vedioTimeBox" v-for="(vitem, vindex) in vChapterData[taskCount]" :key="vindex + '1'">
+                          <div @click="lookVedio(vitem.url, vindex)" v-if="vitem.type == 2" class="vedioName" :class="isClickNav == vindex
                             ? 'isClickNav'
                             : ''
                             ">
-                            <span v-if="media.text">{{ media.text }}-</span>{{ media.name }}
+                            <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
                           </div>
-                        </div>
-                      </div>
-                      <div v-show="textList.length &&
-                        textList[taskCount] &&
-                        textList[taskCount].length > 0
-                        " class="newNav" v-for="(text, textIndex) in textList[taskCount]" :key="textIndex + '2'"
-                        @click="lookText(taskCount, textIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'text' + textIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            {{
-                              textList[taskCount].length > 0 ? text.name : ""
-                            }}.doc
+                          <div style="width: calc(100% - 0px)" @click="lookText(taskCount, vindex)"
+                            v-if="vitem.type == 6">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              {{
+                                vitem.name
+                              }}.doc
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div v-show="lineList.length &&
-                        lineList[taskCount] &&
-                        lineList[taskCount].length > 0
-                        " class="newNav" v-for="(lines, lineIndex) in lineList[taskCount]" :key="lineIndex + '4'"
-                        @click="doUrl(lines.url, lineIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'line' + lineIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            {{ lines.title ? lines.title : lines.url }}
+                          <div style="width: calc(100% - 0px)" @click="doUrl(vitem.url, vindex)" v-if="vitem.type == 8">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              {{ vitem.title ? vitem.title : vitem.url }}
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div class="newNav" v-show="file.length &&
-                        file[taskCount] &&
-                        file[taskCount].length > 0
-                        " v-for="(f, fileIndex) in file[taskCount]" :key="fileIndex" @click="downFile(f, fileIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'word' + fileIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
+                          <div style="width: calc(100% - 0px)" @click="downFile(vitem, vindex)" v-if="vitem.type == 3">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div class="newNav" v-show="fileC.length &&
-                        fileC[taskCount] &&
-                        fileC[taskCount].length > 0
-                        " v-for="(f, fileIndex) in fileC[taskCount]" :key="fileIndex" @click="downloadFile2(f)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText">
-                            <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
+                          <div style="width: calc(100% - 0px)" @click="downloadFile2(vitem)" v-if="vitem.type == 12">
+                            <div class="navText">
+                              <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
+                            </div>
                           </div>
                         </div>
                       </div>
@@ -370,8 +313,8 @@
                 <div style="padding: 10px 0 0; width: 95%; margin: 0 auto" v-if="showType == 2 || showType == 3">
                   <el-button type="primary" @click="checkFileFull(showType, pptImgUrl1)">全屏查看</el-button>
                   <el-button type="primary" @click="downloadFile(pptImgUrl1)"
-                    v-if="isClickNav.indexOf('line') == -1">文件下载</el-button>
-                  <el-button v-if="isClickNav.indexOf('line') != -1" type="primary" @click="openLine(pptImgUrl1)">打开链接
+                    v-if="showType != 2">文件下载</el-button>
+                  <el-button v-if="showType == 2 && pptImgUrl1.indexOf('https://view.officeapps.live.com/op/view.aspx?src=') == -1" type="primary" @click="openLine(pptImgUrl1)">打开链接
                   </el-button>
                 </div>
                 <div style="padding: 10px 0 0; width: 95%; margin: 0 auto" v-if="showType == 1">
@@ -383,8 +326,8 @@
 
           <div class="student_body" v-resize="resize">
             <div class="vedioBox" v-if="courseDetail.userid == userid ||
-            (courseDetail.course_teacher &&
-              courseDetail.course_teacher.indexOf(userid) != -1)">
+              (courseDetail.course_teacher &&
+                courseDetail.course_teacher.indexOf(userid) != -1)">
               <div class="queTop" style="
                                                       font-size: 25px;
                                                       padding: 15px 0 15px 30px;
@@ -2342,7 +2285,7 @@
                   " :people="checkJson[toolIndex]"></AnswerData>
               </div>
             </div>
-            <div class="vedioBox" v-if="noWorksS[toolIndex].length  && arrayToArray(tool.tool, isWorkTool).length">
+            <div class="vedioBox" v-if="noWorksS[toolIndex].length && arrayToArray(tool.tool, isWorkTool).length">
               <div class="queTop" style="
                                                       font-size: 25px;
                                                       padding: 15px 0 15px 30px;
@@ -5510,7 +5453,7 @@
                                                   margin: 0 10px 10px 0;
                                                 " v-for="(item, index) in plworkFile" :key="index">
             <div class="upCover2">
-              <img :src="item.url" alt v-if="item.fileType == 1" @click="previewImg(item.url)"/>
+              <img :src="item.url" alt v-if="item.fileType == 1" @click="previewImg(item.url)" />
               <img :src="word" alt v-else-if="item.fileType == 4" />
               <img :src="video" alt v-else />
               <!-- <span class="picName">{{ item.name }}</span> -->
@@ -5904,6 +5847,7 @@ export default {
       videoJson: {},
       toolType: 0,
       checktoolArray: [],
+      vChapterData: [],
     };
   },
   methods: {
@@ -8782,6 +8726,7 @@ export default {
               "OGM",
               "MP3",
             ];
+            let _chapterData = []
 
             for (var i = 0; i < a.length; i++) {
               var c = a[i].chapterData;
@@ -8791,6 +8736,7 @@ export default {
               this.chapToolList[i] = [];
               this.file[i] = [];
               this.fileC[i] = [];
+              _chapterData[i] = c
               for (var j = 0; j < c.length; j++) {
                 if (c[j].type == 7) {
                   this.chapToolList[i].push(c[j]);
@@ -8846,27 +8792,18 @@ export default {
               }
             }
             if (
-              !this.vedio[this.taskCount][0] ||
-              this.vedio[this.taskCount][0].url == ""
+              _chapterData[this.taskCount].length &&
+              _chapterData[this.taskCount][0].type == 2
             ) {
+              this.showType = 0
+            } else {
               if (
-                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                  this.taskCount
-                ].chapterData.length > 0
+                _chapterData[this.taskCount].length > 0
               ) {
-                // if (
-                //   this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                //     this.taskCount
-                //   ].chapterData[0].type != 8
-                // ) {
                 let _url =
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].url;
+                _chapterData[this.taskCount][0].url;
                 if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 8
+                  _chapterData[this.taskCount][0].type == 8
                 ) {
                   this.showType = 2;
                   if (
@@ -8876,11 +8813,8 @@ export default {
                     _url = "https://" + _url;
                   }
                   this.pptImgUrl1 = _url;
-                  this.isClickNav = "line0";
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 3
+                  _chapterData[this.taskCount][0].type == 3
                 ) {
                   if (
                     _url
@@ -8889,7 +8823,6 @@ export default {
                   ) {
                     this.showType = 3;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else if (
                     this.isAssetTypeAnImage(
                       _url
@@ -8899,27 +8832,27 @@ export default {
                   ) {
                     this.showType = 4;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else {
                     this.showType = 2;
                     this.pptImgUrl1 =
                       "https://view.officeapps.live.com/op/view.aspx?src=" +
                       _url;
-                    this.isClickNav = "word0";
                   }
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 6
+                  _chapterData[this.taskCount][0].type == 6
                 ) {
                   this.showType = 1;
                   this.text = this.textList[this.taskCount][0];
-                  this.isClickNav = "text0";
                 }
               }
-            } else {
-              this.isClickNav = "video0";
             }
+            this.isClickNav = 0;
+            if(!_chapterData[this.taskCount].length || _chapterData[this.taskCount][0].type == 12){
+              this.isClickNav = '';
+              this.showType = ''
+            }
+
+            this.vChapterData = _chapterData
             if (this.toolIndex == null && this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose.length) {
               this.toolIndex = 0
               this.tool = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex]
@@ -8962,6 +8895,8 @@ export default {
               "MP3",
             ];
 
+            let _chapterData = []
+
             for (var i = 0; i < a.length; i++) {
               var c = a[i].chapterData;
               this.vedio[i] = [];
@@ -8970,6 +8905,7 @@ export default {
               this.chapToolList[i] = [];
               this.file[i] = [];
               this.fileC[i] = [];
+              _chapterData[i] = c
               for (var j = 0; j < c.length; j++) {
                 if (c[j].type == 7) {
                   this.chapToolList[i].push(c[j]);
@@ -8999,27 +8935,18 @@ export default {
               this.playerO[i] = d;
             }
             if (
-              !this.vedio[this.taskCount][0] ||
-              this.vedio[this.taskCount][0].url == ""
+              _chapterData[this.taskCount].length &&
+              _chapterData[this.taskCount][0].type == 2
             ) {
+              this.showType = 0
+            } else {
               if (
-                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                  this.taskCount
-                ].chapterData.length > 0
+                _chapterData[this.taskCount].length > 0
               ) {
-                // if (
-                //   this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                //     this.taskCount
-                //   ].chapterData[0].type != 8
-                // ) {
                 let _url =
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].url;
+                _chapterData[this.taskCount][0].url;
                 if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 8
+                  _chapterData[this.taskCount][0].type == 8
                 ) {
                   this.showType = 2;
                   if (
@@ -9029,11 +8956,8 @@ export default {
                     _url = "https://" + _url;
                   }
                   this.pptImgUrl1 = _url;
-                  this.isClickNav = "line0";
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 3
+                  _chapterData[this.taskCount][0].type == 3
                 ) {
                   if (
                     _url
@@ -9042,7 +8966,6 @@ export default {
                   ) {
                     this.showType = 3;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else if (
                     this.isAssetTypeAnImage(
                       _url
@@ -9052,27 +8975,26 @@ export default {
                   ) {
                     this.showType = 4;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else {
                     this.showType = 2;
                     this.pptImgUrl1 =
                       "https://view.officeapps.live.com/op/view.aspx?src=" +
                       _url;
-                    this.isClickNav = "word0";
                   }
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 6
+                  _chapterData[this.taskCount][0].type == 6
                 ) {
                   this.showType = 1;
                   this.text = this.textList[this.taskCount][0];
-                  this.isClickNav = "text0";
                 }
               }
-            } else {
-              this.isClickNav = "video0";
             }
+            this.isClickNav = 0;
+            if(!_chapterData[this.taskCount].length || _chapterData[this.taskCount][0].type == 12){
+              this.isClickNav = '';
+              this.showType = ''
+            }
+            this.vChapterData = _chapterData
             this.$forceUpdate();
           }
 
@@ -9558,15 +9480,18 @@ export default {
       d.sources[0].src = u;
       this.playerO[this.taskCount] = d;
       this.showType = 0;
-      this.isClickNav = "video" + i;
+      // this.isClickNav = "video" + i;
+      this.isClickNav = i;
       this.$forceUpdate();
     },
     lookText(i, t) {
       this.isClickNav = "";
-      this.text = this.textList[i][t];
+      // this.text = this.textList[i][t];
+      this.text = this.vChapterData[i][t];
       // this.dialogVisible1 = true;
       this.showType = 1;
-      this.isClickNav = "text" + t;
+      // this.isClickNav = "text" + t;
+      this.isClickNav = t;
     },
     lookTools(i, t) {
       this.chapTools = this.chapToolList[i][t];
@@ -9609,7 +9534,8 @@ export default {
         url = "https://" + url;
       }
       this.pptImgUrl1 = url;
-      this.isClickNav = "line" + i;
+      // this.isClickNav = "line" + i;
+      this.isClickNav = i;
     },
     downFile(f, i) {
       this.isClickNav = "";
@@ -9641,7 +9567,8 @@ export default {
       } else {
         window.open(this.file[i].url);
       }
-      this.isClickNav = "word" + i;
+      // this.isClickNav = "word" + i;
+      this.isClickNav = i;
     },
     downFileList(i) {
       window.open(this.noImgList[i].url);
@@ -10201,7 +10128,7 @@ export default {
         }
         this.plworkFile = [];
         this.uploadCid = this.tcid ? this.tcid : this.courseDetail.juri
-        if(!this.uploadCid){
+        if (!this.uploadCid) {
           this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
           return;
         }
@@ -10784,10 +10711,10 @@ export default {
       this.worksSName = n;
       this.toolindex = i
       this.uploadCid = this.tcid ? this.tcid : this.courseDetail.juri
-      if(!this.uploadCid){
-          this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
-          return;
-        }
+      if (!this.uploadCid) {
+        this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
+        return;
+      }
       this.selectUploadStudent()
       this.dialogVisibleSname = true;
     },
@@ -11376,7 +11303,7 @@ export default {
     },
     openTools2(i) {
       this.$message.error('暂未开放')
-        return;
+      return;
     },
     addTools2(i) {
       if (i == 4) {
@@ -11446,14 +11373,14 @@ export default {
       }
       this.$forceUpdate();
     },
-    addToolChoose(){
-      if(!this.checktoolArray.length){
+    addToolChoose() {
+      if (!this.checktoolArray.length) {
         this.$message.error('请选择要添加的任务')
         return;
       }
-      if(!this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool.length){
+      if (!this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool.length) {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool = this.checktoolArray
-      }else{
+      } else {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose.push({
           tool: this.checktoolArray,
           toolDetail: "",
@@ -11462,7 +11389,7 @@ export default {
           askTitle: "",
           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
         })
-        
+
       }
 
       let params = [
@@ -15053,7 +14980,7 @@ ol {
 
 .toolSort>div {
   margin: 0 45px 0 0;
-    width: auto;
+  width: auto;
 }
 
 .tools {
@@ -15109,9 +15036,9 @@ ol {
   margin-left: 5px;
   color: #858585;
 }
+
 .check img {
   width: 20px;
   height: 20px;
 }
-
 </style>

+ 93 - 157
src/components/easy3/studyStudent.vue

@@ -157,11 +157,9 @@
           <img src="../../assets/icon/isNoMessage.png" alt />
         </div> -->
         <div class="study_top" :class="{ pzClass: pzDialog }">
-          <div class="vedioBox" v-if="vedio[0].length > 0 ||
-            chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+          <div class="vedioBox" v-if="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
               .taskDetail != '' ||
-            chapInfoList[courseType].chapterInfo[0].taskJson[0]
-              .chapterData.length > 0
+            vChapterData[0].length > 0
             ">
             <div class="checkbox">
               <div class="check" style="font-size: 25px" :id="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].id
@@ -169,11 +167,7 @@
                 学一学
               </div>
             </div>
-            <div class="student_head" v-if="vedio[0].length > 0 ||
-              textList[0].length > 0 ||
-              lineList[0].length > 0 ||
-              file[0].length > 0 ||
-              fileC[0].length > 0 ||
+            <div class="student_head" v-if="vChapterData[0].length > 0 ||
               chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != ''
               ">
@@ -201,21 +195,13 @@
                 <div :class="contentDialog == false
                   ? 'box_course isContentCss'
                   : 'box_course'
-                  " v-if="vedio[0].length > 0 ||
-    textList[0].length > 0 ||
-    lineList[0].length > 0 ||
-    file[0].length > 0
-    ">
-                  <div class="wheel" style="height: auto;" v-if="vedio.length &&
-                    vedio[0] &&
-                    vedio[0].length > 0 &&
-                    showType == 0
+                  " v-if="vChapterData.length > 0 && vChapterData[0] && showType !== ''">
+                  <div class="wheel" style="height: auto;" v-if="showType === 0
                     ">
                     <div class="workd_media" style="height: 650px; width: calc(100% - 50px)">
                       <video-player class="video-player vjs-custom-skin"
-                        :class="contentDialog == false ? 'isAllWidth' : ''" :playsinline="true"
-                        :options="playerO[0]" @play="onPlayerPlay($event)"
-                        style="width: 100%; height: 100%; margin: 0 0 0 30px"></video-player>
+                        :class="contentDialog == false ? 'isAllWidth' : ''" :playsinline="true" :options="playerO[0]"
+                        @play="onPlayerPlay($event)" style="width: 100%; height: 100%; margin: 0 0 0 30px"></video-player>
                     </div>
                   </div>
                   <div class="wheel" v-if="showType == 1" style="
@@ -264,30 +250,9 @@
                   <img src="../../assets/navBtn2.png" style="width: 25px" alt="" />
                 </div>
                 <div v-if="contentDialog == true" :style="{
-                  width: (!vedio[0].length > 0 &&
-                    !textList[0].length > 0 &&
-                    !lineList[0].length > 0 &&
-                    !file[0].length > 0 && fileC[0].length) ? 'calc(100%)' : 'calc(100% - 83%)', margin: (!vedio[0].length > 0 &&
-                      !textList[0].length > 0 &&
-                      !lineList[0].length > 0 &&
-                      !file[0].length > 0 && fileC[0].length) ? '0 15px' : '0 15px 0 0'
+                  width: (vChapterData[0].length > 0 && showType === '') ? 'calc(100%)' : 'calc(100% - 83%)', margin: (vChapterData[0].length > 0 && showType === '') ? '0 15px' : '0 15px 0 0'
                 }">
-                  <div class="vedioList" v-if="(vedio.length &&
-                    vedio[0] &&
-                    vedio[0].length > 0) ||
-                    (textList.length &&
-                      textList[0] &&
-                      textList[0].length > 0) ||
-                    (lineList.length &&
-                      lineList[0] &&
-                      lineList[0].length > 0) ||
-                    (file.length &&
-                      file[0] &&
-                      file[0].length > 0) ||
-                    (fileC.length &&
-                      fileC[0] &&
-                      fileC[0].length > 0)
-                    " style="height: 650px">
+                  <div class="vedioList" v-if="vChapterData[0].length > 0" style="height: 650px">
                     <div class="navCorOpenBox">
                       <div class="navTitile">内容列表:</div>
                       <div class="navCorOpen" @click="setContent(false)">
@@ -295,70 +260,45 @@
                       </div>
                     </div>
                     <div class="navBox">
-                      <div v-show="vedio.length &&
-                        vedio[0] &&
-                        vedio[0].length > 0
+                      <div v-show="vChapterData[0].length > 0
                         ">
-                        <div class="vedioTimeBox" v-for="(media, vedioIndex) in vedio[0]" :key="vedioIndex + '1'"
-                          @click="lookVedio(media.url, vedioIndex)">
-                          <div class="vedioName" :class="isClickNav == 'video' + vedioIndex
+                        <div class="vedioTimeBox" v-for="(vitem, vindex) in vChapterData[0]" :key="vindex + '1'">
+                          <div @click="lookVedio(vitem.url, vindex)" v-if="vitem.type == 2" class="vedioName" :class="isClickNav == vindex
                             ? 'isClickNav'
                             : ''
                             ">
-                            <span v-if="media.text">{{ media.text }}-</span>{{ media.name }}
+                            <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
                           </div>
-                        </div>
-                      </div>
-                      <div v-show="textList.length &&
-                        textList[0] &&
-                        textList[0].length > 0
-                        " class="newNav" v-for="(text, textIndex) in textList[0]" :key="textIndex + '2'"
-                        @click="lookText(0, textIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'text' + textIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            {{
-                              textList[0].length > 0 ? text.name : ""
-                            }}.doc
+                          <div style="width: calc(100% - 0px)" @click="lookText(0, vindex)" v-if="vitem.type == 6">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              {{
+                                vitem.name
+                              }}.doc
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div v-show="lineList.length &&
-                        lineList[0] &&
-                        lineList[0].length > 0
-                        " class="newNav" v-for="(lines, lineIndex) in lineList[0]" :key="lineIndex + '4'"
-                        @click="doUrl(lines.url, lineIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'line' + lineIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            {{ lines.title ? lines.title : lines.url }}
+                          <div style="width: calc(100% - 0px)" @click="doUrl(vitem.url, vindex)" v-if="vitem.type == 8">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              {{ vitem.title ? vitem.title : vitem.url }}
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div class="newNav" v-show="file.length &&
-                        file[0] &&
-                        file[0].length > 0
-                        " v-for="(f, fileIndex) in file[0]" :key="fileIndex" @click="downFile(f, fileIndex)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText" :class="isClickNav == 'word' + fileIndex
-                            ? 'isClickNav'
-                            : ''
-                            ">
-                            <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
+                          <div style="width: calc(100% - 0px)" @click="downFile(vitem, vindex)" v-if="vitem.type == 3">
+                            <div class="navText" :class="isClickNav == vindex
+                              ? 'isClickNav'
+                              : ''
+                              ">
+                              <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
+                            </div>
                           </div>
-                        </div>
-                      </div>
-                      <div class="newNav" v-show="fileC.length &&
-                        fileC[0] &&
-                        fileC[0].length > 0
-                        " v-for="(f, fileIndex) in fileC[0]" :key="fileIndex" @click="downloadFile2(f)">
-                        <div style="width: calc(100% - 0px)">
-                          <div class="navText">
-                            <span v-if="f.text">{{ f.text }}-</span>{{ f.name }}
+                          <div style="width: calc(100% - 0px)" @click="downloadFile2(vitem)" v-if="vitem.type == 12">
+                            <div class="navText">
+                              <span v-if="vitem.text">{{ vitem.text }}-</span>{{ vitem.name }}
+                            </div>
                           </div>
                         </div>
                       </div>
@@ -369,9 +309,10 @@
               <div style="width: 81%">
                 <div style="padding: 10px 0 0; width: 95%; margin: 0 auto" v-if="showType == 2 || showType == 3">
                   <el-button type="primary" @click="checkFileFull(showType, pptImgUrl1)">全屏查看</el-button>
-                  <el-button type="primary" @click="downloadFile(pptImgUrl1)"
-                    v-if="isClickNav.indexOf('line') == -1">文件下载</el-button>
-                  <el-button v-if="isClickNav.indexOf('line') != -1" type="primary" @click="openLine(pptImgUrl1)">打开链接
+                  <el-button type="primary" @click="downloadFile(pptImgUrl1)" v-if="showType != 2">文件下载</el-button>
+                  <el-button
+                    v-if="showType == 2 && pptImgUrl1.indexOf('https://view.officeapps.live.com/op/view.aspx?src=') == -1"
+                    type="primary" @click="openLine(pptImgUrl1)">打开链接
                   </el-button>
                 </div>
                 <div style="padding: 10px 0 0; width: 95%; margin: 0 auto" v-if="showType == 1">
@@ -383,8 +324,8 @@
 
           <div class="student_body" v-resize="resize">
             <div class="vedioBox" v-if="courseDetail.userid == userid ||
-            (courseDetail.course_teacher &&
-              courseDetail.course_teacher.indexOf(userid) != -1)">
+              (courseDetail.course_teacher &&
+                courseDetail.course_teacher.indexOf(userid) != -1)">
               <div class="queTop" style="
                                                       font-size: 25px;
                                                       padding: 15px 0 15px 30px;
@@ -2342,7 +2283,7 @@
                   " :people="checkJson[toolIndex]"></AnswerData>
               </div>
             </div>
-            <div class="vedioBox" v-if="noWorksS[toolIndex].length  && arrayToArray(tool.tool, isWorkTool).length">
+            <div class="vedioBox" v-if="noWorksS[toolIndex].length && arrayToArray(tool.tool, isWorkTool).length">
               <div class="queTop" style="
                                                       font-size: 25px;
                                                       padding: 15px 0 15px 30px;
@@ -5510,7 +5451,7 @@
                                                   margin: 0 10px 10px 0;
                                                 " v-for="(item, index) in plworkFile" :key="index">
             <div class="upCover2">
-              <img :src="item.url" alt v-if="item.fileType == 1" @click="previewImg(item.url)"/>
+              <img :src="item.url" alt v-if="item.fileType == 1" @click="previewImg(item.url)" />
               <img :src="word" alt v-else-if="item.fileType == 4" />
               <img :src="video" alt v-else />
               <!-- <span class="picName">{{ item.name }}</span> -->
@@ -5904,6 +5845,7 @@ export default {
       videoJson: {},
       toolType: 0,
       checktoolArray: [],
+      vChapterData: [],
     };
   },
   methods: {
@@ -8783,6 +8725,8 @@ export default {
               "MP3",
             ];
 
+            let _chapterData = []
+
             for (var i = 0; i < a.length; i++) {
               var c = a[i].chapterData;
               this.vedio[i] = [];
@@ -8791,6 +8735,7 @@ export default {
               this.chapToolList[i] = [];
               this.file[i] = [];
               this.fileC[i] = [];
+              _chapterData[i] = c
               for (var j = 0; j < c.length; j++) {
                 if (c[j].type == 7) {
                   this.chapToolList[i].push(c[j]);
@@ -8847,27 +8792,18 @@ export default {
             }
             let taskCount = 0
             if (
-              !this.vedio[taskCount][0] ||
-              this.vedio[taskCount][0].url == ""
+              _chapterData[taskCount].length &&
+              _chapterData[taskCount][0].type == 2
             ) {
+              this.showType = 0
+            } else {
               if (
-                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                  taskCount
-                ].chapterData.length > 0
+                _chapterData[taskCount].length > 0
               ) {
-                // if (
-                //   this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                //     taskCount
-                //   ].chapterData[0].type != 8
-                // ) {
                 let _url =
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    taskCount
-                  ].chapterData[0].url;
+                  _chapterData[taskCount][0].url;
                 if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    taskCount
-                  ].chapterData[0].type == 8
+                  _chapterData[taskCount][0].type == 8
                 ) {
                   this.showType = 2;
                   if (
@@ -8877,11 +8813,8 @@ export default {
                     _url = "https://" + _url;
                   }
                   this.pptImgUrl1 = _url;
-                  this.isClickNav = "line0";
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    taskCount
-                  ].chapterData[0].type == 3
+                  _chapterData[taskCount][0].type == 3
                 ) {
                   if (
                     _url
@@ -8890,7 +8823,6 @@ export default {
                   ) {
                     this.showType = 3;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else if (
                     this.isAssetTypeAnImage(
                       _url
@@ -8900,34 +8832,33 @@ export default {
                   ) {
                     this.showType = 4;
                     this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
                   } else {
                     this.showType = 2;
                     this.pptImgUrl1 =
                       "https://view.officeapps.live.com/op/view.aspx?src=" +
                       _url;
-                    this.isClickNav = "word0";
                   }
                 } else if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    taskCount
-                  ].chapterData[0].type == 6
+                  _chapterData[taskCount][0].type == 6
                 ) {
                   this.showType = 1;
                   this.text = this.textList[taskCount][0];
-                  this.isClickNav = "text0";
                 }
               }
-            } else {
-              this.showType = 0
-              this.isClickNav = "video0";
             }
+            this.isClickNav = 0;
+            if (_chapterData[taskCount].length || _chapterData[taskCount][0].type == 12) {
+              this.isClickNav = '';
+              this.showType = ''
+            }
+
+            this.vChapterData = _chapterData
             if (this.toolIndex == null && this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose.length) {
               this.toolIndex = 0
               this.tool = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex]
             }
 
-          } else{
+          } else {
             if (this.toolIndex == null && this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose.length) {
               this.toolIndex = 0
               this.tool = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[this.toolIndex]
@@ -9414,17 +9345,20 @@ export default {
       // this.playerOptions.sources[0].src = u;
       var d = JSON.parse(JSON.stringify(this.playerOptions));
       d.sources[0].src = u;
-      this.playerO[this.taskCount] = d;
+      this.playerO[0] = d;
       this.showType = 0;
-      this.isClickNav = "video" + i;
+      // this.isClickNav = "video" + i;
+      this.isClickNav = i;
       this.$forceUpdate();
     },
     lookText(i, t) {
       this.isClickNav = "";
-      this.text = this.textList[i][t];
+      // this.text = this.textList[i][t];
+      this.text = this.vChapterData[i][t];
       // this.dialogVisible1 = true;
       this.showType = 1;
-      this.isClickNav = "text" + t;
+      // this.isClickNav = "text" + t;
+      this.isClickNav = t;
     },
     lookTools(i, t) {
       this.chapTools = this.chapToolList[i][t];
@@ -9467,7 +9401,8 @@ export default {
         url = "https://" + url;
       }
       this.pptImgUrl1 = url;
-      this.isClickNav = "line" + i;
+      // this.isClickNav = "line" + i;
+      this.isClickNav = i;
     },
     downFile(f, i) {
       this.isClickNav = "";
@@ -9499,7 +9434,8 @@ export default {
       } else {
         window.open(this.file[i].url);
       }
-      this.isClickNav = "word" + i;
+      this.isClickNav = i;
+      // this.isClickNav = "word" + i;
     },
     downFileList(i) {
       window.open(this.noImgList[i].url);
@@ -10059,7 +9995,7 @@ export default {
         }
         this.plworkFile = [];
         this.uploadCid = this.tcid ? this.tcid : this.courseDetail.juri
-        if(!this.uploadCid){
+        if (!this.uploadCid) {
           this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
           return;
         }
@@ -10642,10 +10578,10 @@ export default {
       this.worksSName = n;
       this.toolindex = i
       this.uploadCid = this.tcid ? this.tcid : this.courseDetail.juri
-      if(!this.uploadCid){
-          this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
-          return;
-        }
+      if (!this.uploadCid) {
+        this.$message.error("提示:批量上传未添加班级权限,请添加班级或从班级入口进入。");
+        return;
+      }
       this.selectUploadStudent()
       this.dialogVisibleSname = true;
     },
@@ -11234,7 +11170,7 @@ export default {
     },
     openTools2(i) {
       this.$message.error('暂未开放')
-        return;
+      return;
     },
     addTools2(i) {
       if (i == 4) {
@@ -11304,14 +11240,14 @@ export default {
       }
       this.$forceUpdate();
     },
-    addToolChoose(){
-      if(!this.checktoolArray.length){
+    addToolChoose() {
+      if (!this.checktoolArray.length) {
         this.$message.error('请选择要添加的任务')
         return;
       }
-      if(!this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool.length){
+      if (!this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool.length) {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose[0].tool = this.checktoolArray
-      }else{
+      } else {
         this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].toolChoose.push({
           tool: this.checktoolArray,
           toolDetail: "",
@@ -11320,7 +11256,7 @@ export default {
           askTitle: "",
           askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
         })
-        
+
       }
 
       let params = [
@@ -14911,7 +14847,7 @@ ol {
 
 .toolSort>div {
   margin: 0 45px 0 0;
-    width: auto;
+  width: auto;
 }
 
 .tools {
@@ -14967,9 +14903,9 @@ ol {
   margin-left: 5px;
   color: #858585;
 }
+
 .check img {
   width: 20px;
   height: 20px;
 }
-
 </style>

File diff suppressed because it is too large
+ 228 - 619
src/components/studyStudent.vue


+ 19 - 0
src/components/tools/message.js

@@ -0,0 +1,19 @@
+// resetMessage.js
+// 重置message,防止重复点击重复弹出message弹框
+import { Message } from 'element-ui'
+
+let messageDom = null
+const resetMessage = (options) => {
+  if (messageDom) messageDom.close() // 判断弹窗是否已存在,若存在则关闭
+  messageDom = Message(options)
+}
+// message类型
+const typeArr = ['success', 'error', 'warning', 'info']
+typeArr.forEach(type => {
+  resetMessage[type] = options => {
+    if (typeof options === 'string') options = { message: options }
+    options.type = type
+    return resetMessage(options)
+  }
+})
+export const myMessage = resetMessage

+ 5 - 2
src/main.js

@@ -4,7 +4,9 @@ import Vue from 'vue'
 import App from './App'
 import router from './router'
 import store from './config/config'
-import { Message, Loading } from 'element-ui';
+import {  Loading } from 'element-ui';
+// Message,
+import { myMessage } from './components/tools/message';
 import ajax from './common/axios.config'
 import qs from 'qs'
 import './common/player.css'
@@ -26,7 +28,8 @@ Vue.prototype.$equipment=function(){
 Vue.config.productionTip = false
 Vue.prototype.$store = store; // 将store实例挂在vue原型上
 Vue.prototype.ajax = ajax
-Vue.prototype.$message = Message
+// Vue.prototype.$message = Message
+Vue.prototype.$message = myMessage
 Vue.prototype.$loading = Loading
 Vue.prototype.openLoading = function(target) {
     const loading = this.$loading.service({ // 声明一个loading对象

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