forked from github/dataease
Merge pull request #2455 from dataease/pr@dev@perf_filter_tree
perf: 树过滤组件模糊搜索后全选只选中展示的节点
This commit is contained in:
commit
d29eaac857
@ -470,7 +470,17 @@ export default {
|
|||||||
_treeCheckFun(data, node, vm) {
|
_treeCheckFun(data, node, vm) {
|
||||||
this.ids = []
|
this.ids = []
|
||||||
const { propsValue } = this
|
const { propsValue } = this
|
||||||
node.checkedNodes.forEach(item => {
|
const checkKeys = this.$refs.tree.getCheckedKeys()
|
||||||
|
checkKeys.forEach((i, n) => {
|
||||||
|
const node = this.$refs.tree.getNode(i)
|
||||||
|
if (!node.visible && node.checked) {
|
||||||
|
this.$refs.tree.setChecked(i, false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const checkedNodes = this.$refs.tree.getCheckedNodes()
|
||||||
|
|
||||||
|
checkedNodes.forEach(item => {
|
||||||
this.ids.push(item[propsValue])
|
this.ids.push(item[propsValue])
|
||||||
})
|
})
|
||||||
/*
|
/*
|
||||||
@ -479,6 +489,7 @@ export default {
|
|||||||
`node:` 当前点击的node<br>
|
`node:` 当前点击的node<br>
|
||||||
`vm:` 当前组件的vm
|
`vm:` 当前组件的vm
|
||||||
*/
|
*/
|
||||||
|
node.checkedKeys = checkedNodes.map(node => node.id)
|
||||||
this.$emit('check', data, node, vm)
|
this.$emit('check', data, node, vm)
|
||||||
this._emitFun()
|
this._emitFun()
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user