Added Bankimport, BankAccounts, BankStatements Some Visual Changes Added Contacts Changes in VendorInvoices Added layouts with default an one for Login PAge Added Input Group Component
74 lines
1.2 KiB
Vue
74 lines
1.2 KiB
Vue
<template>
|
|
<div id="main">
|
|
|
|
<div class="flex items-center gap-1">
|
|
<UButton @click="router.push(`/vehicles/create/`)">+ Fahrzeug</UButton>
|
|
|
|
<UInput
|
|
v-model="searchString"
|
|
placeholder="Suche..."
|
|
/>
|
|
</div>
|
|
|
|
|
|
|
|
<UTable
|
|
:rows="filteredRows"
|
|
:columns="itemColumns"
|
|
@select="selectItem"
|
|
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
|
|
>
|
|
|
|
</UTable>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
definePageMeta({
|
|
middleware: "auth"
|
|
})
|
|
|
|
|
|
const router = useRouter()
|
|
const {vehicles } = storeToRefs(useDataStore())
|
|
const mode = ref("show")
|
|
|
|
const itemColumns = [
|
|
{
|
|
key: 'licensePlate',
|
|
label: "Kennzeichen:",
|
|
sortable: true
|
|
},
|
|
{
|
|
key: "type",
|
|
label: "Typ:",
|
|
sortable: true
|
|
}
|
|
]
|
|
|
|
|
|
const selectItem = (item) => {
|
|
router.push(`/vehicles/show/${item.id} `)
|
|
}
|
|
|
|
|
|
const searchString = ref('')
|
|
|
|
const filteredRows = computed(() => {
|
|
if(!searchString.value) {
|
|
return vehicles.value
|
|
}
|
|
|
|
return vehicles.value.filter(item => {
|
|
return Object.values(item).some((value) => {
|
|
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
|
|
})
|
|
})
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style> |