forked from github/dataease
Merge pull request #13083 from dataease/pr@dev-v2@refactor_outer-params
refactor(仪表板、数据大屏): 从系统内新Tab页预览可以指定忽略外部参数
This commit is contained in:
commit
1ec5ffb6ac
@ -138,7 +138,7 @@ const previewOuter = () => {
|
||||
return
|
||||
}
|
||||
canvasSave(() => {
|
||||
const url = '#/preview?dvId=' + dvInfo.value.id
|
||||
const url = '#/preview?ignoreParams=true&dvId=' + dvInfo.value.id
|
||||
const newWindow = window.open(url, '_blank')
|
||||
initOpenHandler(newWindow)
|
||||
})
|
||||
|
@ -44,7 +44,7 @@ const props = defineProps({
|
||||
ticketArgs: propTypes.string.def(null)
|
||||
})
|
||||
|
||||
const loadCanvasDataAsync = async (dvId, dvType) => {
|
||||
const loadCanvasDataAsync = async (dvId, dvType, ignoreParams = false) => {
|
||||
const jumpInfoParam = embeddedStore.jumpInfoParam || router.currentRoute.value.query.jumpInfoParam
|
||||
let jumpParam
|
||||
// 获取外部跳转参数
|
||||
@ -124,9 +124,11 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
|
||||
if (jumpParam) {
|
||||
dvMainStore.addViewTrackFilter(jumpParam)
|
||||
}
|
||||
if (!ignoreParams) {
|
||||
state.initState = false
|
||||
dvMainStore.addOuterParamsFilter(attachParam)
|
||||
state.initState = true
|
||||
}
|
||||
if (props.publicLinkStatus) {
|
||||
// 设置浏览器title为当前仪表板名称
|
||||
document.title = dvInfo.name
|
||||
@ -161,12 +163,14 @@ onMounted(async () => {
|
||||
})
|
||||
await new Promise(r => (p = r))
|
||||
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
|
||||
// 检查外部参数
|
||||
const ignoreParams = router.currentRoute.value.query.ignoreParams === 'true'
|
||||
const { dvType, callBackFlag, taskId, showWatermark } = router.currentRoute.value.query
|
||||
if (!!taskId) {
|
||||
dvMainStore.setCanvasAttachInfo({ taskId, showWatermark })
|
||||
}
|
||||
if (dvId) {
|
||||
loadCanvasDataAsync(dvId, dvType)
|
||||
await loadCanvasDataAsync(dvId, dvType, ignoreParams)
|
||||
return
|
||||
}
|
||||
dvMainStore.setEmbeddedCallBack(callBackFlag || 'no')
|
||||
|
@ -35,7 +35,7 @@ const preview = () => {
|
||||
baseUrl = baseUrl.replace('oidcbi/', '')
|
||||
baseUrl = baseUrl.replace('casbi/', '')
|
||||
}
|
||||
const url = baseUrl + '#/preview?dvId=' + dvInfo.value.id
|
||||
const url = baseUrl + '#/preview?&ignoreParams=true&dvId=' + dvInfo.value.id
|
||||
const newWindow = window.open(url, '_blank')
|
||||
initOpenHandler(newWindow)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user