zengyicheng 3 vuotta sitten
vanhempi
commit
7f7a0778ca
1 muutettua tiedostoa jossa 270 lisäystä ja 196 poistoa
  1. 270 196
      src/components/study.vue

+ 270 - 196
src/components/study.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="pb_content" style="overflow: unset">
+  <div class="pb_content" style="overflow: unset; background: #eff7ff">
     <div
       class="pb_content_body"
       style="display: flex; height: 900px; position: relative"
@@ -58,7 +58,14 @@
       <div class="body_student">
         <div
           class="new_top"
-          style="position: fixed; top: 0; left: 20.7%; width: 80%; z-index: 999"
+          style="
+            position: fixed;
+            top: 0;
+            left: 20.7%;
+            width: 80%;
+            z-index: 999;
+            box-shadow: 0px 9px 0 0 #e4eef6;
+          "
         >
           <div class="courseIndex">
             <div>第{{ courseType - 0 + 1 }}阶段</div>
@@ -126,40 +133,39 @@
                   .taskDetail != ''
               "
             >
-              <div class="vedioTaskBox">
-                <div class="taskBox">
+              <div class="taskBox">
+                <div
+                  style="
+                    display: flex;
+                    flex-wrap: nowrap;
+                    flex-direction: column;
+                    position: relative;
+                  "
+                >
                   <div
                     style="
-                      display: flex;
-                      flex-wrap: nowrap;
-                      flex-direction: column;
-                      position: relative;
+                      padding: 20px;
+                      line-height: 30px;
+                      max-height: 105px;
+                      overflow: auto;
+                    "
+                    v-if="
+                      chapInfoList[courseType].chapterInfo[0].taskJson[
+                        taskCount
+                      ].taskDetail != ''
+                    "
+                    v-html="
+                      chapInfoList[courseType].chapterInfo[0].taskJson[
+                        taskCount
+                      ].taskDetail
+                        ? chapInfoList[courseType].chapterInfo[0].taskJson[
+                            taskCount
+                          ].taskDetail
+                        : '暂无描述'
                     "
                   >
-                    <div
-                      style="
-                        padding: 20px;
-                        line-height: 30px;
-                        max-height: 105px;
-                        overflow: auto;
-                      "
-                      v-if="
-                        chapInfoList[courseType].chapterInfo[0].taskJson[
-                          taskCount
-                        ].taskDetail != ''
-                      "
-                      v-html="
-                        chapInfoList[courseType].chapterInfo[0].taskJson[
-                          taskCount
-                        ].taskDetail
-                          ? chapInfoList[courseType].chapterInfo[0].taskJson[
-                              taskCount
-                            ].taskDetail
-                          : '暂无描述'
-                      "
-                    >
-                      <!-- <span style="color: #cbcbcb">任务描述</span> -->
-                      <!-- {{
+                    <!-- <span style="color: #cbcbcb">任务描述</span> -->
+                    <!-- {{
                         chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                         ].taskDetail
@@ -168,9 +174,10 @@
                             ].taskDetail
                           : "暂无描述"
                       }}-->
-                    </div>
                   </div>
                 </div>
+              </div>
+              <div class="vedioTaskBox">
                 <div
                   class="box_course"
                   v-if="
@@ -242,84 +249,108 @@
                     ></pdf>
                   </div>
                 </div>
-              </div>
-
-              <div
-                class="vedioList"
-                :class="vedio[taskCount].length == 0 ? 'listNoVedio' : ''"
-                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)
-                "
-              >
-                <div style="padding: 15px 0 5px 15px">内容列表:</div>
-                <div class="navBox">
-                  <div
-                    v-show="
-                      vedio.length &&
+                <div
+                  class="vedioList"
+                  :class="vedio[taskCount].length == 0 ? 'listNoVedio' : ''"
+                  v-if="
+                    (vedio.length &&
                       vedio[taskCount] &&
-                      vedio[taskCount].length > 0
-                    "
-                  >
-                    <div class="vedioNav">视频</div>
+                      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)
+                  "
+                >
+                  <div class="navTitile">内容列表:</div>
+                  <div class="navBox">
                     <div
