forked from github/dataease
fix(数据大屏): 修复大屏预览后重新进入编辑界面导致的Tab时钟不显示等问题
This commit is contained in:
parent
28d30113f1
commit
8859315dfe
@ -292,31 +292,33 @@ const componentMoveIn = component => {
|
|||||||
if (editableTabsValue.value === tabItem.name) {
|
if (editableTabsValue.value === tabItem.name) {
|
||||||
//获取主画布当前组件的index
|
//获取主画布当前组件的index
|
||||||
const curIndex = findComponentIndexById(component.id)
|
const curIndex = findComponentIndexById(component.id)
|
||||||
// 从主画布中移除
|
if (curIndex > -1) {
|
||||||
if (isDashboard()) {
|
// 从主画布中移除
|
||||||
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
|
if (isDashboard()) {
|
||||||
dvMainStore.setCurComponent({ component: null, index: null })
|
eventBus.emit('removeMatrixItem-canvas-main', curIndex)
|
||||||
component.canvasId = element.value.id + '--' + tabItem.name
|
dvMainStore.setCurComponent({ component: null, index: null })
|
||||||
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
|
component.canvasId = element.value.id + '--' + tabItem.name
|
||||||
if (refInstance) {
|
const refInstance = currentInstance.refs['tabCanvas_' + index][0]
|
||||||
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
|
if (refInstance) {
|
||||||
canvasChangeAdaptor(component, matrixBase)
|
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
|
||||||
component.x = 1
|
canvasChangeAdaptor(component, matrixBase)
|
||||||
component.y = 200
|
component.x = 1
|
||||||
component.style.left = 0
|
component.y = 200
|
||||||
component.style.top = 0
|
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)
|
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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user