Merge pull request #7428 from dataease/pr@dev-v2_dzz

fix: 【嵌入式】-视图预览中无法展示数据大屏中组合的图表
This commit is contained in:
dataeaseShu 2023-12-28 10:39:45 +08:00 committed by GitHub
commit 36a513383f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,10 +29,29 @@ onBeforeMount(() => {
state.dvInfo = dvInfo
state.curPreviewGap = curPreviewGap
viewInfo.value = canvasViewInfoPreview[window.DataEaseBi.chartId]
config.value = ((canvasDataResult as unknown as Array<{ id: string }>) || []).find(
ele => ele.id === window.DataEaseBi.chartId
)
viewInfo.value = canvasViewInfoPreview[window.DataEaseBi.chartId] = (
(canvasDataResult as unknown as Array<{
id: string
component: string
propValue: Array<{ id: string }>
}>) || []
).some(ele => {
if (ele.id === window.DataEaseBi.chartId) {
config.value = ele
return true
}
if (ele.component === 'Group') {
return (ele.propValue || []).some(itx => {
if (itx.id === window.DataEaseBi.chartId) {
config.value = itx
return true
}
return false
})
}
return false
})
}
)
})