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')
setTimeout(() => {
html2canvas(document.getElementById(domId)).then(canvas => {
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
const timer = setInterval(() => {
const containerDom = document.getElementById(domId)
const masks = containerDom.getElementsByClassName('el-loading-mask')
const mapLoadingArr = containerDom.getElementsByClassName('.symbol-map-loading')
if (masks?.length) {
const hideMasks = [...masks].filter(item => item.style?.display === 'none')
if (masks.length === hideMasks.length && !mapLoadingArr?.length) {
html2canvas(containerDom).then(canvas => {
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)
}, 500)
},