Merge pull request #10631 from dataease/pr@dev-v2@fix_tab-linkage

fix(图表): 修复图表添加或移出tab组件会导致联动为失效状态
This commit is contained in:
王嘉豪 2024-06-30 22:41:58 +08:00 committed by GitHub
commit 80239ac600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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(() => {