Added Reset in Inventory

Added Keyboard Controls for Tab Nav and Back to List
Added Select On Enter for First Entry in Search

for Customers and Vendors
This commit is contained in:
2024-05-01 21:55:41 +02:00
parent 86cd55102c
commit 7966173385
6 changed files with 107 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
<template #right>
<UInput
id="searchinput"
name="searchinput"
v-model="searchString"
icon="i-heroicons-funnel"
autocomplete="off"
@@ -54,7 +55,7 @@
<span v-else class="text-rose-500">Gesperrt</span>
</template>
<template #address-data="{row}">
{{row.infoData.street ? `${row.infoData.street}, ` : ''}}{{row.infoData.special ? `${row.infoData.special},` : ''}} {{row.infoData.zip ? row.infoData.zip : ""}}{{row.infoData.city ? `${row.infoData.city}, ` : ''}} {{row.infoData.country}}
{{row.infoData.street ? `${row.infoData.street}, ` : ''}}{{row.infoData.special ? `${row.infoData.special},` : ''}} {{row.infoData.zip ? row.infoData.zip : ""}} {{row.infoData.city ? `${row.infoData.city}, ` : ''}} {{row.infoData.country}}
</template>
</UTable>
</template>
@@ -72,7 +73,16 @@ defineShortcuts({
},
'+': () => {
router.push("/customers/create")
},
'enter': {
usingInput: "searchinput",
handler: () => {
router.push(`/customers/show/${selectedEntry.value}`)
}
}
})
const dataStore = useDataStore()
@@ -115,17 +125,22 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
const searchString = ref('')
const selectedEntry = ref(null)
const filteredRows = computed(() => {
if(!searchString.value) {
return dataStore.customers
}
return dataStore.customers.filter(item => {
let results = dataStore.customers.filter(item => {
return Object.values(item).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
})
selectedEntry.value = results[0].id
return results
})
</script>