zengyicheng 2 år sedan
förälder
incheckning
d9ee931557
2 ändrade filer med 145 tillägg och 136 borttagningar
  1. 126 97
      src/components/study.vue
  2. 19 39
      src/components/studyStudent.vue

+ 126 - 97
src/components/study.vue

@@ -190,6 +190,7 @@
                     v-if="
                       vedio[jdIndex][rwIndex].length > 0 ||
                       textList[jdIndex][rwIndex].length > 0 ||
+                      lineList[jdIndex][rwIndex].length > 0 ||
                       file[jdIndex][rwIndex].length > 0
                     "
                   >
@@ -278,13 +279,6 @@
                   </div>
                   <div
                     class="vedioList"
-                    :class="
-                      vedio[jdIndex][rwIndex].length == 0 &&
-                      file[jdIndex][rwIndex].length == 0 &&
-                      textList[jdIndex][rwIndex].length == 0
-                        ? 'listNoVedio'
-                        : ''
-                    "
                     v-if="
                       (vedio.length &&
                         vedio[jdIndex][rwIndex] &&
@@ -411,7 +405,7 @@
                         class="newNav"
                         v-for="(lines, lineIndex) in lineList[jdIndex][rwIndex]"
                         :key="lineIndex + '4'"
-                        @click="doUrl(lines.url)"
+                        @click="doUrl(jdIndex, rwIndex, lines.url, lineIndex)"
                       >
                         <!-- <div
                           class="vedioNav"
@@ -427,12 +421,16 @@
                           链接
                         </div> -->
                         <div style="width: calc(100% - 115px)">
-                          <div class="navText">
-                            <a
-                              style="text-decoration: none; color: #000"
-                              target="_Blank"
-                              >{{ lines.url }}</a
-                            >
+                          <div
+                            class="navText"
+                            :class="
+                              isClickNavOne[jdIndex][rwIndex][lineIndex] ==
+                              'line' + lineIndex
+                                ? 'isClickNavOne'
+                                : ''
+                            "
+                          >
+                            {{ lines.url }}
                           </div>
                         </div>
                       </div>
@@ -2053,6 +2051,16 @@
                         "
                       >
                         <div
+                          v-for="(w, wIndex) in worksStudent[jdIndex][rwIndex][
+                            toolIndex
+                          ]"
+                          :key="wIndex"
+                          class="isWorksName"
+                          @click="openXz(w, jdIndex, rwIndex, toolIndex)"
+                        >
+                          {{ w.sName }}
+                        </div>
+                        <!-- <div
                           class="works"
                           style="
                             width: 200px;
@@ -2076,7 +2084,7 @@
                           <div class="worksName">
                             <div>{{ w.sName }}</div>
                           </div>
-                        </div>
+                        </div> -->
                       </div>
                       <div style="font-size: 18px">未提交</div>
                       <div class="noWorksS">
@@ -4149,9 +4157,13 @@ export default {
                   }
                 }
               }
