From d7c56b520f4b5713731f547faa9b8680f20f6404 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 18 Aug 2022 18:24:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E9=94=80=E6=AF=81=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Toolbar.vue | 2 ++ .../src/views/panel/list/PanelViewShow.vue | 22 +++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 565d3c78e0..c01ea704c7 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -205,6 +205,8 @@ export default { eventBus.$off('preview', this.preview) eventBus.$off('save', this.save) eventBus.$off('clearCanvas', this.clearCanvas) + clearInterval(this.timer) + this.timer = null }, methods: { close() { diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 72cc6ecce0..9e029f8e3b 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -4,7 +4,7 @@ style="height: 100%;width: 100%;" :element-loading-text="$t('panel.data_loading')" element-loading-spinner="el-icon-loading" - element-loading-background="rgba(220,220,220, 1)" + element-loading-background="rgba(220,220,220, 0.1)" > @@ -200,16 +200,9 @@ export default { }, computed: { imageWrapperStyle() { - if (this.exporting) { - return { - width: '2560px', - height: '1440px' - } - } else { - return { - width: '100%', - height: '100%' - } + return { + width: '100%', + height: '100%' } }, showMainFlag() { @@ -357,6 +350,13 @@ export default { downloadAsImage() { this.dataLoading = true setTimeout(() => { + let svgElements = document.body.querySelectorAll('svg'); + svgElements.forEach(function(item) { + item.setAttribute("width", 100); + item.setAttribute("height", 100); + item.style.width = null; + item.style.height= null; + }); this.exporting = true setTimeout(() => { const canvasID = document.getElementById('canvasInfoTemp')