-                      class="vedioTimeBox"
-                      v-for="(media, vedioIndex) in vedio[taskCount]"
-                      :key="vedioIndex + '1'"
+                      v-show="
+                        vedio.length &&
+                        vedio[taskCount] &&
+                        vedio[taskCount].length > 0
+                      "
                     >
                       <div
-                        class="media"
-                        style="width: 90px; height: 60px; position: relative"
+                        class="vedioNav"
+                        style="
+                          width: 80px;
+                          min-width: 80px;
+                          height: 30px;
+                          line-height: 36px;
+                          font-size: 16px;
+                          border-radius: 10px;
+                        "
+                      >
+                        视频
+                      </div>
+                      <div
+                        class="vedioTimeBox"
+                        v-for="(media, vedioIndex) in vedio[taskCount]"
+                        :key="vedioIndex + '1'"
                       >
-                        <img
-                          style="height: 90px; width: 160px"
-                          :src="
-                            media.cover != null && media.cover != ''
-                              ? JSON.parse(media.cover).length > 0
-                                ? JSON.parse(media.cover)[0].url
+                        <div
+                          class="media"
+                          style="width: 90px; height: 60px; position: relative"
+                        >
+                          <img
+                            style="height: 90px; width: 160px"
+                            :src="
+                              media.cover != null && media.cover != ''
+                                ? JSON.parse(media.cover).length > 0
+                                  ? JSON.parse(media.cover)[0].url
+                                  : mr
                                 : mr
-                              : mr
-                          "
-                          alt
-                          @click="lookVedio(media.url)"
-                        />
-                        <div class="vedioTime">{{ vedioTime }}</div>
-                        <!-- <div class="vedioName">{{ media.name }}</div> -->
+                            "
+                            alt
+                            @click="lookVedio(media.url)"
+                          />
+                          <div class="vedioTime">{{ vedioTime }}</div>
+                          <!-- <div class="vedioName">{{ media.name }}</div> -->
+                        </div>
+                        <div class="vedioName">{{ media.name }}</div>
                       </div>
