Browse Source

附件下载

jbb 2 years ago
parent
commit
2e6a2e98ed
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/views/reportForms/fabric-loss-table/attachment-display.vue

+ 3 - 1
src/views/reportForms/fabric-loss-table/attachment-display.vue

@@ -61,6 +61,8 @@ export default {
            'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].
             indexOf(ext.toLowerCase()) !== -1;
        },
+
+      //  点击附件下载
       accessoryDownload(item){
        downFile(item.src).then(data => {
         if (!data) {
@@ -74,7 +76,7 @@ export default {
           let link = document.createElement('a')
           link.style.display = 'none'
           link.href = url
-          link.setAttribute('download', item.name + '.xls')
+          link.setAttribute('download', item.name)
           document.body.appendChild(link)
           link.click()
           document.body.removeChild(link) // 下载完成移除元素