fix(仪表板): 修复历史主题在编辑界面移动端设计时前端console报错问题 #7783

This commit is contained in:
wangjiahao 2024-01-30 16:26:19 +08:00
parent e7335768b5
commit 8d474630e5

View File

@ -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 {
// deeppanel 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: {