Fix:修复某些情况下搜索时数据改变,搜索结果没有更新的问题
This commit is contained in:
parent
c0fea992a9
commit
8b90557f70
@ -112,22 +112,25 @@ class Search {
|
|||||||
}
|
}
|
||||||
const currentNode = this.matchNodeList[this.currentIndex]
|
const currentNode = this.matchNodeList[this.currentIndex]
|
||||||
this.notResetSearchText = true
|
this.notResetSearchText = true
|
||||||
this.mindMap.execCommand(
|
const uid =
|
||||||
'GO_TARGET_NODE',
|
currentNode instanceof Node
|
||||||
currentNode instanceof Node ? currentNode : currentNode.data.uid,
|
? currentNode.getData('uid')
|
||||||
node => {
|
: currentNode.data.uid
|
||||||
if (!(currentNode instanceof Node)) {
|
const targetNode = this.mindMap.renderer.findNodeByUid(uid)
|
||||||
this.matchNodeList[this.currentIndex] = node
|
this.mindMap.execCommand('GO_TARGET_NODE', uid, node => {
|
||||||
} else {
|
if (!(currentNode instanceof Node)) {
|
||||||
this.notResetSearchText = false
|
this.matchNodeList[this.currentIndex] = node
|
||||||
}
|
|
||||||
callback()
|
|
||||||
// 只读模式下节点无法激活,所以通过高亮的方式
|
|
||||||
if (this.mindMap.opt.readonly) {
|
|
||||||
node.highlight()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
callback()
|
||||||
|
// 只读模式下节点无法激活,所以通过高亮的方式
|
||||||
|
if (this.mindMap.opt.readonly) {
|
||||||
|
node.highlight()
|
||||||
|
}
|
||||||
|
// 如果当前节点实例已经存在,则不会触发data_change事件,那么需要手动把标志复位
|
||||||
|
if (targetNode) {
|
||||||
|
this.notResetSearchText = false
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 替换当前节点
|
// 替换当前节点
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user