-              this.worksStudent[q][w][i] = this.worksStudent[q][w][i].sort(function (a, b) {
-              return b.likesCount - a.likesCount;
-            });
+              if(this.worksStudent[q][w][i] && this.worksStudent[q][w][i].length){
+                this.worksStudent[q][w][i] = this.worksStudent[q][w][i].sort(
+                function (a, b) {
+                  return b.likesCount - a.likesCount;
+                }
+              );
+              }
             }
           }
           for (var q = 0; q < a.length; q++) {
@@ -4750,80 +4762,91 @@ export default {
               this.showType[i][j] = 0;
               if (!this.vedio[i][j][0] || this.vedio[i][j][0].url == "") {
                 if (f[j].chapterData.length > 0) {
-                  if (f[j].chapterData[0].type != 8) {
-                    if (f[j].chapterData[0].type == 3) {
-                      let _url = f[j].chapterData[0].url;
-                      if (
+                  let _url = f[j].chapterData[0].url;
+                  // if (f[j].chapterData[0].type != 8) {
+                  if (f[j].chapterData[0].type == 8) {
+                    this.showType[i][j] = 2;
+                    if (
+                      _url.indexOf("https://") == -1 &&
+                      _url.indexOf("http://") == -1
+                    ) {
+                      _url = "https://" + _url;
+                    }
+                    this.pptImgUrl1[i][j] = _url;
+                    this.isClickNavOne[i][j][0] = "line0";
+                  } else if (f[j].chapterData[0].type == 3) {
+                    if (
+                      _url
+                        .split(".")
+                        [_url.split(".").length - 1].toLocaleUpperCase() ==
+                      "PDF"
+                    ) {
+                      this.showType[i][j] = 3;
+                      this.pptImgUrl1[i][j] = _url;
+                      this.isClickNavOne[i][j][0] = "word0";
+                    } else if (
+                      this.isAssetTypeAnImage(
                         _url
                           .split(".")
-                          [_url.split(".").length - 1].toLocaleUpperCase() ==
-                        "PDF"
-                      ) {
-                        this.showType[i][j] = 3;
-                        this.pptImgUrl1[i][j] = _url;
-                        this.isClickNavOne[i][j][0] = "word0";
-                      } else if (
-                        this.isAssetTypeAnImage(
-                          _url
-                            .split(".")
-                            [_url.split(".").length - 1].toLocaleLowerCase()
-                        )
-                      ) {
-                        this.showType[i][j] = 4;
-                        this.pptImgUrl1[i][j] = _url;
-                        this.isClickNavOne[i][j][0] = "word0";
-                      } else {
-                        this.showType[i][j] = 2;
-                        this.pptImgUrl1[i][j] =
-                          "https://view.officeapps.live.com/op/view.aspx?src=" +
-                          _url;
-                        this.isClickNavOne[i][j][0] = "word0";
-                      }
-                    } else if (f[j].chapterData[0].type == 6) {
-                      this.showType[i][j] = 1;
-                      this.text = this.textList[i][j][0];
-                      this.isClickNavOne[i][j][0] = "text0";
-                    }
-                  } else {
-                    for (var y = 0; y < f[j].chapterData.length; y++) {
-                      if (f[j].chapterData[y].type != 8) {
-                        if (f[j].chapterData[y].type == 3) {
-                          let _url = f[j].chapterData[y].url;
-                          if (
-                            _url
-                              .split(".")
-                              [
-                                _url.split(".").length - 1
-                              ].toLocaleUpperCase() == "PDF"
-                          ) {
-                            this.showType[i][j] = 3;
-                            this.pptImgUrl1[i][j] = _url;
-                            this.isClickNavOne[i][j][0] = "word0";
-                          } else if (
-                            this.isAssetTypeAnImage(
-                              _url
-                                .split(".")
-                                [_url.split(".").length - 1].toLocaleLowerCase()
-                            )
-                          ) {
-                            this.showType[i][j] = 4;
-                            this.pptImgUrl1[i][j] = _url;
-                            this.isClickNavOne[i][j][0] = "word0";
-                          } else {
-                            this.showType[i][j] = 2;
-                            this.pptImgUrl1[i][j] =
-                              "https://view.officeapps.live.com/op/view.aspx?src=" +
-                              _url;
-                            this.isClickNavOne[i][j][0] = "word0";
-                          }
-                        } else if (f[j].chapterData[y].type == 6) {
-                          this.showType[i][j] = 1;
-                          this.text = this.textList[i][j][0];
-                          this.isClickNavOne[i][j][0] = "text0";
-                        }
-                      }
+                          [_url.split(".").length - 1].toLocaleLowerCase()
+                      )
+                    ) {
+                      this.showType[i][j] = 4;
+                      this.pptImgUrl1[i][j] = _url;
+                      this.isClickNavOne[i][j][0] = "word0";
+                    } else {
+                      this.showType[i][j] = 2;
+                      this.pptImgUrl1[i][j] =
+                        "https://view.officeapps.live.com/op/view.aspx?src=" +
+                        _url;
+                      this.isClickNavOne[i][j][0] = "word0";
                     }
+                  } else if (f[j].chapterData[0].type == 6) {
+                    this.showType[i][j] = 1;
+                    this.text = this.textList[i][j][0];
+                    this.isClickNavOne[i][j][0] = "text0";
                   }
+                  // }
+                  //  else {
+                  //   for (var y = 0; y < f[j].chapterData.length; y++) {
+                  //     if (f[j].chapterData[y].type != 8) {
+                  //       if (f[j].chapterData[y].type == 3) {
+                  //         let _url = f[j].chapterData[y].url;
+                  //         if (
+                  //           _url
+                  //             .split(".")
+                  //             [
+                  //               _url.split(".").length - 1
+                  //             ].toLocaleUpperCase() == "PDF"
+                  //         ) {
+                  //           this.showType[i][j] = 3;
+                  //           this.pptImgUrl1[i][j] = _url;
+                  //           this.isClickNavOne[i][j][0] = "word0";
+                  //         } else if (
+                  //           this.isAssetTypeAnImage(
+                  //             _url
+                  //               .split(".")
+                  //               [_url.split(".").length - 1].toLocaleLowerCase()
+                  //           )
+                  //         ) {
+                  //           this.showType[i][j] = 4;
+                  //           this.pptImgUrl1[i][j] = _url;
+                  //           this.isClickNavOne[i][j][0] = "word0";
+                  //         } else {
+                  //           this.showType[i][j] = 2;
+                  //           this.pptImgUrl1[i][j] =
+                  //             "https://view.officeapps.live.com/op/view.aspx?src=" +
+                  //             _url;
+                  //           this.isClickNavOne[i][j][0] = "word0";
+                  //         }
+                  //       } else if (f[j].chapterData[y].type == 6) {
+                  //         this.showType[i][j] = 1;
+                  //         this.text = this.textList[i][j][0];
+                  //         this.isClickNavOne[i][j][0] = "text0";
+                  //       }
+                  //     }
+                  //   }
+                  // }
                 }
               } else {
                 this.isClickNavOne[i][j][0] = "video0";
@@ -4970,6 +4993,16 @@ export default {
         this.dialogVisible3 = true;
       }
     },
+    doUrl(j, k, url, i) {
+      this.isClickNavOne[j][k] = [];
+      this.pptImgUrl1[j][k] = [];
+      this.showType[j][k] = 2;
+      if (url.indexOf("https://") == -1 && url.indexOf("http://") == -1) {
+        url = "https://" + url;
+      }
+      this.pptImgUrl1[j][k] = url;
+      this.isClickNavOne[j][k][i] = "line" + i;
+    },
     downFile(f, i, j, k) {
       this.isClickNavOne[j][k] = [];
       this.pptImgUrl1[j][k] = [];
@@ -5234,12 +5267,7 @@ export default {
       //   this.answerDialogVisible = true;
       // }
     },
-    doUrl(url) {
-      if (url.indexOf("https://") == -1 && url.indexOf("http://") == -1) {
-        url = "https://" + url;
-      }
-      window.open(url);
-    },
+
     addTools(t, i, jdIndex, index) {
       var a = 0;
       this.courseType = jdIndex;
@@ -7091,12 +7119,13 @@ export default {
   justify-content: flex-start;
 }
 
-.isWorksName{
+.isWorksName {
   cursor: pointer;
   background: #46a1eb !important;
 }
 
-.noWorksName,.isWorksName {
+.noWorksName,
+.isWorksName {
   background: #7cbcf1;
   color: #fff;
   width: 90px;
@@ -7112,7 +7141,7 @@ export default {
 }
 
 .noWorksName:hover {
-  background: #e7e7e7 !important;
+  background: #46a1eb !important;
 }
 
 .title {

+ 19 - 39
src/components/studyStudent.vue

@@ -2285,6 +2285,14 @@
                       "
                     >
                       <div
+                        v-for="(w, wIndex) in worksStudent[toolIndex]"
+                        :key="wIndex"
+                        class="isWorksName"
+                        @click="openXz(w, toolIndex)"
+                      >
+                        {{ w.sName }}
+                      </div>
+                      <!-- <div
                         class="works"
                         style="
                           width: 200px;
@@ -2307,40 +2315,7 @@
                         <div class="worksName">
                           <div>{{ w.sName }}</div>
                         </div>
-                        <!-- <div class="comment" style="min-width: 200px">
-                          <div class="worksName">
-                            <div>{{ w.sName }}</div>
-                          </div>
-                          <div class="commentList">
-                            <div class="commentList">
-                              <div
-                                class="commentImg"
-                                @click="
-                                  isLikes(w.wid, userid, 1, null, w.isLikes)
-                                "
-                              >
-                                <img
-                                  :src="w.isLikes == true ? likes : noLikes"
-                                  alt=""
-                                />
-                              </div>
-                              <div>{{ w.likesCount }}</div>
-                            </div>
-                            <div class="commentList" style="margin-right: 15px">
-                              <div
-                                class="commentImg"
-                                @click="commentOther(w, toolIndex)"
-                              >
-                                <img
-                                  src="../assets/icon/comment/comment.png"
-                                  alt=""
-                                />
-                              </div>
-                              <div>{{ w.commentCount }}</div>
-                            </div>
-                          </div>
-                        </div> -->
-                      </div>
+                      </div> -->
                     </div>
                     <div style="font-size: 18px">未提交</div>
                     <div class="noWorksS">
@@ -4478,9 +4453,11 @@ export default {
                 this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
               }
             }
-            this.worksStudent[i] = this.worksStudent[i].sort(function (a, b) {
-              return b.likesCount - a.likesCount;
-            });
+            if (this.worksStudent[i] && this.worksStudent[i].length) {
+              this.worksStudent[i] = this.worksStudent[i].sort(function (a, b) {
+                return b.likesCount - a.likesCount;
+              });
+            }
           }
 
           for (var i = 0; i < a.length; i++) {
@@ -5074,7 +5051,10 @@ export default {
                 ].chapterData[0].type == 8
               ) {
                 this.showType = 2;
-                if (_url.indexOf("https://") == -1 && _url.indexOf("http://") == -1) {
+                if (
+                  _url.indexOf("https://") == -1 &&
+                  _url.indexOf("http://") == -1
+                ) {
                   _url = "https://" + _url;
                 }
                 this.pptImgUrl1 = _url;
@@ -7407,7 +7387,7 @@ export default {
 }
 
 .noWorksName:hover {
-  background: #e7e7e7 !important;
+  background: #46a1eb !important;
 }
 
 .title {