-                      <div class="vedioName">{{ media.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'"
-                  >
-                    <div class="vedioNav">文档</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'"
+                    >
                       <div
-                        class="navText"
-                        @click="lookText(taskCount, textIndex)"
+                        class="vedioNav"
+                        style="
+                          width: 80px;
+                          min-width: 80px;
+                          height: 30px;
+                          line-height: 36px;
+                          font-size: 16px;
+                          border-radius: 10px;
+                        "
                       >
-                        {{
-                          textList[taskCount].length > 0 ? text.name : ""
-                        }}.doc
+                        文档
+                      </div>
+                      <div>
+                        <div
+                          class="navText"
+                          @click="lookText(taskCount, textIndex)"
+                        >
+                          {{
+                            textList[taskCount].length > 0 ? text.name : ""
+                          }}.doc
+                        </div>
                       </div>
                     </div>
-                  </div>
-                  <!-- <div
+                    <!-- <div
                     v-show="
                       chapInfoList.length &&
                       chapToolList[taskCount] &&
@@ -341,42 +372,67 @@
                       </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'"
-                  >
-                    <div class="vedioNav">链接</div>
-                    <div>
-                      <div class="navText">
-                        <a
-                          style="text-decoration: none; color: #000"
-                          target="_Blank"
-                          :href="'https://' + lines.url"
-                          >{{ lines.url }}</a
-                        >
+                    <div
+                      v-show="
+                        lineList.length &&
+                        lineList[taskCount] &&
+                        lineList[taskCount].length > 0
+                      "
+                      class="newNav"
+                      v-for="(lines, lineIndex) in lineList[taskCount]"
+                      :key="lineIndex + '4'"
+                    >
+                      <div
+                        class="vedioNav"
+                        style="
+                          width: 80px;
+                          min-width: 80px;
+                          height: 30px;
+                          line-height: 36px;
+                          font-size: 16px;
+                          border-radius: 10px;
+                        "
+                      >
+                        链接
+                      </div>
+                      <div>
+                        <div class="navText">
+                          <a
+                            style="text-decoration: none; color: #000"
+                            target="_Blank"
+                            :href="'https://' + lines.url"
+                            >{{ lines.url }}</a
+                          >
+                        </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"
-                  >
-                    <div class="vedioNav">文档</div>
-                    <div>
-                      <div class="navText" @click="downFile(f, fileIndex)">
-                        {{ f.name }}
+                    <div
+                      class="newNav"
+                      v-show="
+                        file.length &&
+                        file[taskCount] &&
+                        file[taskCount].length > 0
+                      "
+                      v-for="(f, fileIndex) in file[taskCount]"
+                      :key="fileIndex"
+                    >
+                      <div
+                        class="vedioNav"
+                        style="
+                          width: 80px;
+                          min-width: 80px;
+                          height: 30px;
+                          line-height: 36px;
+                          font-size: 16px;
+                          border-radius: 10px;
+                        "
+                      >
+                        文档
+                      </div>
+                      <div>
+                        <div class="navText" @click="downFile(f, fileIndex)">
+                          {{ f.name }}
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -645,9 +701,10 @@
                     >
                       <div
                         class="works"
-                        style="width: 240px; height: 170px"
+                        style="width: 240px; height: 170px; overflow: hidden"
                         v-for="(w, wIndex) in worksStudent[toolIndex]"
                         :key="wIndex"
+                        :class="w.type == 1 ? 'isTypeOne' : ''"
                       >
                         <div class="workImg" v-if="w.type == 0">
                           <img
@@ -743,6 +800,7 @@
                             border: 1px solid #f8f8f8;
                             border-radius: 10px;
                             box-shadow: 0 0 6px 1px #dfdada;
+                            overflow: hidden;
                           "
                           v-for="(w, wIndex) in worksStudent[toolIndex]"
                           :key="wIndex"
@@ -752,7 +810,13 @@
                             <img
                               src="../assets/icon/works/noImg.png"
                               @click="
-                                openTools(4, toolIndex, taskCount, w.works)
+                                openTools(
+                                  4,
+                                  toolIndex,
+                                  taskCount,
+                                  w.works,
+                                  w.sName
+                                )
                               "
                               alt
                             />
@@ -763,11 +827,6 @@
                           </div>
                         </div>
                       </div>
-                      <AskStatic
-                        v-if="worksStudent[toolIndex].length > 0"
-                        :askJSON="worksStudent[toolIndex][0].works"
-                        :checkJson="checkJson[toolIndex]"
-                      ></AskStatic>
                     </div>
 
                     <div style="padding-top: 15px; font-size: 18px">未提交</div>
@@ -780,6 +839,11 @@
                         {{ s.student }}
                       </div>
                     </div>
+                    <AskStatic
+                      v-if="worksStudent[toolIndex].length > 0"
+                      :askJSON="worksStudent[toolIndex][0].works"
+                      :checkJson="checkJson[toolIndex]"
+                    ></AskStatic>
                   </div>
                   <div
                     v-if="tType && tType == 2 && tool.tool.indexOf(4) != -1"
@@ -803,6 +867,7 @@
                           border: 1px solid #f8f8f8;
                           border-radius: 10px;
                           box-shadow: 0 0 6px 1px #dfdada;
+                          overflow: hidden;
                         "
                         v-for="(w, wIndex) in workStudent[toolIndex]"
                         :key="wIndex"
@@ -810,7 +875,15 @@
                         <div class="workImg">
                           <img
                             src="../assets/icon/works/noImg.png"
-                            @click="openTools(4, toolIndex, taskCount, w.works)"
+                            @click="
+                              openTools(
+                                4,
+                                toolIndex,
+                                taskCount,
+                                w.works,
+                                w.sName
+                              )
+                            "
                             alt
                           />
                         </div>
@@ -1269,9 +1342,6 @@
                   :key="eIndex"
                   class="elist_input_box"
                 >
-                  <div style="font-size: 20px; padding-bottom: 15px">
-                    评价{{ eIndex + 1 }}
-                  </div>
                   <div>
                     <div
                       style="
@@ -1282,7 +1352,6 @@
                       "
                     >
                       <div>
-                        <span>评价名称:</span>
                         <span>{{ eItem.value }} </span>
                       </div>
                       <div
@@ -1293,12 +1362,10 @@
                           align-items: center;
                         "
                       >
-                        <span>评星等级:</span>
                         <el-rate v-model="eItem.score" disabled></el-rate>
                       </div>
                     </div>
-                    <div class="elist_inptu_text">
-                      <span>评价描述:</span>
+                    <div class="elist_inptu_text" style="padding-left: 10px">
                       <span>{{ eItem.detail }} </span>
                     </div>
                   </div>
@@ -1520,7 +1587,7 @@
       <img width="100%" :src="dialogImageUrl" alt />
     </el-dialog>
     <el-dialog
-      title="查看问卷调查"
+      :title="noteName != '' ? noteName : '查看问卷调查'"
       :visible.sync="dialogVisible5"
       :append-to-body="true"
       width="800px"
@@ -1586,11 +1653,10 @@
         </div>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible5 = false">取 消</el-button>
-        <el-button type="primary" @click="addStudentAsk" v-if="!isAnswer"
-          >确 定</el-button
+        <el-button @click="dialogVisible5 = false" v-show="noteName == ''"
+          >取 消</el-button
         >
-        <el-button type="primary" @click="dialogVisible5 = false" v-else
+        <el-button type="primary" @click="addStudentAsk" v-show="noteName == ''"
           >确 定</el-button
         >
       </span>
@@ -1856,6 +1922,7 @@ export default {
       showType: 0,
       fileType: 0,
       showPDF: false,
+      noteName: "",
     };
   },
   methods: {
@@ -2123,12 +2190,14 @@ export default {
                       works: b[j].content,
                       sName: b[j].name,
                       type: 1,
+                      time: b[j].time,
                     });
                   } else {
                     this.worksStudent[i].push({
                       works: b[j].content,
                       sName: b[j].name,
                       type: 0,
+                      time: b[j].time,
                     });
                   }
                 } else {
@@ -2136,6 +2205,7 @@ export default {
                     works: b[j].content,
                     sName: b[j].name,
                     type: 2,
+                    time: b[j].time,
                   });
                 }
 
