Refact: Move back filtering in store
This commit is contained in:
@@ -31,29 +31,16 @@ export default {
|
||||
...mapGetters('config', [
|
||||
'postes'
|
||||
]),
|
||||
...mapGetters('datas', [
|
||||
'libelle_filter_rows'
|
||||
]),
|
||||
poste () {
|
||||
return this.postes[this.postename]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filter_rows () {
|
||||
if (this.poste.words) {
|
||||
if (this.poste.invert) {
|
||||
return this.rows.filter(x => {
|
||||
return this.poste.words.every(v => {
|
||||
return x.Libellé.indexOf(v) < 0
|
||||
})
|
||||
})
|
||||
} else {
|
||||
return this.rows.filter(x => {
|
||||
return this.poste.words.some(v => {
|
||||
return x.Libellé.indexOf(v) >= 0
|
||||
})
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return this.rows
|
||||
}
|
||||
return this.libelle_filter_rows(this.poste.words, this.poste.invert)
|
||||
},
|
||||
total () {
|
||||
return Math.round(
|
||||
@@ -78,6 +65,7 @@ export default {
|
||||
}
|
||||
.icon {
|
||||
flex: 40%;
|
||||
align-self: center;
|
||||
}
|
||||
.amount {
|
||||
flex: 50%;
|
||||
|
||||
Reference in New Issue
Block a user