Browse Source

fix:调整部分课件加载参数

chillqi 3 years ago
parent
commit
d3c121f6a3

+ 4 - 4
src/views/CourseDetailPage/tabs/CoursewareTab.vue

@@ -134,6 +134,10 @@
 <!--                     && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"-->
 <!--                     @click="handleDownloadPdfFile(scope.row['courseWareVO'].fileUrl)"-->
 <!--                     style="color: #67C23A" type="text">下载</el-button>-->
+                          <a :href="scope.row['courseWareVO'].fileUrl"
+                             v-if="scope.row['courseWareVO'].useMethod === 'ATTACHMENT' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTUREandATTACHMENT'">
+                            <el-button style="color: #67C23A" type="text">下载</el-button>
+                          </a>
             <el-button v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
                        style="color: #F56C6C; margin-left: 10px" type="text"
                        @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)">删除</el-button>
@@ -531,10 +535,6 @@ export default {
       },
 
       handlePreviewFile(id) {
-          this.$message({
-              message: "加载中,请稍候",
-              type: "warning"
-          });
           this.$router.push("/courseWare/" + id + "/details");
           //window.open("/courseWare/" + id + "/details");
           // let nextURL = `https://p.seec.seecoder.cn/courseWare/?courseWareId=${id}/details&id_token=${this.$store.state.user.token}`;

+ 19 - 4
src/views/CourseWarePage/pdf/Pdf.vue

@@ -1,6 +1,8 @@
 <template>
     <div>
-        <canvas className="pdf pdf-canvas" id="pdf-canvas"></canvas>
+        <div v-if="loading" class="loading">
+            加载中,请稍候...</div>
+        <canvas class="pdf-canvas" id="pdf-canvas"></canvas>
     </div>
 </template>
 
@@ -25,8 +27,8 @@
             this._context = this._canvas.getContext("2d");
 
             // Default size
-            this._canvas.height = 300;
-            this._canvas.width = 400;
+            this._canvas.height = 450;
+            this._canvas.width = 700;
             console.log(this.src);
 
             if (this.src) {
@@ -35,7 +37,7 @@
                 // ! 1秒后重试
                 setTimeout(() => {
                     this.load(this.src);
-                }, 1000);
+                }, 10000);
             }
 
         },
@@ -94,4 +96,17 @@
         max-height: 100vh;
     }
 
+    .loading, .focus-mask {
+        position: absolute;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        height: 100%;
+        width: 100%;
+        top: 0;
+        left: 0;
+        color: #7a8a9a;
+        font-size: 40px;
+    }
+
 </style>

+ 1 - 1
src/views/CourseWarePage/pdf/PdfController.vue

@@ -8,7 +8,7 @@
         {{currentPage}} / {{totalPages}}
       </label>
       <label class="to-page-action">
-        <el-input placeholder="to" ref="input" type="number" v-model="toPage" @input="handleToPage"/>
+        <el-input placeholder="to" ref="input" type="number" v-model="currentPage" @input="handleToPage"/>
       </label>
       <el-button @click="handleNext" title="下一页" size="small"><el-icon><ArrowRightBold /></el-icon></el-button>
     </div>