From 3875d7b5bf0c2e85c914b447fb77975faba004dd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 19 Aug 2022 15:02:04 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Editor/ComponentWrapper.vue | 7 ++++-- .../src/views/panel/list/PanelViewShow.vue | 22 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index d73511e460..c688aa6fbc 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -131,7 +131,7 @@ export default { } }, svgInnerEnable() { - return this.config.commonBackground.enable && this.config.commonBackground.backgroundType === 'innerImage' && typeof this.config.commonBackground.innerImage === 'string' + return !this.screenShot&&this.config.commonBackground.enable && this.config.commonBackground.backgroundType === 'innerImage' && typeof this.config.commonBackground.innerImage === 'string' }, mainSlotSvgInner() { if (this.svgInnerEnable) { @@ -153,7 +153,10 @@ export default { colorRGBA = hexColorToRGBA(this.config.commonBackground.color, this.config.commonBackground.alpha) } if (this.config.commonBackground.enable) { - if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') { + if (this.screenShot && this.config.commonBackground.backgroundType === 'innerImage' && typeof this.config.commonBackground.innerImage === 'string') { + let innerImage = this.config.commonBackground.innerImage.replace('svg', 'png') + style['background'] = `url(${innerImage}) no-repeat ${colorRGBA}` + } else if (this.config.commonBackground.backgroundType === 'outerImage' && typeof this.config.commonBackground.outerImage === 'string') { style['background'] = `url(${this.config.commonBackground.outerImage}) no-repeat ${colorRGBA}` } else { style['background-color'] = colorRGBA diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 9e029f8e3b..443a22e0fd 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, 0.1)" + element-loading-background="rgba(220,220,220,1)" > @@ -200,9 +200,16 @@ export default { }, computed: { imageWrapperStyle() { - return { - width: '100%', - height: '100%' + if (this.exporting) { + return { + width: '2560px', + height: '1440px' + } + } else { + return { + width: '100%', + height: '100%' + } } }, showMainFlag() { @@ -350,13 +357,6 @@ 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')