mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
fix search recient Items and Document tasks (#607)
This commit is contained in:
parent
34a6e3a2af
commit
aa79d74f3b
@ -41,7 +41,7 @@ export default {
|
||||
computed: {
|
||||
dataResult() {
|
||||
if (this.search.length) {
|
||||
return this.filterResult(this.search)
|
||||
return this.filterResult(this.search, this.documents)
|
||||
}
|
||||
return this.documents
|
||||
}
|
||||
|
@ -55,13 +55,9 @@ export default {
|
||||
}
|
||||
// conditions for the registration amount (operador: row.criteria.whereClause)
|
||||
},
|
||||
filterResult(search) {
|
||||
filterResult(search, list) {
|
||||
const searchFilter = this.ignoreAccent(search.toLowerCase())
|
||||
return this.documents.filter(item => {
|
||||
return this.ignoreAccent(item.name)
|
||||
.toLowerCase()
|
||||
.includes(searchFilter)
|
||||
})
|
||||
return list.filter(data => !searchFilter || data.name.toLowerCase().includes(searchFilter.toLowerCase()))
|
||||
},
|
||||
ignoreAccent(s) {
|
||||
if (!s) {
|
||||
|
@ -53,7 +53,7 @@ export default {
|
||||
computed: {
|
||||
dataResult() {
|
||||
if (this.search.length) {
|
||||
return this.filterResult(this.search)
|
||||
return this.filterResult(this.search, this.recentItems)
|
||||
}
|
||||
return this.recentItems
|
||||
},
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
computed: {
|
||||
dataResult() {
|
||||
if (this.search.length) {
|
||||
return this.filterResult(this.search)
|
||||
return this.filterResult(this.search, this.favorites)
|
||||
}
|
||||
return this.favorites
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user