Merge pull request #3876 from dataease/pr@dev@fix_link_down_pdf

fix(公共链接): 导出pdf出现loading
This commit is contained in:
wisonic-s 2022-11-25 15:14:05 +08:00 committed by GitHub
commit c86c94a372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -623,17 +623,28 @@ export default {
document.getElementById('preview-canvas-main').style.height = (scrollHeight + 'px') document.getElementById('preview-canvas-main').style.height = (scrollHeight + 'px')
setTimeout(() => { setTimeout(() => {
html2canvas(document.getElementById(domId)).then(canvas => { const timer = setInterval(() => {
const snapshot = canvas.toDataURL('image/jpeg', 1) // const containerDom = document.getElementById(domId)
this.dataLoading = false const masks = containerDom.getElementsByClassName('el-loading-mask')
this.$emit('change-load-status', false) const mapLoadingArr = containerDom.getElementsByClassName('.symbol-map-loading')
this.exporting = false if (masks?.length) {
this.backScreenShot = false const hideMasks = [...masks].filter(item => item.style?.display === 'none')
if (snapshot !== '') { if (masks.length === hideMasks.length && !mapLoadingArr?.length) {
this.snapshotInfo = snapshot html2canvas(containerDom).then(canvas => {
this.pdfExportShow = true const snapshot = canvas.toDataURL('image/jpeg', 1) //
this.dataLoading = false
this.$emit('change-load-status', false)
this.exporting = false
this.backScreenShot = false
if (snapshot !== '') {
this.snapshotInfo = snapshot
this.pdfExportShow = true
}
})
clearInterval(timer)
}
} }
}) }, 1000)
}, 2500) }, 2500)
}, 500) }, 500)
}, },