refactor(数据大屏): 修改大屏预览加载逻辑

This commit is contained in:
wangjiahao 2024-06-14 12:42:29 +08:00
parent 9940b3cbf4
commit ec31351791
2 changed files with 10 additions and 6 deletions

View File

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

View File

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