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

Pr@dev v2@fix tab
This commit is contained in:
王嘉豪 2024-08-27 14:22:43 +08:00 committed by GitHub
commit 21f3b2f58f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View File

@ -491,7 +491,6 @@ const getSelectArea = () => {
}
const handleContextMenu = e => {
console.log('====handleContextMenu===')
//
if (dashboardActive.value || editMode.value === 'preview') {
return
@ -1363,11 +1362,7 @@ const linkageSetOpen = item => {
}
const contextMenuShow = computed(() => {
if (curComponent.value) {
return curComponent.value.canvasId === canvasId.value
} else {
return isMainCanvas(canvasId.value)
}
return isMainCanvas(canvasId.value)
})
const markLineShow = computed(() => isMainCanvas(canvasId.value))

View File

@ -7,6 +7,7 @@ export const getCurInfo = () => {
if (curComponent.value) {
const curComponentId = curComponent.value.id
let curIndex = 0
let curTabIndex = 0
let curComponentData = componentData.value
componentData.value.forEach((component, index) => {
if (curComponentId === component.id) {
@ -20,9 +21,21 @@ export const getCurInfo = () => {
}
})
}
if (component.component === 'DeTabs') {
component.propValue.forEach((tabItem, tabIndex) => {
curTabIndex = tabIndex
tabItem.componentData.forEach((tabComponent, subIndex) => {
if (curComponentId === tabComponent.id) {
curIndex = subIndex
curComponentData = tabItem.componentData
}
})
})
}
})
return {
index: curIndex,
tabIndex: curTabIndex,
componentData: curComponentData
}
}