diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts
index 7687e24f7f..48bf818fdf 100644
--- a/core/core-frontend/src/utils/canvasUtils.ts
+++ b/core/core-frontend/src/utils/canvasUtils.ts
@@ -750,7 +750,7 @@ export function componentSwitch(componentData, changeComponent) {
export function findComponentById(componentId) {
let result
- componentData.forEach(item => {
+ componentData.value.forEach(item => {
if (item.id === componentId) {
result = item
} else if (item.component === 'Group') {
@@ -776,6 +776,6 @@ export function mobileViewStyleSwitch(component) {
if (component) {
const viewInfo = canvasViewInfo.value[component.id]
viewInfo.customStyle = component.customStyle
- viewInfo.customStyleMobile = component.customStyleMobile
+ viewInfo.customAttr = component.customAttr
}
}
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 db804f45d4..c7ace29314 100644
--- a/core/core-frontend/src/views/chart/components/editor/index.vue
+++ b/core/core-frontend/src/views/chart/components/editor/index.vue
@@ -1077,10 +1077,24 @@ const onFunctionCfgChange = val => {
const onBackgroundChange = val => {
curComponent.value.commonBackground = val
+ if (mobileInPc.value) {
+ //移动端设计
+ useEmitt().emitter.emit('onMobileStatusChange', {
+ type: 'componentStyleChange',
+ value: { type: 'commonBackground', component: JSON.parse(JSON.stringify(curComponent.value)) }
+ })
+ }
}
const onStyleAttrChange = val => {
curComponent.value.style[val.property] = val.value
+ if (mobileInPc.value) {
+ //移动端设计
+ useEmitt().emitter.emit('onMobileStatusChange', {
+ type: 'componentStyleChange',
+ value: { type: 'style', component: JSON.parse(JSON.stringify(curComponent.value)) }
+ })
+ }
}
const onAssistLineChange = val => {
diff --git a/core/core-frontend/src/views/common/ComponentStyleEditor.vue b/core/core-frontend/src/views/common/ComponentStyleEditor.vue
index c2c9d39094..bfc40a0c8e 100644
--- a/core/core-frontend/src/views/common/ComponentStyleEditor.vue
+++ b/core/core-frontend/src/views/common/ComponentStyleEditor.vue
@@ -5,7 +5,14 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import ViewEditor from '@/views/chart/components/editor/index.vue'
import { computed } from 'vue'
const dvMainStore = dvMainStoreWithOut()
-const { curComponent, canvasViewInfo, batchOptStatus } = storeToRefs(dvMainStore)
+const { curComponent, batchOptStatus } = storeToRefs(dvMainStore)
+
+defineProps({
+ canvasViewInfoMobile: {
+ type: Object,
+ required: true
+ }
+})
const otherEditorShow = computed(() => {
return Boolean(
@@ -35,7 +42,7 @@ const viewEditorShow = computed(() => {