Searching mobile frontend

This commit is contained in:
Peter Papp
2021-04-22 10:10:26 +02:00
parent 3774a05edd
commit 90f91c47ce
5 changed files with 38 additions and 31 deletions
@@ -113,7 +113,7 @@
},
watch: {
query(val) {
this.$searchFiles(val)
this.$searchInvoices(val)
}
},
data() {
@@ -65,13 +65,12 @@
import ToolbarWrapper from '@/components/Desktop/ToolbarWrapper'
import ToolbarButton from '@/components/FilesView/ToolbarButton'
import ToolbarGroup from '@/components/Desktop/ToolbarGroup'
import OptionGroup from '@/components/FilesView/OptionGroup'
import PopoverItem from '@/components/Desktop/PopoverItem'
import SearchBar from '@/components/FilesView/SearchBar'
import Option from '@/components/FilesView/Option'
import {mapGetters} from 'vuex'
import {events} from '@/bus'
import OptionGroup from '@/components/FilesView/OptionGroup'
import Option from '@/components/FilesView/Option'
import {debounce} from "lodash";
export default {
name: 'InvoiceDesktopToolbar',
@@ -111,29 +110,9 @@
}
},
watch: {
query: debounce(function (value) {
if (value !== '' && typeof value !== 'undefined') {
if (['regular-invoice', 'advance-invoice'].includes(this.$store.getters.currentFolder.location)) {
this.$store.dispatch('getSearchResultForInvoices', value)
} else {
this.$store.dispatch('getSearchResultForClients', value)
}
} else if (typeof value !== 'undefined') {
let locations = {
'regular-invoice': 'getRegularInvoices',
'advance-invoice': 'getAdvanceInvoices',
'clients': 'getClients',
}
this.$store.dispatch(locations[this.$store.getters.currentFolder.location])
this.$store.commit('CHANGE_SEARCHING_STATE', false)
}
}, 300)
query(val) {
this.$searchInvoices(val)
}
},
methods: {
showSortingMenu() {