Browse Source

修改无法显示文档问题及文档标题样式

zengyicheng 2 years ago
parent
commit
b225186170
1 changed files with 46 additions and 32 deletions
  1. 46 32
      src/components/study.vue

+ 46 - 32
src/components/study.vue

@@ -250,7 +250,7 @@
                     <el-form class="textBox">
                       <el-form-item label="文档标题" class="textTitle">
                         <div
-                          style="font-size: 22px; height: 100px; overflow: auto"
+                          style="font-size: 22px; max-height: 100px; overflow: auto"
                         >
                           {{ text.name }}
                         </div>
@@ -2890,44 +2890,58 @@ export default {
                   this.text = this.textList[this.taskCount][0];
                 }
               } else {
-                if (
+                console.log(this.chapInfoList[this.courseType].chapterInfo[0].taskJson[this.taskCount].chapterData)
+                for (
+                  var y = 0;
+                  y <
                   this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
                     this.taskCount
-                  ].chapterData[1].type == 3
+                  ].chapterData.length;
+                  y++
                 ) {
-                  let _url =
+                  if (
                     this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
                       this.taskCount
-                    ].chapterData[1].url;
-                  if (
-                    _url
-                      .split(".")
-                      [_url.split(".").length - 1].toLocaleUpperCase() == "PDF"
+                    ].chapterData[y].type != 8
                   ) {
-                    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;
+                    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 if (
-                  this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
-                    this.taskCount
-                  ].chapterData[1].type == 6
-                ) {
-                  this.showType = 1;
-                  this.text = this.textList[this.taskCount][0];
                 }
               }
             }