1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-12 22:29:59 +08:00

fix search recient Items and Document tasks (#607)

This commit is contained in:
Elsio Sanchez 2021-02-25 22:21:45 -04:00 committed by GitHub
parent 34a6e3a2af
commit aa79d74f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -41,7 +41,7 @@ export default {
computed: { computed: {
dataResult() { dataResult() {
if (this.search.length) { if (this.search.length) {
return this.filterResult(this.search) return this.filterResult(this.search, this.documents)
} }
return this.documents return this.documents
} }

View File

@ -55,13 +55,9 @@ export default {
} }
// conditions for the registration amount (operador: row.criteria.whereClause) // conditions for the registration amount (operador: row.criteria.whereClause)
}, },
filterResult(search) { filterResult(search, list) {
const searchFilter = this.ignoreAccent(search.toLowerCase()) const searchFilter = this.ignoreAccent(search.toLowerCase())
return this.documents.filter(item => { return list.filter(data => !searchFilter || data.name.toLowerCase().includes(searchFilter.toLowerCase()))
return this.ignoreAccent(item.name)
.toLowerCase()
.includes(searchFilter)
})
}, },
ignoreAccent(s) { ignoreAccent(s) {
if (!s) { if (!s) {

View File

@ -53,7 +53,7 @@ export default {
computed: { computed: {
dataResult() { dataResult() {
if (this.search.length) { if (this.search.length) {
return this.filterResult(this.search) return this.filterResult(this.search, this.recentItems)
} }
return this.recentItems return this.recentItems
}, },

View File

@ -70,7 +70,7 @@ export default {
computed: { computed: {
dataResult() { dataResult() {
if (this.search.length) { if (this.search.length) {
return this.filterResult(this.search) return this.filterResult(this.search, this.favorites)
} }
return this.favorites return this.favorites
} }