|
@@ -171,19 +171,18 @@ export default {
|
|
|
this.send = true
|
|
|
var ele = this.preview
|
|
|
setTimeout(() => {
|
|
|
- var targetDom = document.getElementById('Gambol')
|
|
|
- // var copyDom = targetDom.cloneNode(true)
|
|
|
- // document.querySelector('body').appendChild(copyDom)
|
|
|
- html2canvas(targetDom, { useCORS: true }).then(canvas => {
|
|
|
+ const targetDom = document.getElementById('Gambol')
|
|
|
+ var copyDom = targetDom.cloneNode(true)
|
|
|
+ document.querySelector('body').appendChild(copyDom)
|
|
|
+ html2canvas(document.getElementsByClassName('reportContent')[1], { useCORS: true }).then(canvas => {
|
|
|
var url = canvas.toDataURL('image/png', 1)
|
|
|
url = url.toString().substring(url.indexOf(',') + 1)
|
|
|
var postData = { 'reportId': ele.id, 'imgStr': url, 'url': window.location.href, 'emailUser': e.name, 'copyTo': e.names }
|
|
|
dailyReportSendmail(postData).then(res => {
|
|
|
- // document.querySelector('body').removeChild(copyDom)
|
|
|
- // copyDom = null
|
|
|
res.code === 200 ? this.$message({ type: 'success', message: '发送测试报告成功' }) : this.$message({ type: 'error', message: '发送测试报告失败,请联系管理员!' })
|
|
|
this.send = false
|
|
|
this.handleClose()
|
|
|
+ document.querySelector('body').removeChild(copyDom)
|
|
|
})
|
|
|
})
|
|
|
}, 500)
|