fix(嵌入式): 跳转问题排查

This commit is contained in:
dataeaseShu 2025-01-02 16:48:42 +08:00 committed by fit2cloud-chenyw
parent 5439cead12
commit f9bfacc272
3 changed files with 15 additions and 16 deletions

View File

@ -53,9 +53,11 @@ const componentMap = {
const isDataFilling = ref(false)
const dataFillingPath = ref('')
const showComponent = ref(false)
const changeCurrentComponent = val => {
isDataFilling.value = false
showComponent.value = true
currentComponent.value = undefined
if (val && val.includes('DataFilling')) {
if (val === 'DataFilling') {
@ -70,7 +72,10 @@ const changeCurrentComponent = val => {
isDataFilling.value = true
})
} else {
currentComponent.value = componentMap[val]
nextTick(() => {
currentComponent.value = componentMap[val]
showComponent.value = false
})
}
}
@ -79,13 +84,12 @@ useEmitt({
callback: changeCurrentComponent
})
//currentComponent.value = componentMap[props.componentName]
onMounted(() => {
changeCurrentComponent(props.componentName)
})
</script>
<template>
<component :is="currentComponent" v-if="!isDataFilling"></component>
<component :is="currentComponent" v-if="!isDataFilling && !showComponent"></component>
<template v-else>
<component :is="currentComponent" :jsname="dataFillingPath"></component>
</template>

View File

@ -12,7 +12,7 @@ import { XpackComponent } from '@/components/plugin'
import { useEmitt } from '@/hooks/web/useEmitt'
const currentComponent = shallowRef()
const Preview = defineAsyncComponent(() => import('@/views/data-visualization/PreviewCanvas.vue'))
const VisualizationEditor = defineAsyncComponent(
() => import('@/views/data-visualization/index.vue')
)
@ -36,6 +36,7 @@ const componentMap = {
DashboardEditor,
VisualizationEditor,
ViewWrapper,
Preview,
Dashboard,
Dataset,
Datasource,
@ -77,8 +78,10 @@ const initIframe = (name: string) => {
showComponent.value = true
})
} else {
currentComponent.value = componentMap[name || 'ViewWrapper']
showComponent.value = true
nextTick(() => {
currentComponent.value = componentMap[name || 'ViewWrapper']
showComponent.value = true
})
}
}

View File

@ -36,7 +36,6 @@ import DrillPath from '@/views/chart/components/views/components/DrillPath.vue'
import { ElIcon, ElInput, ElMessage } from 'element-plus-secondary'
import { useFilter } from '@/hooks/web/useFilter'
import { useCache } from '@/hooks/web/useCache'
import { parseUrl } from '@/utils/ParseUrl'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { cloneDeep } from 'lodash-es'
@ -533,20 +532,13 @@ const jumpClick = param => {
}
const currentUrl = window.location.href
localStorage.setItem('beforeJumpUrl', currentUrl)
if (isIframe.value || isDataEaseBi.value) {
embeddedStore.clearState()
}
if (divSelf) {
console.log('embeddedStore', embeddedStore)
if (divSelf || iframeSelf) {
embeddedStore.setDvId(jumpInfo.targetDvId)
embeddedStore.setJumpInfoParam(encodeURIComponent(Base64.encode(JSON.stringify(param))))
divEmbedded('Preview')
return
}
if (iframeSelf) {
router.push(parseUrl(url))
return
}
windowsJump(url, jumpInfo.jumpType, jumpInfo.windowSize)
}
} else {