Browse Source

文件资料管理附件点击下载改为预览

sunny 1 day ago
parent
commit
efdfd996bd
1 changed files with 10 additions and 8 deletions
  1. 10 8
      ruoyi-ui/src/views/invest/components/fileItem.vue

+ 10 - 8
ruoyi-ui/src/views/invest/components/fileItem.vue

@@ -165,14 +165,16 @@ export default {
     },
     //点击文件列表中已上传的文件时的钩子
     handlePreview(file) {
-      downloadFileById(file.id).then((response) => {
-        const url = window.URL.createObjectURL(new Blob([response]));
-        const link = document.createElement("a");
-        link.href = url;
-        link.setAttribute("download", file.newUploadName);
-        document.body.appendChild(link);
-        link.click();
-      });
+      window.open(file.uploadPath, '_blank');
+      /*downloadFileById(file.id).then((response) => {
+        const url = window.URL.createObjectURL(new Blob([response])); // 'https://dgt.dgtis.com/oneportal/fileServer/vendor//contractFile/c6503f4c14354692b207553df8f02480.pdf';
+        window.open(url, '_blank');
+        // const link = document.createElement("a");
+        // link.href = url;
+        // link.setAttribute("download", file.newUploadName);
+        // document.body.appendChild(link);
+        // link.click();
+      });*/
     },
   },
 };