From 63e8e842f08a8dfda3082b8cd54e12176655bdd1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 3 Nov 2024 13:35:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=8C=87=E6=A0=87=E5=8D=A1=E3=80=81=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=AD=89=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/data-visualization/snapshot.ts | 3 +- .../editor/editor-style/ChartStyle.vue | 8 +- .../editor/editor-style/VQueryChartStyle.vue | 18 +- .../editor-style/components/MiscSelector.vue | 388 +++++++++--------- .../src/views/mobile/panel/index.vue | 2 +- 5 files changed, 222 insertions(+), 197 deletions(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts index 9e45e520dd..16f0d85bec 100644 --- a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts +++ b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts @@ -164,7 +164,8 @@ export const snapshotStore = defineStore('snapshot', { recordSnapshot() { this.styleChangeTimes = ++this.styleChangeTimes - if (dataPrepareState.value) { + // 移动端设计时暂不保存镜像 + if (dataPrepareState.value && !mobileInPc) { const snapshotComponentData = deepCopy(componentData.value) dvMainStore.removeGroupArea(snapshotComponentData) // 添加新的快照 diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 748e597fe1..3d4aa62abf 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -409,6 +409,7 @@ watch( class="attr-selector" :chart="chart" :quota-fields="props.quotaData" + :mobile-in-pc="mobileInPc" @onMiscChange="onMiscChange" /> @@ -445,9 +446,12 @@ watch( @onLabelChange="onLabelChange" /> - + { obj.placeholder = '' } currentSearch.value = obj + snapshotStore.recordSnapshotCacheToMobile('propValue') } const init = () => { @@ -182,8 +183,20 @@ const checkBold = type => { chart.value.customStyle.component[type] = chart.value.customStyle.component[type] ? '' : 'bold' } +const handleCurrentPlaceholderCustomChange = () => { + if (mobileInPc.value) { + //移动端设计 + useEmitt().emitter.emit('onMobileStatusChange', { + type: 'componentStyleChange', + value: { type: 'renderChart', component: JSON.parse(JSON.stringify(chart.value)) } + }) + } else { + snapshotStore.recordSnapshotCache() + } +} + const handleCurrentPlaceholderChange = () => { - snapshotStore.recordSnapshotCache() + snapshotStore.recordSnapshotCacheToMobile('propValue') } const checkItalic = type => { @@ -409,6 +422,7 @@ initParams() 提示词 @@ -427,10 +441,12 @@ initParams() is-custom v-model="chart.customStyle.component.text" :disabled="!chart.customStyle.component.placeholderShow" + @change="handleCurrentPlaceholderCustomChange" :predefine="predefineColors" /> propertyInner?: Array + mobileInPc?: boolean }>(), - { themes: 'dark' } + { themes: 'dark', mobileInPc: false } ) useEmitt({ @@ -391,202 +392,205 @@ onMounted(() => { - - + - {{ t('chart.fix') }} - {{ t('chart.dynamic') }} - - - - - - - - - - + {{ t('chart.fix') }} + {{ t('chart.dynamic') }} + + + + + + + + + - - - - {{ item.name }} - - - - - - - - - - - - - - - - - - - + + + + + {{ item.name }} + + + + + + + + + + + + + + + + + + + - - - {{ t('chart.fix') }} - {{ t('chart.dynamic') }} - - - - - - - - - - + {{ t('chart.fix') }} + {{ t('chart.dynamic') }} + + + + + + + + + - - - - {{ item.name }} - - - - - - - - - - - - - - - - - - - + + + + + {{ item.name }} + + + + + + + + + + + + + + + + + + + + + diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index af4f333e06..b114f4c735 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -83,7 +83,7 @@ const hanedleMessage = event => { } else if (type === 'updateTitle') { mobileViewStyleSwitch(component) useEmitt().emitter.emit('updateTitle-' + component.id) - } else if (['style', 'commonBackground', 'events'].includes(type)) { + } else if (['style', 'commonBackground', 'events', 'propValue'].includes(type)) { const mobileComponent = findComponentById(component.id) mobileComponent[type] = component[type] }