forked from github/dataease
fix: 修复仪表板批量复制可能出现的重合问题
This commit is contained in:
parent
d470e2b1c9
commit
f75c57077e
@ -75,13 +75,17 @@ const closeEditCanvasName = () => {
|
||||
}
|
||||
|
||||
const undo = () => {
|
||||
snapshotStore.undo()
|
||||
eventBus.emit('matrix-canvasInit', false)
|
||||
if (snapshotIndex.value > 0) {
|
||||
snapshotStore.undo()
|
||||
eventBus.emit('matrix-canvasInit', false)
|
||||
}
|
||||
}
|
||||
|
||||
const redo = () => {
|
||||
snapshotStore.redo()
|
||||
eventBus.emit('matrix-canvasInit', false)
|
||||
if (snapshotIndex.value !== snapshotStore.snapshotData.length - 1) {
|
||||
snapshotStore.redo()
|
||||
eventBus.emit('matrix-canvasInit', false)
|
||||
}
|
||||
}
|
||||
|
||||
const previewInner = () => {
|
||||
@ -333,6 +337,7 @@ onMounted(() => {
|
||||
<el-icon
|
||||
class="toolbar-hover-icon"
|
||||
:class="{ 'toolbar-icon-disabled': snapshotIndex < 1 }"
|
||||
:disabled="snapshotIndex < 1"
|
||||
@click="undo()"
|
||||
>
|
||||
<Icon name="icon_undo_outlined"></Icon>
|
||||
|
@ -107,9 +107,11 @@ export const copyStore = defineStore('copy', {
|
||||
eventBus.emit('addDashboardItem-' + newComponent.canvasId, newComponent)
|
||||
}
|
||||
})
|
||||
if (dvInfo.value.type === 'dashboard') {
|
||||
if (dvInfo.value.type === 'dashboard' && dataArray.length > 1) {
|
||||
//占位优化 整合定位
|
||||
eventBus.emit('doCanvasInit-canvas-main')
|
||||
setTimeout(() => {
|
||||
eventBus.emit('doCanvasInit-canvas-main')
|
||||
}, 1000)
|
||||
}
|
||||
snapshotStore.recordSnapshotCache()
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user