Ver código fonte

学习园地 - 我的学习页面查看已完成学习的资料附件

wangggziwen 2 meses atrás
pai
commit
4f0ee0ec8d
1 arquivos alterados com 28 adições e 0 exclusões
  1. 28 0
      ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

+ 28 - 0
ruoyi-ui/src/views/branch/xxyd/mystudy/index.vue

@@ -49,6 +49,12 @@
             type="text"
             @click="handleStudy(scope.row)"
           >开始学习</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleSeeFile(scope.row)"
+          >查看资料</el-button>
+
           <el-button
             v-if="scope.row.learningProgress >= 100 && scope.row.isSigned == 0"
             size="mini"
@@ -247,6 +253,28 @@ export default {
         }
       }, 60000);
     },
+
+    handleSeeFile(row) {
+      this.learning = {};
+      this.learning.learningTimeRequired = row.learningTimeRequired;
+      this.learning.learningTimeStudied = row.learningTimeStudied;
+      this.learning.learningProgress = row.learningProgress;
+
+      //office预览
+      this.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = ""
+      this.ppt = true
+
+      //如果是PDF等直接可以打开的就不调接口,否则调用接口
+      if (row.fileName.endsWith('pdf')) {
+        this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+        this.loadingFlash = false
+      } else {
+
+      }
+    },
     // 状态字典翻译
     learningStatusFormat(row, column) {
       return this.selectDictLabel(this.learningStatusOptions, row.learningStatus);