zengyicheng 2 tahun lalu
induk
melakukan
93bd0dcf78
1 mengubah file dengan 134 tambahan dan 105 penghapusan
  1. 134 105
      src/components/studyStudent.vue

+ 134 - 105
src/components/studyStudent.vue

@@ -220,6 +220,7 @@
                   v-if="
                     vedio[taskCount].length > 0 ||
                     textList[taskCount].length > 0 ||
+                    lineList[taskCount].length > 0 ||
                     file[taskCount].length > 0
                   "
                 >
@@ -310,15 +311,15 @@
                       ? 'listNoVedio'
                       : ''
                 "-->
-                <div
-                  class="vedioList"
-                  :class="
+                <!-- :class="
                     vedio[taskCount].length == 0 &&
                     file[taskCount].length == 0 &&
                     textList[taskCount].length == 0
                       ? 'listNoVedio'
                       : ''
-                  "
+                  " -->
+                <div
+                  class="vedioList"
                   v-if="
                     (vedio.length &&
                       vedio[taskCount] &&
@@ -470,7 +471,7 @@
                       >
                         链接
                       </div> -->
-                      <div style="width: calc(100% - 0px)">
+                      <!-- <div style="width: calc(100% - 0px)">
                         <div
                           class="navText"
                           :class="isClickNav == lineIndex ? 'isClickNav' : ''"
@@ -481,6 +482,16 @@
                             >{{ lines.url }}</a
                           >
                         </div>
+                      </div> -->
+                      <div style="width: calc(100% - 0px)">
+                        <div
+                          class="navText"
+                          :class="
+                            isClickNav == 'line' + lineIndex ? 'isClickNav' : ''
+                          "
+                        >
+                          {{ lines.url }}
+                        </div>
                       </div>
                     </div>
                     <div
@@ -5048,108 +5059,124 @@ export default {
                 this.taskCount
               ].chapterData.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;
               if (
                 this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
                   this.taskCount
-                ].chapterData[0].type != 8
+                ].chapterData[0].type == 8
+              ) {
+                this.showType = 2;
+                if (_url.indexOf("https://") == -1 && _url.indexOf("http://") == -1) {
+                  _url = "https://" + _url;
+                }
+                this.pptImgUrl1 = _url;
+                this.isClickNav = "line0";
+              } else if (
+                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+                  this.taskCount
+                ].chapterData[0].type == 3
               ) {
                 if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[0].type == 3
+                  _url
+                    .split(".")
+                    [_url.split(".").length - 1].toLocaleUpperCase() == "PDF"
                 ) {
-                  let _url =
-                    this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                      this.taskCount
-                    ].chapterData[0].url;
-                  if (
+                  this.showType = 3;
+                  this.pptImgUrl1 = _url;
+                  this.isClickNav = "word0";
+                } else if (
+                  this.isAssetTypeAnImage(
                     _url
                       .split(".")
-                      [_url.split(".").length - 1].toLocaleUpperCase() == "PDF"
-                  ) {
-                    this.showType = 3;
-                    this.pptImgUrl1 = _url;
-                    this.isClickNav = "word0";
-                  } else if (
-                    this.isAssetTypeAnImage(
-                      _url
-                        .split(".")
-                        [_url.split(".").length - 1].toLocaleLowerCase()
-                    )
-                  ) {
-                    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
-                ) {
-                  this.showType = 1;
-                  this.text = this.textList[this.taskCount][0];
-                  this.isClickNav = "text0";
-                }
-              } else {
-                for (
-                  var y = 0;
-                  y <
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData.length;
-                  y++
+                      [_url.split(".").length - 1].toLocaleLowerCase()
+                  )
                 ) {
-                  if (
-                    this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                      this.taskCount
-                    ].chapterData[y].type != 8
-                  ) {
-                    if (
-                      this.chapInfoList[this.courseType].chapterInfo[0]
-                        .taskJson[this.taskCount].chapterData[y].type == 3
-                    ) {
-                      let _url =
-                        this.chapInfoList[this.courseType].chapterInfo[0]
-                          .taskJson[this.taskCount].chapterData[y].url;
-                      if (
-                        _url
-                          .split(".")
-                          [_url.split(".").length - 1].toLocaleUpperCase() ==
-                        "PDF"
-                      ) {
-                        this.showType = 3;
-                        this.pptImgUrl1 = _url;
-                      } else if (
-                        this.isAssetTypeAnImage(
-                          _url
-                            .split(".")
-                            [_url.split(".").length - 1].toLocaleLowerCase()
-                        )
-                      ) {
-                        this.showType = 4;
-                        this.pptImgUrl1 = _url;
-                      } else {
-                        this.showType = 2;
-                        this.pptImgUrl1 =
-                          "https://view.officeapps.live.com/op/view.aspx?src=" +
-                          _url;
-                      }
-                    } else if (
-                      this.chapInfoList[this.courseType].chapterInfo[0]
-                        .taskJson[this.taskCount].chapterData[y].type == 6
-                    ) {
-                      this.showType = 1;
-                      this.text = this.textList[this.taskCount][0];
-                    }
-                  }
+                  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
+              ) {
+                this.showType = 1;
+                this.text = this.textList[this.taskCount][0];
+                this.isClickNav = "text0";
               }
