refactor(数据大屏): 优化数据大屏Tab内组件的图层调整逻辑

This commit is contained in:
wangjiahao 2024-08-27 13:15:51 +08:00
parent 1245c4cf4a
commit 991d0d3d0c

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
}
}