Merge pull request #3861 from dataease/pr@dev@fix_link_down

fix(公共链接): 下载pdf缺失图片
This commit is contained in:
wisonic-s 2022-11-24 18:22:15 +08:00 committed by GitHub
commit 69780dd3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

View File

@ -1,10 +1,6 @@
<template>
<div
:id="previewMainDomId"
v-loading="dataLoading"
:element-loading-text="$t('panel.data_loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(220,220,220,1)"
class="bg"
:style="customStyle"
@scroll="canvasScroll"
@ -618,7 +614,8 @@ export default {
},
downloadAsPDF() {
this.dataLoading = true
const domId = this.canvasInfoTemp
this.$emit('change-load-status', true)
const domId = this.previewMainDomId
setTimeout(() => {
this.exporting = true
this.backScreenShot = true
@ -629,6 +626,7 @@ export default {
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 !== '') {
@ -636,7 +634,7 @@ export default {
this.pdfExportShow = true
}
})
}, 1500)
}, 2500)
}, 500)
},
closePreExport() {

View File

@ -1,11 +1,18 @@
<template>
<div style="width: 100%;height: 100vh;background-color: #f7f8fa">
<div
v-loading="dataLoading"
style="width: 100%;height: 100vh;background-color: #f7f8fa"
:element-loading-text="$t('panel.data_loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(220,220,220,1)"
>
<Preview
v-if="show"
:component-data="mainCanvasComponentData"
:canvas-style-data="canvasStyleData"
:panel-info="panelInfo"
:user-id="user"
@change-load-status="setLoading"
/>
</div>
</template>
@ -38,7 +45,8 @@ export default {
return {
canvasId: 'canvas-main',
show: false,
panelInfo: {}
panelInfo: {},
dataLoading: false
}
},
computed: {
@ -55,6 +63,9 @@ export default {
this.viewLog()
},
methods: {
setLoading(status) {
this.dataLoading = !!status
},
viewLog() {
const param = {
panelId: this.resourceId,