From 39b709dec2cb1b47e1c6328ee4db26b13a2a21d2 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 5 Nov 2024 22:14:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E8=B6=85=E5=87=BA=E4=B8=80=E5=B1=8F=E6=97=B6?= =?UTF-8?q?tab=E5=86=85=E9=83=A8=E7=BB=84=E4=BB=B6=E7=A7=BB=E5=87=BA?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E9=98=B4=E5=BD=B1=E5=87=BA=E7=8E=B0=E5=90=91?= =?UTF-8?q?=E4=B8=8A=E5=81=8F=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/DePreview.vue | 13 +++++++++++-- .../components/data-visualization/canvas/Shape.vue | 5 +++-- .../src/store/modules/data-visualization/dvMain.ts | 4 +++- core/core-frontend/src/views/canvas/DeCanvas.vue | 10 +++++++++- .../src/views/data-visualization/PreviewCanvas.vue | 1 + 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index 3626de4346..01d50d1ada 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -78,6 +78,11 @@ const props = defineProps({ isSelector: { type: Boolean, default: false + }, + // 显示悬浮按钮 + showPopBar: { + type: Boolean, + default: false } }) @@ -91,7 +96,8 @@ const { previewActive, downloadStatus, outerScale, - outerSearchCount + outerSearchCount, + showPopBar } = toRefs(props) const domId = 'preview-' + canvasId.value const scaleWidthPoint = ref(100) @@ -398,7 +404,10 @@ const dataVPreview = computed( const linkOptBarShow = computed(() => { return Boolean( - canvasStyleData.value.suspensionButtonAvailable && !inMobile.value && !mobileInPc.value + canvasStyleData.value.suspensionButtonAvailable && + !inMobile.value && + !mobileInPc.value && + showPopBar.value ) }) diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue index da1d654e8b..c52d273136 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -156,7 +156,8 @@ const { tabCollisionActiveId, tabMoveInActiveId, tabMoveOutComponentId, - mobileInPc + mobileInPc, + mainScrollTop } = storeToRefs(dvMainStore) const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore) const emit = defineEmits([ @@ -558,7 +559,7 @@ const handleMouseDownOnShape = e => { mouseY: !isDashboard() && outerTabDom ? outerTabDom.offsetTop + curDom.offsetTop + offsetY + 100 - : curY, + : curY + mainScrollTop.value, width: componentWidth, height: componentHeight }) 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 dc82c0135b..905f5b6ea8 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -189,7 +189,8 @@ export const dvMainStore = defineStore('dataVisualization', { // 基础网格信息 baseCellInfo: {}, dataPrepareState: false, //数据准备状态 - multiplexingStyleAdapt: true //复用样式跟随主题 + multiplexingStyleAdapt: true, //复用样式跟随主题 + mainScrollTop: 0 //主画布运动量 } }, actions: { @@ -1330,6 +1331,7 @@ export const dvMainStore = defineStore('dataVisualization', { type: null, mobileLayout: false } + this.mainScrollTop = 0 }, setViewDataDetails(viewId, chartDataInfo) { this.canvasViewDataInfo[viewId] = chartDataInfo.data diff --git a/core/core-frontend/src/views/canvas/DeCanvas.vue b/core/core-frontend/src/views/canvas/DeCanvas.vue index dc023710f4..82351531ba 100644 --- a/core/core-frontend/src/views/canvas/DeCanvas.vue +++ b/core/core-frontend/src/views/canvas/DeCanvas.vue @@ -58,7 +58,8 @@ const scaleMin = ref(100) const state = reactive({ screenWidth: 1920, - screenHeight: 1080 + screenHeight: 1080, + curScrollTop: 0 }) //仪表板矩阵信息适配, @@ -266,6 +267,12 @@ const scrollTo = y => { }) } +const scrollCanvas = () => { + if (isMainCanvas(canvasId.value)) { + dvMainStore.mainScrollTop = canvasInner.value.scrollTop + } +} + watch( () => canvasActive.value, () => { @@ -299,6 +306,7 @@ defineExpose({ @drop="handleDrop" @dragover="handleDragOver" @mousedown="handleMouseDown" + @scroll="scrollCanvas" >