@@ -2393,13 +2463,11 @@ export default {
       this.navId = this.navList[this.courseType].task[this.taskCount].id;
       if (this.vedio[this.taskCount].length > 0) {
         var a =
-          document.getElementsByClassName("vedioTaskBox")[this.taskCount]
+          document.getElementsByClassName("box_course")[this.taskCount]
             .offsetHeight;
         document.getElementsByClassName("vedioList")[
           this.taskCount
-        ].style.height = a - 15 + "px";
-        document.getElementsByClassName("navBox")[this.taskCount].style.height =
-          a - 100 + "px";
+        ].style.height = a + "px";
       }
 
       this.isNoHomeWork = false;
@@ -2642,23 +2710,10 @@ export default {
           }, 5000);
           this.$nextTick(function () {
             setTimeout(() => {
-              // for (
-              //   var i = 0;
-              //   i < document.getElementsByClassName("video-player").length;
-              //   i++
-              // ) {
-              //   var a =
-              //     document.getElementsByClassName("video-player")[i]
-              //       .offsetHeight;
-              //   document.getElementsByClassName("vedioList")[i].style.height =
-              //     a + "px";
-              // }
               var a =
-                document.getElementsByClassName("vedioTaskBox")[0].offsetHeight;
+                document.getElementsByClassName("box_course")[0].offsetHeight;
               document.getElementsByClassName("vedioList")[0].style.height =
-                a - 15 + "px";
-              document.getElementsByClassName("navBox")[0].style.height =
-                a - 100 + "px";
+                a + "px";
             }, 500);
           });
           if (this.vedio[this.taskCount].length > 0) {
@@ -2917,8 +2972,9 @@ export default {
           console.error(err);
         });
     },
