implement originator filter
This commit is contained in:
parent
9bbb1f3e03
commit
0ce9cbaeee
2 changed files with 23 additions and 2 deletions
|
@ -100,5 +100,19 @@ export default {
|
|||
>✖
|
||||
</button>
|
||||
</fieldset>
|
||||
<fieldset class="flex flex-row mb-4">
|
||||
<legend>Einreicher</legend>
|
||||
<select
|
||||
class="w-40 p-2 bg-background-100 rounded-lg"
|
||||
v-model="paperFilter.originator">
|
||||
<option v-for="(originator, i) of paperOriginators" :key="i">{{ originator }}</option>
|
||||
</select>
|
||||
<button
|
||||
class="pl-2"
|
||||
@click.prevent="paperFilter.originator = ''"
|
||||
title="zurücksetzen"
|
||||
>✖
|
||||
</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</template>
|
|
@ -42,6 +42,11 @@ export default {
|
|||
return paper.reference.includes(this.paperFilter?.type.key) && paper.paper_type.includes(this.paperFilter?.type.value)
|
||||
})
|
||||
}
|
||||
if (this.paperFilter?.originator !== '') {
|
||||
filteredPapers = filteredPapers.filter((paper) => {
|
||||
return paper.originator.includes(this.paperFilter?.originator)
|
||||
})
|
||||
}
|
||||
return filteredPapers
|
||||
}
|
||||
},
|
||||
|
@ -55,8 +60,10 @@ export default {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
{{ paperFilter }}
|
||||
<ul v-if="filteredData.length">
|
||||
<ul
|
||||
v-if="filteredData.length"
|
||||
class="w-full"
|
||||
>
|
||||
<li v-for="(paper, i) in filteredData" :key="i">
|
||||
<article
|
||||
class="my-4 p-2 border border-solid border-amber-300 rounded-md"
|
||||
|
|
Loading…
Reference in a new issue