From 46fcab765906964a185509ae01c56fcbdaad4446 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 24 Oct 2024 12:40:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=A0=B7=E5=BC=8F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BackgroundOverallCommon.vue | 4 +- .../custom-component/common/CommonAttr.vue | 45 ++----------------- .../custom-component/de-stream-media/Attr.vue | 4 +- .../src/custom-component/de-video/Attr.vue | 8 +++- .../custom-component/picture-group/Attr.vue | 7 +-- .../src/custom-component/picture/Attr.vue | 10 +---- .../modules/data-visualization/snapshot.ts | 13 +++++- .../editor/editor-style/VQueryChartStyle.vue | 44 +++++++++++++++++- .../views/chart/components/editor/index.vue | 9 +++- .../src/views/dashboard/MobileConfigPanel.vue | 7 ++- 10 files changed, 89 insertions(+), 62 deletions(-) diff --git a/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue b/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue index db133a1fbf..1da362b3f6 100644 --- a/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue +++ b/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue @@ -303,7 +303,7 @@ const init = () => { } queryBackground() const commitStyle = () => { - snapshotStore.recordSnapshotCache() + snapshotStore.recordSnapshotCacheToMobile('commonBackground') } const handleRemove = () => { @@ -325,7 +325,7 @@ const upload = file => { } const onBackgroundChange = () => { - snapshotStore.recordSnapshotCache() + snapshotStore.recordSnapshotCacheToMobile('commonBackground') emits('onBackgroundChange', state.commonBackground) } diff --git a/core/core-frontend/src/custom-component/common/CommonAttr.vue b/core/core-frontend/src/custom-component/common/CommonAttr.vue index 0b08343771..8e32042318 100644 --- a/core/core-frontend/src/custom-component/common/CommonAttr.vue +++ b/core/core-frontend/src/custom-component/common/CommonAttr.vue @@ -37,26 +37,13 @@ const props = withDefaults( const { themes, element, showStyle } = toRefs(props) const dvMainStore = dvMainStoreWithOut() -const { dvInfo, batchOptStatus } = storeToRefs(dvMainStore) +const { dvInfo, batchOptStatus, mobileInPc } = storeToRefs(dvMainStore) const activeName = ref(element.value.collapseName) -const styleKeys = computed(() => { - if (element.value) { - const curComponentStyleKeys = Object.keys(element.value.style) - return styleData.filter(item => curComponentStyleKeys.includes(item.key)) - } else { - return [] - } -}) - const onChange = () => { element.value.collapseName = activeName } -const isIncludesColor = str => { - return str.toLowerCase().includes('color') -} - const positionComponentShow = computed(() => { return !batchOptStatus.value && !dashboardActive.value }) @@ -71,31 +58,13 @@ const onBackgroundChange = val => { } const onStyleAttrChange = ({ key, value }) => { - snapshotStore.recordSnapshotCache() + snapshotStore.recordSnapshotCacheToMobile('style') emits('onAttrChange', { custom: 'style', property: key, value: value }) } const containerRef = ref() const containerWidth = ref() -const colSpan = computed(() => { - if (containerWidth.value <= 240) { - return 24 - } else { - return 12 - } -}) - -const colorPickerWidth = computed(() => { - if (containerWidth.value <= 280) { - return 125 - } else if (containerWidth.value <= 240) { - return 108 - } else { - return 197 - } -}) - const borderSettingShow = computed(() => { return !!element.value.style['borderStyle'] }) @@ -110,7 +79,7 @@ const eventsShow = computed(() => { }) const carouselShow = computed(() => { - return element.value.component === 'DeTabs' && element.value.carousel + return element.value.component === 'DeTabs' && element.value.carousel && !mobileInPc.value }) const backgroundCustomShow = computed(() => { @@ -129,12 +98,6 @@ onMounted(() => { }) }) }) -const stopEvent = e => { - if (e && e.code === 'Enter') { - e.stopPropagation() - e.preventDefault() - } -}