瀏覽代碼

附件下载

jbb 2 年之前
父節點
當前提交
2e6a2e98ed
共有 1 個文件被更改,包括 3 次插入1 次删除
  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) // 下载完成移除元素