Jelajahi Sumber

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

sunny 1 hari lalu
induk
melakukan
1d367b5917
1 mengubah file dengan 7 tambahan dan 6 penghapusan
  1. 7 6
      ruoyi-ui/src/views/invest/components/fileItem.vue

+ 7 - 6
ruoyi-ui/src/views/invest/components/fileItem.vue

@@ -166,12 +166,13 @@ 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();
+        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();
       });
     },
   },