diff --git a/frontend/src/components/elTreeSelect/index.vue b/frontend/src/components/elTreeSelect/index.vue index 20f09c9dd9..fe57dc5bc9 100644 --- a/frontend/src/components/elTreeSelect/index.vue +++ b/frontend/src/components/elTreeSelect/index.vue @@ -410,7 +410,7 @@ export default { }, _filterFun(value, data, node) { if (!value) return true - return data[this.propsLabel].indexOf(value) !== -1 + return data[this.propsLabel?.toLocaleUpperCase()].indexOf(value.toLocaleUpperCase()) !== -1 }, _treeNodeClickFun(data, node, vm) { const { multiple } = this.selectParams diff --git a/frontend/src/components/elVisualSelect/index.vue b/frontend/src/components/elVisualSelect/index.vue index e5320bad55..326c5af39d 100644 --- a/frontend/src/components/elVisualSelect/index.vue +++ b/frontend/src/components/elVisualSelect/index.vue @@ -121,7 +121,7 @@ export default { }, keyWord(val, old) { if (val === old) return - const results = val ? this.list.filter(item => item.text.includes(val)) : null + const results = val ? this.vagueFilter(val, this.list) : null this.resetList(results) this.reCacularHeight() this.$nextTick(() => { @@ -136,6 +136,11 @@ export default { }) }, methods: { + vagueFilter(val, nodes) { + if (!val || !val.trim()) return nodes + const results = nodes.filter(item => item.text?.toLocaleUpperCase().includes(val.toLocaleUpperCase())) + return results + }, resetSelectAll() { this.selectAll = false }, @@ -148,7 +153,7 @@ export default { selectAllChange(val) { let vals = val ? [...this.list.map(ele => ele.id)] : [] if (this.keyWord.trim() && val) { - vals = this.list.filter(item => item.text.includes(this.keyWord.trim())).map(ele => ele.id) + vals = this.vagueFilter(this.keyWord.trim(), this.list).map(ele => ele.id) } this.visualChange(vals) this.selectValue = vals @@ -233,14 +238,14 @@ export default { isAllSelect() { let vals = this.list.length if (this.keyWord.trim()) { - vals = this.list.filter(item => item.text.includes(this.keyWord.trim())).map(ele => ele.id).filter(ele => this.selectValue.includes(ele)).length + vals = this.vagueFilter(this.keyWord.trim(), this.list).map(ele => ele.id).filter(ele => this.selectValue.includes(ele)).length } return vals }, halfSelect() { let vals = this.list.length if (this.keyWord.trim()) { - vals = this.list.filter(item => item.text.includes(this.keyWord.trim())).map(ele => ele.id).length + vals = this.vagueFilter(this.keyWord.trim(), this.list).map(ele => ele.id).length } return vals }, diff --git a/frontend/src/components/widget/deWidget/DeSelectGrid.vue b/frontend/src/components/widget/deWidget/DeSelectGrid.vue index d4887feb9a..46023bfe7d 100644 --- a/frontend/src/components/widget/deWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/deWidget/DeSelectGrid.vue @@ -31,7 +31,7 @@ v-model="value" @change="handleCheckedChange" > -