forked from github/dataease
fix(嵌入式): 仪表板跳转功能放开
This commit is contained in:
parent
2c72063982
commit
85a925db09
@ -159,7 +159,6 @@ const renderG2Plot = (chart, chartView: G2PlotChartView<any, any>) => {
|
||||
const dynamicAreaId = ref('')
|
||||
const country = ref('')
|
||||
const appStore = useAppStoreWithOut()
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
const chartContainer = ref<HTMLElement>(null)
|
||||
let mapTimer: number
|
||||
const renderL7Plot = async (chart: ChartObj, chartView: L7PlotChartView<any, any>, 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')
|
||||
|
@ -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')
|
||||
|
@ -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"
|
||||
></chart-empty-info>
|
||||
<drill-path :drill-filters="state.drillFilters" @onDrillJump="drillJump" />
|
||||
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user