ly il y a 3 ans
Parent
commit
9cabc91494

+ 1 - 1
master/src/main/resources/application.yml

@@ -9,7 +9,7 @@ ruoyi:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /data/cpmsfile/uploadPath)
-  profile: /data/cpmsfile/uploadPath
+  profile: D:/ruoyi/uploadPath
   # 邮件中链接跳转路径 示例(本地:http://localhost/#,服务器:http://47.114.101.16:8080/cpms/index.html#)
   requestJumpPath: http://47.114.101.16:8080/cpms/index.html#
   # 获取ip地址开关

+ 18 - 1
ui/src/views/sems/reportYlgd/index.vue

@@ -668,7 +668,13 @@
           :label="$t('文件名称')"
           width="300"
           :show-overflow-tooltip="true"
-          align="center"/>
+          align="center">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
   </div>
@@ -1318,6 +1324,17 @@ export default {
       }
       this.getList();
     },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.filePath;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
   }
 };
 </script>

+ 18 - 3
ui/src/views/sems/reportYlrq/index.vue

@@ -62,7 +62,6 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
         <el-button
           type="warning"
           size="mini"
@@ -883,7 +882,13 @@
           :label="$t('文件名称')"
           width="300"
           :show-overflow-tooltip="true"
-          align="center"/>
+          align="center">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
     <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
@@ -1722,7 +1727,17 @@ export default {
       }
       this.getList();
     },
-
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.filePath;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
   }
 };
 </script>