diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index d181b3f0d8..04cf68ba00 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -311,7 +311,7 @@ export const dvMainStore = defineStore('dataVisualization', { if (this.mobileInPc) { useEmitt().emitter.emit('curComponentChange', { type: 'curComponentChange', - value: JSON.parse(JSON.stringify(this.curComponent)) + value: this.curComponent ? JSON.parse(JSON.stringify(this.curComponent)) : null }) } }, diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 616f9df154..b528e4c65e 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -787,5 +787,7 @@ export function mobileViewStyleSwitch(component) { const viewInfo = canvasViewInfo.value[component.id] viewInfo.customStyle = component.customStyle viewInfo.customAttr = component.customAttr + viewInfo.title = component.title + viewInfo.name = component.name } } diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index ee5650ec64..580e4b8a64 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -1061,8 +1061,16 @@ const onChangeMiscStyleForm = val => { const onTextChange = val => { view.value.customStyle.text = val - useEmitt().emitter.emit('updateTitle-' + view.value.id) - snapshotStore.recordSnapshotCache('renderChart', view.value.id) + if (mobileInPc.value) { + //移动端设计 + useEmitt().emitter.emit('onMobileStatusChange', { + type: 'componentStyleChange', + value: { type: 'updateTitle', component: JSON.parse(JSON.stringify(view.value)) } + }) + } else { + useEmitt().emitter.emit('updateTitle-' + view.value.id) + snapshotStore.recordSnapshotCache('renderChart', view.value.id) + } } const onLegendChange = val => { diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index 018aa2cce5..0371dcaeb0 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -77,6 +77,9 @@ const hanedleMessage = event => { } else if (type === 'calcData') { mobileViewStyleSwitch(component) useEmitt().emitter.emit('calcData-' + component.id, component) + } else if (type === 'updateTitle') { + mobileViewStyleSwitch(component) + useEmitt().emitter.emit('updateTitle-' + component.id) } else if (['style', 'commonBackground'].includes(type)) { const mobileComponent = findComponentById(component.id) mobileComponent[type] = component[type]