From 85a925db09a0e15dfd82f6c3441ec257467d41e5 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 22 May 2024 10:18:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E8=B7=B3=E8=BD=AC=E5=8A=9F=E8=83=BD=E6=94=BE?= =?UTF-8?q?=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/ChartComponentG2Plot.vue | 4 +-- .../views/components/ChartComponentS2.vue | 5 +--- .../views/chart/components/views/index.vue | 26 ++++++++++++++++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index 947620c2f5..d611c25d25 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -159,7 +159,6 @@ const renderG2Plot = (chart, chartView: G2PlotChartView) => { const dynamicAreaId = ref('') const country = ref('') const appStore = useAppStoreWithOut() -const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) const chartContainer = ref(null) let mapTimer: number const renderL7Plot = async (chart: ChartObj, chartView: L7PlotChartView, callback) => { @@ -259,7 +258,7 @@ const trackClick = trackAction => { dvMainStore.addViewTrackFilter(linkageParam) break case 'jump': - if (isDataEaseBi.value || mobileInPc.value) return + if (mobileInPc.value) return emit('onJumpClick', jumpParam) break default: @@ -284,7 +283,6 @@ const trackMenu = computed(() => { }) jumpCount && view.value?.jumpActive && - !isDataEaseBi.value && !mobileInPc.value && trackMenuInfo.push('jump') linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage') diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index 6fc89da2db..d2a468b701 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -262,8 +262,6 @@ const action = param => { } const appStore = useAppStoreWithOut() -const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) - const trackClick = trackAction => { const param = state.pointParam if (!param?.data?.dimensionList) { @@ -296,7 +294,7 @@ const trackClick = trackAction => { dvMainStore.addViewTrackFilter(linkageParam) break case 'jump': - if (isDataEaseBi.value || mobileInPc.value) return + if (mobileInPc.value) return emit('onJumpClick', jumpParam) break default: @@ -322,7 +320,6 @@ const trackMenu = computed(() => { }) jumpCount && view.value?.jumpActive && - !isDataEaseBi.value && !mobileInPc.value && trackMenuInfo.push('jump') linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage') diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 2a4f42d3cf..272a0d417d 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -2,6 +2,8 @@ import { useI18n } from '@/hooks/web/useI18n' import ChartComponentG2Plot from './components/ChartComponentG2Plot.vue' import DeIndicator from '@/custom-component/indicator/DeIndicator.vue' +import { useAppStoreWithOut } from '@/store/modules/app' +import { XpackComponent } from '@/components/plugin' import { computed, CSSProperties, @@ -99,6 +101,7 @@ const props = defineProps({ }) const dynamicAreaId = ref('') const { view, showPosition, element, active, searchCount, scale } = toRefs(props) +const appStore = useAppStoreWithOut() const titleShow = computed( () => @@ -235,6 +238,7 @@ watch([() => curComponent.value], () => { }) } }) +const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) const chartExtRequest = shallowRef(null) provide('chartExtRequest', chartExtRequest) @@ -313,10 +317,21 @@ const filter = (firstLoad?: boolean) => { const onDrillFilters = param => { state.drillFilters = param ? param : [] } +const openHandler = ref(null) +const initOpenHandler = newWindow => { + if (openHandler?.value) { + const pm = { + methodName: 'initOpenHandler', + args: newWindow + } + openHandler.value.invokeMethod(pm) + } +} const windowsJump = (url, jumpType) => { try { - window.open(url, jumpType) + const newWindow = window.open(url, jumpType) + initOpenHandler(newWindow) if (jumpType === '_self') { location.reload() } @@ -350,13 +365,17 @@ const jumpClick = param => { param.sourceDvId = dvInfo.value.id param.sourceViewId = param.viewId param.sourceFieldId = dimension.id + let embeddedBaseUrl = '' + if (isDataEaseBi.value) { + embeddedBaseUrl = embeddedStore.baseUrl + } // 内部仪表板跳转 if (jumpInfo.linkType === 'inner') { if (jumpInfo.targetDvId) { if (publicLinkStatus.value) { // 判断是否有公共链接ID if (jumpInfo.publicJumpId) { - const url = `#/de-link/${jumpInfo.publicJumpId}?jumpInfoParam=${encodeURIComponent( + const url = `${embeddedBaseUrl}#/de-link/${jumpInfo.publicJumpId}?jumpInfoParam=${encodeURIComponent( Base64.encode(JSON.stringify(param)) )}` const currentUrl = window.location.href @@ -366,7 +385,7 @@ const jumpClick = param => { ElMessage.warning(t('visualization.public_link_tips')) } } else { - const url = `#/preview?dvId=${jumpInfo.targetDvId}&jumpInfoParam=${encodeURIComponent( + const url = `${embeddedBaseUrl}#/preview?dvId=${jumpInfo.targetDvId}&jumpInfoParam=${encodeURIComponent( Base64.encode(JSON.stringify(param)) )}` windowsJump(url, jumpInfo.jumpType) @@ -713,6 +732,7 @@ const titleIconStyle = computed(() => { :view-icon="view.type" > +