+              // }
+              //  else {
+              //   for (
+              //     var y = 0;
+              //     y <
+              //     this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+              //       this.taskCount
+              //     ].chapterData.length;
+              //     y++
+              //   ) {
+              //     if (
+              //       this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+              //         this.taskCount
+              //       ].chapterData[y].type != 8
+              //     ) {
+              //       if (
+              //         this.chapInfoList[this.courseType].chapterInfo[0]
+              //           .taskJson[this.taskCount].chapterData[y].type == 3
+              //       ) {
+              //         let _url =
+              //           this.chapInfoList[this.courseType].chapterInfo[0]
+              //             .taskJson[this.taskCount].chapterData[y].url;
+              //         if (
+              //           _url
+              //             .split(".")
+              //             [_url.split(".").length - 1].toLocaleUpperCase() ==
+              //           "PDF"
+              //         ) {
+              //           this.showType = 3;
+              //           this.pptImgUrl1 = _url;
+              //         } else if (
+              //           this.isAssetTypeAnImage(
+              //             _url
+              //               .split(".")
+              //               [_url.split(".").length - 1].toLocaleLowerCase()
+              //           )
+              //         ) {
+              //           this.showType = 4;
+              //           this.pptImgUrl1 = _url;
+              //         } else {
+              //           this.showType = 2;
+              //           this.pptImgUrl1 =
+              //             "https://view.officeapps.live.com/op/view.aspx?src=" +
+              //             _url;
+              //         }
+              //       } else if (
+              //         this.chapInfoList[this.courseType].chapterInfo[0]
+              //           .taskJson[this.taskCount].chapterData[y].type == 6
+              //       ) {
+              //         this.showType = 1;
+              //         this.text = this.textList[this.taskCount][0];
+              //       }
+              //     } else {
+              //       this.showType = 2;
+              //       this.pptImgUrl1 =
+              //         "https://view.officeapps.live.com/op/view.aspx?src=" +
+              //         _url;
+              //     }
+              //   }
+              // }
             }
           } else {
             this.isClickNav = "video0";
@@ -5352,7 +5379,16 @@ export default {
         this.dialogVisible3 = true;
       }
     },
-
+    doUrl(url, i) {
+      this.isClickNav = "";
+      this.pptImgUrl1 = "";
+      this.showType = 2;
+      if (url.indexOf("https://") == -1 && url.indexOf("http://") == -1) {
+        url = "https://" + url;
+      }
+      this.pptImgUrl1 = url;
+      this.isClickNav = "line" + i;
+    },
     downFile(f, i) {
       this.isClickNav = "";
       this.pptImgUrl1 = "";
@@ -5586,14 +5622,7 @@ export default {
       //   this.answerDialogVisible = true;
       // }
     },
-    doUrl(url, i) {
-      this.isClickNav = "";
-      if (url.indexOf("https://") == -1 && url.indexOf("http://") == -1) {
-        url = "https://" + url;
-      }
-      window.open(url);
-      this.isClickNav = i;
-    },
+
     fastText(p, t) {
       if (t == 1) {
         this.commentText += p;