From 42b6951ed224da7fdf246b88afb9fb1ed2739b64 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Tue, 18 Mar 2025 14:29:55 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E7=BB=84=E4=BB=B6=E4=BA=8B=E4=BB=B6=E5=BC=B9=E7=AA=97?=
=?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=89=93=E5=BC=80=E6=96=B9=E5=BC=8F=20#15087?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../canvas/ComponentWrapper.vue | 21 ++++---------------
.../visualization/DePreviewPopDialog.vue | 2 +-
.../custom-component/common/CommonEvent.vue | 5 +++++
3 files changed, 10 insertions(+), 18 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 9a6b1e1261..cca9034bdd 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue
@@ -15,6 +15,7 @@ import { isMobile } from '@/utils/utils'
import { isDashboard } from '@/utils/canvasUtils'
import { XpackComponent } from '@/components/plugin'
import { useAppStoreWithOut } from '@/store/modules/app'
+import DePreviewPopDialog from '@/components/visualization/DePreviewPopDialog.vue'
const appStore = useAppStoreWithOut()
const componentWrapperInnerRef = ref(null)
@@ -23,6 +24,7 @@ const dvMainStore = dvMainStoreWithOut()
const downLoading = ref(false)
const { wsCache } = useCache('localStorage')
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
+const dePreviewPopDialogRef = ref(null)
const commonFilterAttrsFilterBorder = [
'width',
'height',
@@ -320,25 +322,9 @@ const onWrapperClick = e => {
const jumpType = config.value.events.jump.type
try {
if ('newPop' === jumpType) {
- console.info('DataEase Component Jump newPop value:' + window['originOpen'])
- if (window['originOpen']) {
- console.info('DataEase Component originOpen newPop')
- window['originOpen'](
- url,
- '_blank',
- 'width=800,height=600,left=200,top=100,toolbar=no,scrollbars=yes,resizable=yes,location=no'
- )
- } else {
- window.open(
- url,
- '_blank',
- 'width=800,height=600,left=200,top=100,toolbar=no,scrollbars=yes,resizable=yes,location=no'
- )
- }
+ dePreviewPopDialogRef.value.previewInit({ url, size: 'middle' })
} else if ('_blank' === jumpType) {
- console.info('DataEase Component Jump _blank value:' + window['originOpen'])
if (window['originOpen']) {
- console.info('DataEase Component originOpen _blank')
window['originOpen'](url, '_blank')
} else {
window.open(url, '_blank')
@@ -455,6 +441,7 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
ref="openHandler"
jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI="
/>
+
diff --git a/core/core-frontend/src/components/visualization/DePreviewPopDialog.vue b/core/core-frontend/src/components/visualization/DePreviewPopDialog.vue
index 88deee27ac..0192b360ba 100644
--- a/core/core-frontend/src/components/visualization/DePreviewPopDialog.vue
+++ b/core/core-frontend/src/components/visualization/DePreviewPopDialog.vue
@@ -49,7 +49,7 @@ const previewInit = params => {
if (params.url.includes('?')) {
state.url = `${params.url}&popWindow=true`
} else {
- state.url = `${params.url}&popWindow=true`
+ state.url = `${params.url}?popWindow=true`
}
if (params.size === 'large') {
state.fullscreen = true
diff --git a/core/core-frontend/src/custom-component/common/CommonEvent.vue b/core/core-frontend/src/custom-component/common/CommonEvent.vue
index c382a66ae1..0ffbd31d36 100644
--- a/core/core-frontend/src/custom-component/common/CommonEvent.vue
+++ b/core/core-frontend/src/custom-component/common/CommonEvent.vue
@@ -130,6 +130,11 @@ const typeMap = {