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:
14
pages/vendors/index.vue
vendored
14
pages/vendors/index.vue
vendored
@@ -3,6 +3,7 @@
|
||||
<template #right>
|
||||
<UInput
|
||||
id="searchinput"
|
||||
name="searchinput"
|
||||
v-model="searchString"
|
||||
icon="i-heroicons-funnel"
|
||||
autocomplete="off"
|
||||
@@ -65,6 +66,12 @@ defineShortcuts({
|
||||
},
|
||||
'+': () => {
|
||||
router.push("/vendors/create")
|
||||
},
|
||||
'enter': {
|
||||
usingInput: "searchinput",
|
||||
handler: () => {
|
||||
router.push(`/vendors/show/${selectedEntry.value}`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -93,17 +100,22 @@ const selectedColumns = ref(templateColumns)
|
||||
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
|
||||
|
||||
const searchString = ref('')
|
||||
const selectedEntry = ref(null)
|
||||
|
||||
const filteredRows = computed(() => {
|
||||
if(!searchString.value) {
|
||||
return dataStore.vendors
|
||||
}
|
||||
|
||||
return dataStore.vendors.filter(item => {
|
||||
let results = dataStore.vendors.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