From 193423bb9874815bf4b614776f4bf4d983007b88 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 31 Aug 2022 16:56:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=A0=B7=E5=BC=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=BC=A9=E7=95=A5=E5=9B=BE=E5=A2=9E=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E9=83=A8=E7=BD=B2=E8=AF=BB=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/background/index.vue | 4 ++-- .../panel/SubjectSetting/PanelStyle/BackgroundSelector.vue | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/background/index.vue b/frontend/src/views/background/index.vue index fb078f4449..5b1ff9de34 100644 --- a/frontend/src/views/background/index.vue +++ b/frontend/src/views/background/index.vue @@ -132,7 +132,7 @@ import { queryBackground } from '@/api/background/background' import BackgroundItem from '@/views/background/BackgroundItem' import { mapState } from 'vuex' -import { deepCopy } from '@/components/canvas/utils/utils' +import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils' import { COLOR_PANEL } from '@/views/chart/chart/chart' import { uploadFileResult } from '@/api/staticResource/staticResource' import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list' @@ -171,7 +171,7 @@ export default { methods: { init() { if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') { - this.fileList.push({ url: this.curComponent.commonBackground.outerImage }) + this.fileList.push({ url: imgUrlTrans(this.curComponent.commonBackground.outerImage) }) } this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE) this.queryBackground() diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue index 9d091f55e4..687d98a346 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/BackgroundSelector.vue @@ -52,6 +52,8 @@ import { mapState } from 'vuex' import { deepCopy } from '@/components/canvas/utils/utils' import { COLOR_PANEL } from '@/views/chart/chart/chart' import { uploadFileResult } from '@/api/staticResource/staticResource' +import {imgUrlTrans} from "@/components/canvas/utils/utils"; + export default { name: 'BackgroundSelector', @@ -77,7 +79,7 @@ export default { // 初始化赋值 this.panel = this.canvasStyleData.panel if (this.panel.imageUrl && typeof (this.panel.imageUrl) === 'string') { - this.fileList.push({ url: this.panel.imageUrl }) + this.fileList.push({ url: imgUrlTrans(this.panel.imageUrl) }) } }, methods: { @@ -111,7 +113,7 @@ export default { uploadFileResult(file.file, (fileUrl) => { _this.$store.commit('canvasChange') _this.panel.imageUrl = fileUrl - _this.fileList = [{ url: this.panel.imageUrl }] + _this.fileList = [{ url: imgUrlTrans(this.panel.imageUrl) }] _this.commitStyle() }) },