From 91b74d22cfeff1986eee143d8aea44911b10b273 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Wed, 23 Oct 2024 20:16:06 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BE=E8=AE=A1?=
=?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=83=A8=E5=88=86=E4=BA=A4=E4=BA=92=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
core/core-frontend/src/utils/canvasUtils.ts | 4 ++--
.../src/views/chart/components/editor/index.vue | 14 ++++++++++++++
.../src/views/common/ComponentStyleEditor.vue | 11 +++++++++--
.../src/views/dashboard/MobileConfigPanel.vue | 14 +++++++++++++-
.../core-frontend/src/views/mobile/panel/index.vue | 14 +++++++++++---
5 files changed, 49 insertions(+), 8 deletions(-)
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(() => {