fix(图表): 修复图表添加或移出tab组件会导致联动为失效状态

This commit is contained in:
wangjiahao 2024-06-30 22:41:19 +08:00
parent 4dd70a766b
commit d6b337f41f

View File

@ -119,6 +119,7 @@ import { canvasChangeAdaptor, findComponentIndexById } from '@/utils/canvasUtils
import DeCustomTab from '@/custom-component/de-tabs/DeCustomTab.vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import { useEmitt } from '@/hooks/web/useEmitt'
import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
const dvMainStore = dvMainStoreWithOut()
const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore)
const tabComponentRef = ref(null)
@ -255,6 +256,13 @@ function handleCommand(command) {
}
}
const reloadLinkage = () => {
//
getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => {
dvMainStore.setNowPanelTrackInfo(rsp.data)
})
}
const componentMoveIn = component => {
element.value.propValue.forEach((tabItem, index) => {
if (editableTabsValue.value === tabItem.name) {
@ -279,6 +287,8 @@ const componentMoveIn = component => {
}
}
})
reloadLinkage()
}
const componentMoveOut = component => {
@ -288,6 +298,7 @@ const componentMoveOut = component => {
dvMainStore.setCurComponent({ component: null, index: null })
//
eventBus.emit('moveOutFromTab-canvas-main', component)
reloadLinkage()
}
const moveActive = computed(() => {