lsc hace 2 años
padre
commit
26cbe1730b
Se han modificado 1 ficheros con 56 adiciones y 48 borrados
  1. 56 48
      src/components/student/studyStudent.vue

+ 56 - 48
src/components/student/studyStudent.vue

@@ -241,7 +241,7 @@
                 </div>
               </div>
               <div style="padding: 10px 30px 0"
-                v-if="chapterlist[chapterIndex].type == 3 || chapterlist[chapterIndex].type == 8 || chapterlist[chapterIndex].type == 9">
+                v-if="chapterlist[chapterIndex] && (chapterlist[chapterIndex].type == 3 || chapterlist[chapterIndex].type == 8 || chapterlist[chapterIndex].type == 9)">
                 <el-button type="primary"
                   @click="checkFileFull(chapterlist[chapterIndex].type, chapterlist[chapterIndex].src)">全屏查看</el-button>
                 <el-button type="primary" @click="downloadFile(chapterlist[chapterIndex].src)"
@@ -250,7 +250,7 @@
                   @click="openLine(chapterlist[chapterIndex].src)">打开链接
                 </el-button>
               </div>
-              <div style="padding: 10px 30px 0" v-if="chapterlist[chapterIndex].type == 6">
+              <div style="padding: 10px 30px 0" v-if="chapterlist[chapterIndex] && chapterlist[chapterIndex].type == 6">
                 <el-button type="primary"
                   @click="checkFileFull(chapterlist[chapterIndex].type, chapterlist[chapterIndex])">全屏查看</el-button>
               </div>
@@ -446,12 +446,20 @@
                       </div>
                     </div>
                   </div>
-                  <div class="homeWorkBox">
+                  <div class="homeWorkBox" v-if="tool.toolPhoto.length">
                     <div class="htitle">作业预览</div>
-                    <div class="toolPhoto" v-if="tool.toolPhoto">
-                      <img :src="tool.toolPhoto" @click="previewImg(tool.toolPhoto)">
+                    <div class="toolPhoto_box">
+                      <div class="photo_box" v-for="(photo, pIndex) in tool.toolPhoto" :key="pIndex">
+                        <div class="toolPhoto">
+                          <img :src="photo.content" @click="previewImg(photo.content)">
+                        </div>
+                        <span>{{ photo.workContent }}</span>
+                      </div>
                     </div>
                   </div>
+                  <div class="homeWorkBox" v-else>
+                    <div class="htitle">暂无作业</div>
+                  </div>
                 </div>
               </div>
             </div>
@@ -551,51 +559,28 @@
         </div>
       </div>
     </div>
-    <el-dialog
-      title="查看文档"
-      :visible.sync="fullDialogVisible"
-      :append-to-body="true"
-      width="100%"
-      :before-close="handleClose"
-      :show-close="false"
-      class="dialog_diy full_diy"
-      :class="{ full_diy2: fulltype == 9 }"
-    >
+    <el-dialog title="查看文档" :visible.sync="fullDialogVisible" :append-to-body="true" width="100%"
+      :before-close="handleClose" :show-close="false" class="dialog_diy full_diy" :class="{ full_diy2: fulltype == 9 }">
       <div slot="title" class="header-title">
         <div style="color: #fff">查看文档</div>
-        <div
-          @click="fullDialogVisible = false"
-          style="
+        <div @click="fullDialogVisible = false" style="
             cursor: pointer;
             position: absolute;
             top: 20px;
             right: 20px;
             color: #fff;
-          "
-        >
+          ">
           退出全屏
         </div>
       </div>
       <div style="height: 100%">
