refactor: 仪表板导出pdf优化,防止导出画面不全

This commit is contained in:
wangjiahao 2021-12-01 14:47:19 +08:00
parent 0c97b7b9b3
commit 3ce6aaebfb
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)