Merge pull request #10279 from dataease/pr@dev-v2@feat_datav-copy3

refactor(数据大屏): 修改大屏预览加载逻辑
This commit is contained in:
王嘉豪 2024-06-14 12:42:56 +08:00 committed by GitHub
commit 1f89574c42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -95,7 +95,7 @@ watch(
const init = () => { const init = () => {
dvMainStore.initCurMultiplexingComponents() dvMainStore.initCurMultiplexingComponents()
curMultiplexTargetComponentsInfo.value = [] curMultiplexTargetComponentsInfo.value = []
componentData.value.forEach(item => { componentData.value?.forEach(item => {
curMultiplexTargetComponentsInfo.value.push({ curMultiplexTargetComponentsInfo.value.push({
id: item.id, id: item.id,
label: item.label, label: item.label,

View File

@ -80,11 +80,13 @@ const loadCanvasData = (dvId, weight?) => {
state.canvasViewInfoPreview = canvasViewInfoPreview state.canvasViewInfoPreview = canvasViewInfoPreview
state.dvInfo = dvInfo state.dvInfo = dvInfo
state.curPreviewGap = curPreviewGap state.curPreviewGap = curPreviewGap
dvMainStore.updateCurDvInfo(dvInfo)
dataInitState.value = true dataInitState.value = true
nextTick(() => { if (props.showPosition === 'preview') {
dvPreview.value?.restore() dvMainStore.updateCurDvInfo(dvInfo)
}) nextTick(() => {
dvPreview.value?.restore()
})
}
} }
) )
} }
@ -151,7 +153,9 @@ defineExpose({
}) })
onBeforeMount(() => { onBeforeMount(() => {
dvMainStore.canvasDataInit() if (props.showPosition === 'preview') {
dvMainStore.canvasDataInit()
}
}) })
</script> </script>