-        <iframe
-          v-if="fulltype == 3"
-          style="width: 100%; height: 100%; border: none"
-          :src="fullUrl"
-        ></iframe>
-        <pdf
-          v-else-if="fulltype == 9"
-          :pdfUrl="fullUrl"
-          style="width: 100%; height: 100%; overflow: auto"
-        ></pdf>
-        <div
-          class="wheel"
-          v-if="fulltype == 6"
-          style="
+        <iframe v-if="fulltype == 3" style="width: 100%; height: 100%; border: none" :src="fullUrl"></iframe>
+        <pdf v-else-if="fulltype == 9" :pdfUrl="fullUrl" style="width: 100%; height: 100%; overflow: auto"></pdf>
+        <div class="wheel" v-if="fulltype == 6" style="
             box-shadow: 0 0 6px 1px #f2f2f2;
             width: 100%;
             background: #f1f1f1;
-          "
-        >
+          ">
           <div class="title" style="width: 100%; box-sizing: border-box">
             查看文档
           </div>
@@ -606,11 +591,7 @@
               </div>
             </el-form-item>
             <!-- <div style="color: #918f8f; width: 85%">文档内容</div> -->
-            <div
-              v-html="fullUrl.url"
-              class="textContent"
-              style="height: auto"
-            ></div>
+            <div v-html="fullUrl.url" class="textContent" style="height: auto"></div>
           </el-form>
         </div>
       </div>
@@ -1270,7 +1251,7 @@ export default {
             this.chapInfo = JSON.parse(this.courseDetail.chapters)[
               this.courseType
             ];
-
+            this.chapterlist = []
             this.chapterlist = JSON.parse(JSON.stringify(a[this.taskCount].chapterData));
             this.chapterIndex = 0
             this.chapInfoList = JSON.parse(this.courseDetail.chapters);
@@ -1319,12 +1300,18 @@ export default {
                 var tool = task[j].toolArray
                 for (var z = 0; z < tool.length; z++) {
                   let _tool = tool[z]
-                  _tool.toolPhoto = ""
+                  _tool.toolPhoto = []
                   for (var k = 0; k < works.length; k++) {
                     let _work = works[k]
                     if (_work.stage == i && _work.task == j && _work.tool == z && _work.atool == _tool.tool) {
-                      _tool.toolPhoto = _work.content;
-                      break;
+                      if (_tool.tool == 1) {
+                        _work.workContent = `${_work.username}使用电子白板提交了作业`
+                      } else if (_tool.tool == 3) {
+                        _work.workContent = `${_work.username}使用思维网格提交了作业`
+                      } else if (_tool.tool == 6) {
+                        _work.workContent = `${_work.username}使用协同文档提交了作业`
+                      }
+                      _tool.toolPhoto.push(_work);
                     }
                   }
                 }
@@ -1344,12 +1331,18 @@ export default {
                 var tool = task[j].toolArray
                 for (var z = 0; z < tool.length; z++) {
                   let _tool = tool[z]
-                  _tool.toolPhoto = ""
+                  _tool.toolPhoto = []
                   for (var k = 0; k < works.length; k++) {
                     let _work = works[k]
                     if (_work.stage == i && _work.task == j && _work.tool == z && _work.atool == _tool.tool) {
-                      _tool.toolPhoto = _work.content;
-                      break;
+                      if (_tool.tool == 1) {
+                        _work.workContent = `${_work.username}使用电子白板提交了作业`
+                      } else if (_tool.tool == 3) {
+                        _work.workContent = `${_work.username}使用思维网格提交了作业`
+                      } else if (_tool.tool == 6) {
+                        _work.workContent = `${_work.username}使用协同文档提交了作业`
+                      }
+                      _tool.toolPhoto.push(_work);
                     }
                   }
                 }
@@ -5128,6 +5121,21 @@ ol {
   font-size: 18px;
 }
 
+.toolPhoto_box{
+  display: flex;
+  flex-wrap: wrap;
+}
+.photo_box {
+  margin-right: 25px;
+  display: flex;
+  align-items: flex-start;
+  flex-direction: column;
+}
+
+.photo_box > span{
+  margin-top: 10px;
+}
+
 .toolPhoto {
   width: 200px;
   height: 105px;