فهرست منبع

Merge remote-tracking branch 'origin/master'

mjh 3 سال پیش
والد
کامیت
9658fd8cf2

+ 13 - 2
src/views/CourseDetailPage/tabs/CoursewareTab.vue

@@ -75,7 +75,7 @@
         <el-table-column
         <el-table-column
           prop="name"
           prop="name"
           label="文件名"
           label="文件名"
-          width="260"
+          width="280"
           >
           >
           <template #default="scope">
           <template #default="scope">
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'SCAN'" style="color: #337ecc" class="myicon"><Reading /></el-icon>
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'SCAN'" style="color: #337ecc" class="myicon"><Reading /></el-icon>
@@ -134,6 +134,10 @@
 <!--                     && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"-->
 <!--                     && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"-->
 <!--                     @click="handleDownloadPdfFile(scope.row['courseWareVO'].fileUrl)"-->
 <!--                     @click="handleDownloadPdfFile(scope.row['courseWareVO'].fileUrl)"-->
 <!--                     style="color: #67C23A" type="text">下载</el-button>-->
 <!--                     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)"
             <el-button v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
                        style="color: #F56C6C; margin-left: 10px" type="text"
                        style="color: #F56C6C; margin-left: 10px" type="text"
                        @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)">删除</el-button>
                        @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)">删除</el-button>
@@ -403,6 +407,7 @@ export default {
                                         this.newName = null;
                                         this.newName = null;
                                         this.nameAppend = null;
                                         this.nameAppend = null;
                                         this.file = null;
                                         this.file = null;
+                                        this.fileType = null;
                                     });
                                     });
                             });
                             });
                         });
                         });
@@ -417,6 +422,11 @@ export default {
               this.nameAppend = null;
               this.nameAppend = null;
         }
         }
         else {
         else {
+            this.$message({
+                message: "上传中,请稍候",
+                type: "warning",
+                duration: 5000
+            });
             this.$apis.uploadCourseWareFile(this.courseId + "/" + this.file.name, this.file.raw)
             this.$apis.uploadCourseWareFile(this.courseId + "/" + this.file.name, this.file.raw)
                 .then(res => {
                 .then(res => {
                     const fileUrl = res.data.data;
                     const fileUrl = res.data.data;
@@ -430,7 +440,6 @@ export default {
                         useMethod: this.form.useMethod,
                         useMethod: this.form.useMethod,
                         fileUrl: fileUrl,
                         fileUrl: fileUrl,
                     }).then(res => {
                     }).then(res => {
-                        //console.log(res.data.data.id);
                         this.$apis.setCanDownloadById(res.data.data.id, this.downloadValue);
                         this.$apis.setCanDownloadById(res.data.data.id, this.downloadValue);
                         this.$apis.getCourseWaresByCourseId(this.courseId)
                         this.$apis.getCourseWaresByCourseId(this.courseId)
                             .then(res => {
                             .then(res => {
@@ -445,6 +454,7 @@ export default {
                                 this.isNameUnique = false;
                                 this.isNameUnique = false;
                                 this.fileNum = 0;
                                 this.fileNum = 0;
                                 this.file = null;
                                 this.file = null;
+                                this.fileType = null;
                             });
                             });
                     });
                     });
                 });
                 });
@@ -465,6 +475,7 @@ export default {
           this.fileNum = 0;
           this.fileNum = 0;
           this.newName = null;
           this.newName = null;
           this.nameAppend = null;
           this.nameAppend = null;
+          this.fileType = null;
           this.clearForm();
           this.clearForm();
           // Zhurui修改,关闭dialog
           // Zhurui修改,关闭dialog
           done();
           done();

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

@@ -1,6 +1,8 @@
 <template>
 <template>
     <div>
     <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>
     </div>
 </template>
 </template>
 
 
@@ -25,8 +27,8 @@
             this._context = this._canvas.getContext("2d");
             this._context = this._canvas.getContext("2d");
 
 
             // Default size
             // Default size
-            this._canvas.height = 300;
-            this._canvas.width = 400;
+            this._canvas.height = 450;
+            this._canvas.width = 700;
             console.log(this.src);
             console.log(this.src);
 
 
             if (this.src) {
             if (this.src) {
@@ -35,7 +37,7 @@
                 // ! 1秒后重试
                 // ! 1秒后重试
                 setTimeout(() => {
                 setTimeout(() => {
                     this.load(this.src);
                     this.load(this.src);
-                }, 1000);
+                }, 10000);
             }
             }
 
 
         },
         },
@@ -94,4 +96,17 @@
         max-height: 100vh;
         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>
 </style>

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

@@ -8,7 +8,7 @@
         {{currentPage}} / {{totalPages}}
         {{currentPage}} / {{totalPages}}
       </label>
       </label>
       <label class="to-page-action">
       <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>
       </label>
       <el-button @click="handleNext" title="下一页" size="small"><el-icon><ArrowRightBold /></el-icon></el-button>
       <el-button @click="handleNext" title="下一页" size="small"><el-icon><ArrowRightBold /></el-icon></el-button>
     </div>
     </div>