-    openTools(t, i, index, c) {
+    openTools(t, i, index, c, sName) {
       var z = JSON.parse(c);
+      this.noteName = sName;
       if (t == 4) {
         this.radio = [];
         this.isAnswer = false;
@@ -2994,6 +3050,7 @@ export default {
         );
       } else if (t == 4) {
         this.radio = [];
+        this.noteName = "";
         this.isAnswer = false;
         if (this.askCount > 0) {
           this.updateCount(this.askCount, t);
@@ -3197,11 +3254,9 @@ export default {
     this.getHomeWork();
     document.scrollingElement.scrollTop = 0;
     window.addEventListener("resize", () => {
-      var a = document.getElementsByClassName("vedioTaskBox")[0].offsetHeight;
+      var a = document.getElementsByClassName("box_course")[0].offsetHeight;
       document.getElementsByClassName("vedioList")[0].style.height =
-        a - 15 + "px";
-      document.getElementsByClassName("navBox")[0].style.height =
-        a - 100 + "px";
+        a + "px";
     });
 
     setTimeout(() => {
@@ -3226,7 +3281,7 @@ export default {
   margin: 0 auto;
   padding-bottom: 50px;
   display: flex;
-  flex-direction: row;
+  flex-direction: column;
   flex-wrap: nowrap;
   align-items: flex-start;
   justify-content: flex-start;
@@ -3289,10 +3344,7 @@ export default {
   cursor: pointer;
 }
 .box_course {
-  display: flex;
-  flex-direction: row;
-  justify-content: flex-start;
-  align-items: center;
+  width: 60%;
 }
 .wheel {
   width: 100%;
@@ -3769,10 +3821,9 @@ export default {
 .vedioList {
   background: #f2f2f2;
   border: 1px solid #ececec;
-  width: 213px;
-  height: 530px;
+  width: 38.8%;
+  height: 445px;
   border-radius: 10px;
-  margin-top: 15px;
 }
 .vedioNav {
   margin: 10px 0 0 15px;
@@ -3821,7 +3872,6 @@ export default {
   cursor: pointer;
 }
 .vedioName {
-  width: 90px;
   text-overflow: ellipsis;
   position: absolute;
   top: 8px;
@@ -3939,7 +3989,7 @@ export default {
   border: 1px solid rgba(61, 103, 188);
 }
 .dialog_diy >>> .el-dialog__header {
-  background: #484848 !important;
+  background: #002e81 !important;
   padding: 15px 20px;
 }
 .dialog_diy >>> .el-dialog__title {
@@ -4197,11 +4247,15 @@ export default {
 .taskBox {
   margin: 15px 0 20px 30px;
   background: #f7f7f7;
-  width: 90%;
-  border-radius: 5px;
+  width: 97%;
+  border-radius: 10px;
 }
 .vedioTaskBox {
-  width: 70%;
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
 }
 .toolBox {
   padding: 20px 0 0 0;
@@ -4224,8 +4278,7 @@ export default {
 }
 .navBox {
   background: rgb(255, 255, 255);
-  margin: 10px 0 0 0;
-  height: 530px;
+  height: 400px;
   padding: 5px 1px 0 1px;
   overflow: auto;
 }
@@ -4405,10 +4458,15 @@ export default {
 }
 
 .elist_input_box .elist_inptu_text {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  margin-top: 10px;
+  min-height: 50px;
+  width: 500px;
+  max-height: 150px;
+  line-height: 50px;
+  color: rgb(82, 82, 82);
+  overflow: auto;
+  text-indent: 5px;
+  background: #f7f6f9;
+  border-radius: 10px;
 }
 
 .elist_input_box .elist_inptu_text input {
@@ -4436,4 +4494,20 @@ export default {
   font-weight: bold;
   padding: 0px 0px 0 10px;
 }
+.navTitile {
+  padding: 0 0px 0 15px;
+  background: #1e5cc9;
+  color: #fff;
+  height: 40px;
+  line-height: 40px;
+  border-top-left-radius: 10px;
+  border-top-right-radius: 10px;
+}
+.isTypeOne {
+  width: 240px;
+  height: 170px;
+  border: 1px solid #f8f8f8;
+  border-radius: 10px;
+  box-shadow: 0 0 6px 1px #dfdada;
+}
 </style>