|
@@ -11,7 +11,7 @@
|
|
|
</CusFormColumn>
|
|
|
</div>
|
|
|
<div class="tree-content">
|
|
|
- <template v-for="p in dictTree">
|
|
|
+ <template v-for="p in (dictTreeFilterCpt ?? dictTree)">
|
|
|
<div class="tree-parent __hover" :class="{active: p.expend}" @click="p.expend = !p.expend">{{p.name}}</div>
|
|
|
<template v-if="p.expend">
|
|
|
<template v-for="s in p.children?.filter(v => v.name.includes(treeFilter))">
|
|
@@ -268,6 +268,19 @@ export default defineComponent({
|
|
|
})
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
+ const dictTreeFilterCpt = computed(() => {
|
|
|
+ if (state.treeFilter) {
|
|
|
+ const arr = []
|
|
|
+ state.dictTree.forEach(p => {
|
|
|
+ if (p.children.some(s => s.name.includes(state.treeFilter))) {
|
|
|
+ arr.push(Object.assign(p, {expend: true}))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return arr
|
|
|
+ } else {
|
|
|
+ return null
|
|
|
+ }
|
|
|
+ })
|
|
|
onMounted(() => {
|
|
|
state.back_queryForm = JSON.parse(JSON.stringify(state.queryForm))
|
|
|
initDictionary()
|
|
@@ -285,7 +298,8 @@ export default defineComponent({
|
|
|
onView,
|
|
|
handleTreeClick,
|
|
|
onDel,
|
|
|
- refreshSearch
|
|
|
+ refreshSearch,
|
|
|
+ dictTreeFilterCpt
|
|
|
}
|
|
|
},
|
|
|
})
|