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() }) },