Merge pull request #1355 from dataease/pr@v1.5@refactor_panel-pdf

refactor: 仪表板导出pdf优化,防止导出画面不全
This commit is contained in:
王嘉豪 2021-12-01 14:48:53 +08:00 committed by GitHub
commit c8a84337a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -4,6 +4,7 @@ export function tree(data) {
return request({
url: '/api/panelView/tree',
method: 'post',
timeout: 30000,
data
})
}
@ -12,6 +13,7 @@ export function viewsWithIds(data) {
return request({
url: '/api/panelView/viewsWithIds',
method: 'post',
timeout: 30000,
loading: true,
data
})
@ -21,6 +23,7 @@ export function findOne(id) {
return request({
url: '/api/panelView/findOne/' + id,
method: 'get',
timeout: 30000,
loading: true
})
}

View File

@ -4,6 +4,7 @@
<div
id="canvasInfoTemp"
ref="canvasInfoTemp"
:style="{height:mainHeight}"
class="main-class"
@mouseup="deselectCurComponent"
@mousedown="handleMouseDown"
@ -153,8 +154,14 @@ export default {
erd.listenTo(mainDom, element => {
_this.$nextTick(() => {
_this.restore()
})
})
// div
const tempCanvas = document.getElementById('canvasInfoTemp')
erd.listenTo(tempCanvas, element => {
_this.$nextTick(() => {
// mainHeight px html2canvas
_this.mainHeight = mainDom.scrollHeight + 'px!important'
_this.mainHeight = tempCanvas.scrollHeight + 'px!important'
})
})
eventBus.$on('openChartDetailsDialog', this.openChartDetailsDialog)