jwyu 1 年之前
父节点
当前提交
adac4e30c7
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/views/smartReport/reportList.vue

+ 4 - 4
src/views/smartReport/reportList.vue

@@ -290,7 +290,7 @@
                                 <span
                                     v-if="scope.row.DetailImgUrl"
                                     v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg"
-                                    @click="handleDownReportImg(scope.row.DetailImgUrl)"
+                                    @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
                                     style="cursor: pointer; color: #4099ef;display:inline-block"
                                 >图片下载</span>
                                 <!-- <span
@@ -346,7 +346,7 @@
                                 <span
                                     v-if="scope.row.DetailImgUrl&&scope.row.State===4"
                                     v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg"
-                                    @click="handleDownReportImg(scope.row.DetailImgUrl)"
+                                    @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
                                     style="cursor: pointer; color: #4099ef;display:inline-block"
                                 >图片下载</span>
                             </template>
@@ -565,7 +565,7 @@ export default {
     },
     methods:{
         // 下载报告图片
-        handleDownReportImg(imgUrl){
+        handleDownReportImg(imgUrl,title){
             let img=new Image()
             img.setAttribute('crossOrigin', 'anonymous');
             img.src=imgUrl
@@ -577,7 +577,7 @@ export default {
                 context.drawImage(img, 0, 0, img.width, img.height);
                 let dataURL = canvas.toDataURL("image/png", 1);
                 const a=document.createElement('a')
-                a.setAttribute("download",this.reportInfo.Title)
+                a.setAttribute("download",title)
                 a.style.display = "none"
                 a.href=dataURL
                 document.body.appendChild(a);