不区分大小写

szh_zidingyibiaoti
张同海 2 years ago
parent a8ebbdae2d
commit fa7a09c696

@ -92,12 +92,43 @@ export default {
}, },
handleSearch(value) { handleSearch(value) {
let Rdata = [] let Rdata = []
let UpperType = false
let LowerType = false
if (value) { if (value) {
let Upper = value.toUpperCase()
let Lower = value.toLowerCase()
this.FieldNameList2.forEach(item => { this.FieldNameList2.forEach(item => {
if (item.name.indexOf(value) > -1) { if (item.name.indexOf(value) > -1) {
Rdata.push(item) Rdata.push(item)
} }
}) })
this.FieldNameList2.forEach(item => {
if (item.name.indexOf(Upper) > -1) {
UpperType = false
Rdata.forEach(e => {
if (e.code == item.code) {
UpperType = true
}
})
if (!UpperType) {
Rdata.push(item)
}
}
})
this.FieldNameList2.forEach(item => {
if (item.name.indexOf(Lower) > -1) {
LowerType = false
Rdata.forEach(e => {
if (e.code == item.code) {
LowerType = true
}
})
if (!LowerType) {
Rdata.push(item)
}
}
})
} else { } else {
Rdata = this.FieldNameList2 Rdata = this.FieldNameList2
} }

Loading…
Cancel
Save