fix(嵌入式): 跳转-仪表板跳转到另一个仪表板,跳转逻辑错误

This commit is contained in:
dataeaseShu 2024-06-06 10:47:50 +08:00
parent 5df01b4cf5
commit 67f071ad79
2 changed files with 8 additions and 12 deletions

View File

@ -411,18 +411,17 @@ const jumpClick = param => {
const url = `${embeddedBaseUrl}#/preview?dvId=${ const url = `${embeddedBaseUrl}#/preview?dvId=${
jumpInfo.targetDvId jumpInfo.targetDvId
}&jumpInfoParam=${encodeURIComponent(Base64.encode(JSON.stringify(param)))}` }&jumpInfoParam=${encodeURIComponent(Base64.encode(JSON.stringify(param)))}`
if (divSelf) {
if (isIframe.value || isDataEaseBi.value) {
embeddedStore.clearState() embeddedStore.clearState()
}
if (divSelf) {
embeddedStore.setDvId(jumpInfo.targetDvId) embeddedStore.setDvId(jumpInfo.targetDvId)
embeddedStore.setJumpInfoParam(encodeURIComponent(Base64.encode(JSON.stringify(param)))) embeddedStore.setJumpInfoParam(encodeURIComponent(Base64.encode(JSON.stringify(param))))
divEmbedded('Preview') divEmbedded('Preview')
return return
} }
if (isIframe.value) {
embeddedStore.clearState()
}
if (iframeSelf) { if (iframeSelf) {
router.push(parseUrl(url)) router.push(parseUrl(url))
return return
@ -436,16 +435,16 @@ const jumpClick = param => {
const colList = [...param.dimensionList, ...param.quotaList] const colList = [...param.dimensionList, ...param.quotaList]
let url = setIdValueTrans('id', 'value', jumpInfo.content, colList) let url = setIdValueTrans('id', 'value', jumpInfo.content, colList)
url = checkAddHttp(url) url = checkAddHttp(url)
if (divSelf) {
if (isIframe.value || isDataEaseBi.value) {
embeddedStore.clearState() embeddedStore.clearState()
}
if (divSelf) {
embeddedStore.setOuterUrl(url) embeddedStore.setOuterUrl(url)
divEmbedded('Iframe') divEmbedded('Iframe')
return return
} }
if (isIframe.value) {
embeddedStore.clearState()
}
windowsJump(url, jumpInfo.jumpType) windowsJump(url, jumpInfo.jumpType)
} }
} else { } else {

View File

@ -73,8 +73,6 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
ElMessage.error(t('visualization.outer_param_decode_error')) ElMessage.error(t('visualization.outer_param_decode_error'))
} }
} }
console.log('PreviewCanvas', dvId, jumpParam, attachParam)
initCanvasData( initCanvasData(
dvId, dvId,
dvType, dvType,
@ -108,7 +106,6 @@ let p = null
const XpackLoaded = () => p(true) const XpackLoaded = () => p(true)
onMounted(async () => { onMounted(async () => {
await new Promise(r => (p = r)) await new Promise(r => (p = r))
console.log('embeddedStore', embeddedStore, router)
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
const { dvType, callBackFlag } = router.currentRoute.value.query const { dvType, callBackFlag } = router.currentRoute.value.query
if (dvId) { if (dvId) {