From b0a0066942c5bc5fe6249cbefbf481d6e712ff01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Thu, 10 Apr 2025 16:14:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=8D=A1=E5=90=8C=E6=97=B6=E4=BD=BF=E7=94=A8=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E5=92=8C=E5=A4=96=E9=83=A8=E4=BA=8B=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E9=9D=9E=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BD=BF=E7=94=A8=E5=BC=B9=E6=A1=86=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=89=A7=E8=A1=8C=E4=BA=8B=E4=BB=B6=20(#15763)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/ComponentWrapper.vue | 28 ++++++-- .../components/visualization/ViewTrackBar.vue | 10 ++- .../indicator/DeIndicator.vue | 69 +++++++++++++------ .../custom-component/user-view/Component.vue | 9 ++- core/core-frontend/src/locales/en.ts | 2 +- core/core-frontend/src/locales/zh-CN.ts | 2 +- .../views/chart/components/views/index.vue | 12 +++- 7 files changed, 98 insertions(+), 34 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue index 09e0ddf47a..87e356f11c 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue @@ -314,11 +314,20 @@ const eventEnable = computed( ['indicator', 'rich-text'].includes(config.value.innerType)) && config.value.events && config.value.events.checked && - (isDashboard() || (!isDashboard() && !isMobile())) + (isDashboard() || (!isDashboard() && !isMobile())) && + showPosition.value !== 'canvas-multiplexing' ) +const onWrapperClickCur = e => { + // 指标卡为内部触发 + if (['indicator'].includes(config.value.innerType)) { + return + } + onWrapperClick(e) +} + const onWrapperClick = e => { - if (eventEnable.value && showPosition.value !== 'canvas-multiplexing') { + if (eventEnable.value) { if (config.value.events.type === 'showHidden') { // 打开弹框区域 nextTick(() => { @@ -349,8 +358,8 @@ const onWrapperClick = e => { } else if (config.value.events.type === 'download') { useEmitt().emitter.emit('canvasDownload') } - e.preventDefault() - e.stopPropagation() + e?.preventDefault() + e?.stopPropagation() } } @@ -374,6 +383,13 @@ const freezeFlag = computed(() => { scrollMain.value - config.value.style?.top > 0 ) }) + +const commonParams = computed(() => { + return { + eventEnable: eventEnable.value, + eventType: config.value.events.type + } +})