Merge pull request #7915 from dataease/pr@dev@fix_panel-console

fix(仪表板): 修复历史主题在编辑界面移动端设计时前端console报错问题 #7783
This commit is contained in:
王嘉豪 2024-01-30 16:30:37 +08:00 committed by GitHub
commit fd20c291ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,6 +107,7 @@ import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart' import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource' import { uploadFileResult } from '@/api/staticResource/staticResource'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { MOBILE_SETTING } from '@/views/panel/panel'
export default { export default {
name: 'MobileBackgroundSelector', name: 'MobileBackgroundSelector',
@ -117,7 +118,7 @@ export default {
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
uploadDisabled: false, uploadDisabled: false,
mobileSetting: null, mobileSetting: deepCopy(MOBILE_SETTING),
predefineColors: COLOR_PANEL predefineColors: COLOR_PANEL
} }
}, },
@ -128,10 +129,14 @@ export default {
// deeppanel store // deeppanel store
}, },
created() { created() {
// if (this.canvasStyleData.panel.mobileSetting) {
this.mobileSetting = this.canvasStyleData.panel.mobileSetting //
if (this.mobileSetting.imageUrl && typeof (this.mobileSetting.imageUrl) === 'string') { this.mobileSetting = this.canvasStyleData.panel.mobileSetting
this.fileList.push({ url: imgUrlTrans(this.mobileSetting.imageUrl) }) 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: { methods: {