Pārlūkot izejas kodu

印章档案附件下载

xieyn 1 gadu atpakaļ
vecāks
revīzija
274669ef2e
1 mainītis faili ar 26 papildinājumiem un 0 dzēšanām
  1. 26 0
      src/views/oa/SealArchivesList.vue

+ 26 - 0
src/views/oa/SealArchivesList.vue

@@ -322,6 +322,32 @@
       cancel(){
         this.visible = false;
       },
+      /* 文件下载 */
+      uploadFile(text){
+        console.log(text)
+        if(!text){
+          this.$message.warning("未知的文件")
+          return;
+        }
+        var strArr = text;
+        if(text.indexOf(",")>0){
+          strArr = text.split(',');
+          console.log("strArr",strArr)
+          text = text.substring(0,text.indexOf(","))
+          var count=0;
+          for(var i =0;i<strArr.length;i++){
+            console.log(strArr[i])
+            var hiddenIFrameID = 'hiddenDownloader' + count++;
+            var iframe = document.createElement('iframe');
+            iframe.id = hiddenIFrameID;
+            iframe.style.display = 'none';
+            document.body.appendChild(iframe);
+            iframe.src = strArr[i];//直接下载,不会弹出新的页面
+          }
+        }else {
+          window.open(window._CONFIG['staticDomainURL']+ "/"+text);
+        }
+      },
     }
   }
 </script>