fix search recient Items and Document tasks (#607)
parent
34a6e3a2af
commit
aa79d74f3b
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue