This commit is contained in:
街角小林 2024-03-07 10:34:15 +08:00
parent 0b049c5294
commit f0b73d635e

View File

@ -96,7 +96,7 @@ MindMap.usePlugin(MiniMap)
.usePlugin(SearchPlugin)
.usePlugin(Painter)
.usePlugin(Formula)
.usePlugin(Cooperate) //
// .usePlugin(Cooperate) //
//
customThemeList.forEach(item => {
@ -346,23 +346,6 @@ export default {
default:
break
}
},
beforeCooperateUpdate: ({ type, data }) => {
if (type === 'createOrUpdate') {
if (data.data.version === undefined) {
data.data.version = 0
}
const newVersion = data.data.version + 1
data.data.version = newVersion
const targetNode = this.mindMap.renderer.findNodeByUid(
data.data.uid
)
if (targetNode) {
targetNode.setData({
version: newVersion
})
}
}
}
// handleNodePasteImg: img => {
// console.log(img)
@ -456,24 +439,6 @@ export default {
this.$bus.$emit(event, ...args)
})
})
this.mindMap.on('data_change_detail', actions => {
actions.forEach(({ action, oldData, data }) => {
console.log(action, oldData, data)
if (action === 'create') {
console.log('调新增接口', data)
} else if (action === 'update') {
const oldChildrenLength = oldData.children.length
const newChildrenLength = data.children.length
if (oldChildrenLength !== newChildrenLength) {
console.log('调移动接口', oldChildrenLength, newChildrenLength)
} else {
console.log('更新调接口')
}
} else if (action === 'delete') {
console.log('调删除节点', data)
}
})
})
this.bindSaveEvent()
this.testDynamicCreateNodes()
//