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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user