mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
update
This commit is contained in:
parent
0b049c5294
commit
f0b73d635e
@ -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()
|
||||
// 如果应用被接管,那么抛出事件传递思维导图实例
|
||||
|
||||
Loading…
Reference in New Issue
Block a user