qinzhipeng_v 5 vuotta sitten
vanhempi
sitoutus
8cbab1181a
1 muutettua tiedostoa jossa 20 lisäystä ja 7 poistoa
  1. 20 7
      src/views/Platform/presentation/testPresenyL.vue

+ 20 - 7
src/views/Platform/presentation/testPresenyL.vue

@@ -122,14 +122,27 @@ export default {
     },
 
     sendReport(e, ele) {
-      domtoimage.toJpeg(document.getElementById('resumeId'), { quality: 0.95 })
-        .then(function(dataUrl) {
-          var url = dataUrl
-          url = url.toString().substring(url.indexOf(',') + 1)
-          var postData = { 'reportId': ele.id, 'imgStr': url, 'url': window.location.href, 'emailUser': e }
-          dailyReportSendmail(postData).then(res => { console.log(res) })
-        })
+      // var node = document.getElementById('resumeId')
+      // domtoimage.toPng(node).then(function(dataUrl) {
+      //   var url = dataUrl
+      //   url = url.toString().substring(url.indexOf(',') + 1)
+      //   var postData = { 'reportId': ele.id, 'imgStr': url, 'url': window.location.href, 'emailUser': e }
+      //   dailyReportSendmail(postData).then(res => {
+      //     // res.code === 200 ? that.$message({ type: 'success', message: '发送测试报告成功' }) : that.$message({ type: 'error', message: '发送测试报告失败,请联系管理员!' })
+      //   })
+      //   var img = new Image()
+      //   img.src = dataUrl
+      //   document.body.appendChild(img)
 
+      domtoimage.toJpeg(document.getElementById('resumeId')).then(function(dataUrl) {
+        var url = dataUrl
+        url = url.toString().substring(url.indexOf(',') + 1)
+        var postData = { 'reportId': ele.id, 'imgStr': url, 'url': window.location.href, 'emailUser': e }
+        dailyReportSendmail(postData).then(res => { console.log(res) })
+      })
+      // }).catch(function(error) {
+      //   console.error('oops, something went wrong!', error)
+      // })
       // setTimeout(() => {
       //   var that = this
       //   that.btn = false