From 21c61424b76d507d57e241b238703c516d1a0d8a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 5 Aug 2024 15:18:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E4=BA=8B=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/ComponentWrapper.vue | 19 +++++++ .../data-visualization/canvas/DePreview.vue | 22 ++++++-- .../custom-component/common/CommonAttr.vue | 3 +- .../custom-component/common/CommonEvent.vue | 52 ++++++++++++++++--- .../src/custom-component/component-list.ts | 27 ++++++++-- 5 files changed, 107 insertions(+), 16 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 f08905b9cf..c79e97a3b9 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue @@ -207,6 +207,24 @@ const onPointClick = param => { emits('onPointClick', param) } +const onWrapperClick = () => { + if (['Picture,ScrollText'].includes(config.value.component)) { + // doWrapperClick + if (config.value.events && config.value.events.checked) { + if (config.value.events.type === 'displayChange') { + // 打开弹框区域 + nextTick(() => { + dvMainStore.popAreaActiveSwitch() + }) + } else if (config.value.events.type === 'jump') { + window.open(config.value.events.jump.value, '_blank') + } else if (config.value.events.type === 'refresh') { + useEmitt().emitter.emit('componentRefresh') + } + } + } +} + const deepScale = computed(() => scale.value / 100) @@ -247,6 +265,7 @@ const deepScale = computed(() => scale.value / 100) class="wrapper-inner-adaptor" :style="slotStyle" :class="{ 'pop-wrapper-inner': popActive }" + @click="onWrapperClick" > { if (downloadStatus.value) { return @@ -228,14 +236,18 @@ const initRefreshTimer = () => { } } refreshTimer.value = setInterval(() => { - searchCount.value++ - if (isMainCanvas(canvasId.value)) { - refreshOtherComponent(dvInfo.value.id, dvInfo.value.type) - } + refreshDataV() }, refreshTime) } } +const refreshDataV = () => { + searchCount.value++ + if (isMainCanvas(canvasId.value)) { + refreshOtherComponent(dvInfo.value.id, dvInfo.value.type) + } +} + const initWatermark = (waterDomId = 'preview-canvas-main') => { if (dvInfo.value.watermarkInfo && isMainCanvas(canvasId.value)) { if (userInfo.value && userInfo.value.model !== 'lose') { diff --git a/core/core-frontend/src/custom-component/common/CommonAttr.vue b/core/core-frontend/src/custom-component/common/CommonAttr.vue index 4044854748..bb8b6e746b 100644 --- a/core/core-frontend/src/custom-component/common/CommonAttr.vue +++ b/core/core-frontend/src/custom-component/common/CommonAttr.vue @@ -95,8 +95,7 @@ const colorPickerWidth = computed(() => { // 暂时关闭 const eventsShow = computed(() => { - return false - // return !dashboardActive.value && ['Picture'].includes(element.value.component) + return !dashboardActive.value && ['Picture'].includes(element.value.component) }) const backgroundCustomShow = computed(() => { diff --git a/core/core-frontend/src/custom-component/common/CommonEvent.vue b/core/core-frontend/src/custom-component/common/CommonEvent.vue index 6f40d96a09..697c4d58b7 100644 --- a/core/core-frontend/src/custom-component/common/CommonEvent.vue +++ b/core/core-frontend/src/custom-component/common/CommonEvent.vue @@ -1,7 +1,8 @@