From 8d474630e55e20ec6815c6413b173eb58d83859c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 30 Jan 2024 16:26:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8E=86=E5=8F=B2=E4=B8=BB=E9=A2=98=E5=9C=A8=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=95=8C=E9=9D=A2=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E5=89=8D=E7=AB=AFconsole=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7783?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panelStyle/MobileBackgroundSelector.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/frontend/src/views/panel/subjectSetting/panelStyle/MobileBackgroundSelector.vue b/core/frontend/src/views/panel/subjectSetting/panelStyle/MobileBackgroundSelector.vue index 48043da0ba..ab021af0cd 100644 --- a/core/frontend/src/views/panel/subjectSetting/panelStyle/MobileBackgroundSelector.vue +++ b/core/frontend/src/views/panel/subjectSetting/panelStyle/MobileBackgroundSelector.vue @@ -107,6 +107,7 @@ import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils' import { COLOR_PANEL } from '@/views/chart/chart/chart' import { uploadFileResult } from '@/api/staticResource/staticResource' import bus from '@/utils/bus' +import { MOBILE_SETTING } from '@/views/panel/panel' export default { name: 'MobileBackgroundSelector', @@ -117,7 +118,7 @@ export default { dialogImageUrl: '', dialogVisible: false, uploadDisabled: false, - mobileSetting: null, + mobileSetting: deepCopy(MOBILE_SETTING), predefineColors: COLOR_PANEL } }, @@ -128,10 +129,14 @@ export default { // deep监听panel 如果改变 提交到 store }, created() { - // 初始化赋值 - this.mobileSetting = this.canvasStyleData.panel.mobileSetting - if (this.mobileSetting.imageUrl && typeof (this.mobileSetting.imageUrl) === 'string') { - this.fileList.push({ url: imgUrlTrans(this.mobileSetting.imageUrl) }) + if (this.canvasStyleData.panel.mobileSetting) { + // 初始化赋值 + this.mobileSetting = this.canvasStyleData.panel.mobileSetting + if (this.mobileSetting.imageUrl && typeof (this.mobileSetting.imageUrl) === 'string') { + this.fileList.push({ url: imgUrlTrans(this.mobileSetting.imageUrl) }) + } + } else { + this.canvasStyleData.panel['mobileSetting'] = this.mobileSetting } }, methods: {