mirror of https://github.com/veops/cmdb.git
fix(cmdb-ui):service tree search (#487)
This commit is contained in:
parent
506dcbb40e
commit
3454a98cfb
|
@ -1762,12 +1762,29 @@ export default {
|
|||
}
|
||||
if (node.children) {
|
||||
node.children = node.children.filter((child) => {
|
||||
if (predicateCiIds.some((id) => child.key.includes(String(id)))) {
|
||||
if (
|
||||
predicateCiIds.some(
|
||||
(id) =>
|
||||
child.key
|
||||
.split('@^@')
|
||||
.map((item) => Number(item.split('%')[0]))
|
||||
.indexOf(id) > -1
|
||||
)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return filterTree(child, predicate)
|
||||
})
|
||||
if (node.children.length && !predicateCiIds.some((id) => node.key.includes(String(id)))) {
|
||||
if (
|
||||
node.children.length &&
|
||||
!predicateCiIds.some(
|
||||
(id) =>
|
||||
node.key
|
||||
.split('@^@')
|
||||
.map((item) => Number(item.split('%')[0]))
|
||||
.indexOf(id) > -1
|
||||
)
|
||||
) {
|
||||
_expandedKeys.push(node.key)
|
||||
}
|
||||
return node.children.length > 0
|
||||
|
|
Loading…
Reference in New Issue