fix(数据大屏): 修复大屏预览后重新进入编辑界面导致的Tab时钟不显示等问题

This commit is contained in:
wangjiahao 2024-08-28 11:03:54 +08:00
parent 28d30113f1
commit 8859315dfe

View File

@ -292,31 +292,33 @@ const componentMoveIn = component => {
if (editableTabsValue.value === tabItem.name) {
//index
const curIndex = findComponentIndexById(component.id)
//
if (isDashboard()) {
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
dvMainStore.setCurComponent({ component: null, index: null })
component.canvasId = element.value.id + '--' + tabItem.name
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
if (refInstance) {
const matrixBase = refInstance.getBaseMatrixSize() //
canvasChangeAdaptor(component, matrixBase)
component.x = 1
component.y = 200
component.style.left = 0
component.style.top = 0
if (curIndex > -1) {
//
if (isDashboard()) {
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
dvMainStore.setCurComponent({ component: null, index: null })
component.canvasId = element.value.id + '--' + tabItem.name
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
if (refInstance) {
const matrixBase = refInstance.getBaseMatrixSize() //
canvasChangeAdaptor(component, matrixBase)
component.x = 1
component.y = 200
component.style.left = 0
component.style.top = 0
tabItem.componentData.push(component)
nextTick(() => {
refInstance.addItemBox(component) //
})
}
} else {
//
dvMainStore.deleteComponent(curIndex)
dvMainStore.setCurComponent({ component: null, index: null })
component.canvasId = element.value.id + '--' + tabItem.name
dataVTabComponentAdd(component, element.value.style)
tabItem.componentData.push(component)
nextTick(() => {
refInstance.addItemBox(component) //
})
}
} else {
//
dvMainStore.deleteComponent(curIndex)
dvMainStore.setCurComponent({ component: null, index: null })
component.canvasId = element.value.id + '--' + tabItem.name
dataVTabComponentAdd(component, element.value.style)
tabItem.componentData.push(component)
}
}
})