mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-23 09:40:39 +00:00
Searching frontend
This commit is contained in:
@@ -64,8 +64,8 @@
|
||||
methods: {
|
||||
goTo(location) {
|
||||
let routes = {
|
||||
'invoices': 'getInvoices',
|
||||
'advance-invoices': 'getAdvanceInvoices',
|
||||
'regular-invoice': 'getRegularInvoices',
|
||||
'advance-invoice': 'getAdvanceInvoices',
|
||||
'clients': 'getClients',
|
||||
}
|
||||
this.$store.dispatch(routes[location])
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<!--Sidebar navigation-->
|
||||
<ContentSidebar>
|
||||
<ContentGroup title="Invoices" class="navigator menu-list-wrapper vertical">
|
||||
<a @click="goTo('invoices')" :class="{'is-active': $isThisLocation(['invoices'])}" class="menu-list-item link">
|
||||
<a @click="goTo('regular-invoice')" :class="{'is-active': $isThisLocation(['regular-invoice'])}" class="menu-list-item link">
|
||||
<div class="icon text-theme">
|
||||
<file-text-icon size="17" />
|
||||
</div>
|
||||
@@ -12,7 +12,7 @@
|
||||
Invoices
|
||||
</div>
|
||||
</a>
|
||||
<a @click="goTo('advance-invoices')" :class="{'is-active': $isThisLocation(['advance-invoices'])}" class="menu-list-item link">
|
||||
<a @click="goTo('advance-invoice')" :class="{'is-active': $isThisLocation(['advance-invoice'])}" class="menu-list-item link">
|
||||
<div class="icon text-theme">
|
||||
<clock-icon size="17" />
|
||||
</div>
|
||||
@@ -85,8 +85,8 @@
|
||||
methods: {
|
||||
goTo(location) {
|
||||
let routes = {
|
||||
'invoices': 'getInvoices',
|
||||
'advance-invoices': 'getAdvanceInvoices',
|
||||
'regular-invoice': 'getRegularInvoices',
|
||||
'advance-invoice': 'getAdvanceInvoices',
|
||||
'clients': 'getClients',
|
||||
}
|
||||
this.$store.dispatch(routes[location])
|
||||
@@ -98,7 +98,7 @@
|
||||
events.$on('fileItem:deselect', () => this.isScaledDown = false)
|
||||
events.$on('mobile-menu:hide', () => this.isScaledDown = false)
|
||||
|
||||
this.$store.dispatch('getInvoices')
|
||||
this.$store.dispatch('getRegularInvoices')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
this.$store.commit('STORE_CURRENT_FOLDER', {
|
||||
name: 'Invoices',
|
||||
id: undefined,
|
||||
location: 'invoices',
|
||||
location: 'regular-invoice',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<MenuMobile name="invoice-create">
|
||||
<MenuMobileGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="showLocation('invoices')" title="Create Invoice" icon="file-plus" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('advance-invoices')" title="Create Advance Invoice" icon="clock" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('regular-invoice')" title="Create Invoice" icon="file-plus" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('advance-invoice')" title="Create Advance Invoice" icon="clock" is-hover-disabled="true" />
|
||||
</OptionGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="showLocation('clients')" title="Create Client" icon="user-plus" is-hover-disabled="true" />
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
import {events} from '@/bus'
|
||||
import OptionGroup from '@/components/FilesView/OptionGroup'
|
||||
import Option from '@/components/FilesView/Option'
|
||||
import {debounce} from "lodash";
|
||||
|
||||
export default {
|
||||
name: 'InvoiceDesktopToolbar',
|
||||
@@ -98,8 +99,8 @@
|
||||
},
|
||||
canActiveInView() {
|
||||
let locations = [
|
||||
'invoices',
|
||||
'advance-invoices',
|
||||
'regular-invoice',
|
||||
'advance-invoice',
|
||||
]
|
||||
return !this.$isThisLocation(locations) || this.clipboard.length === 0
|
||||
},
|
||||
@@ -110,9 +111,29 @@
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
query(val) {
|
||||
this.$searchFiles(val)
|
||||
}
|
||||
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)
|
||||
},
|
||||
methods: {
|
||||
showSortingMenu() {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<MenuMobile name="invoice-filter">
|
||||
<MenuMobileGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="showLocation('invoices')" :is-active="$isThisLocation('invoices')" title="Invoices" icon="file-text" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('advance-invoices')" :is-active="$isThisLocation('advance-invoices')" title="Advance Invoices" icon="clock" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('regular-invoice')" :is-active="$isThisLocation('regular-invoice')" title="Invoices" icon="file-text" is-hover-disabled="true" />
|
||||
<Option @click.native="showLocation('advance-invoice')" :is-active="$isThisLocation('advance-invoice')" title="Advance Invoices" icon="clock" is-hover-disabled="true" />
|
||||
</OptionGroup>
|
||||
<OptionGroup>
|
||||
<Option @click.native="showLocation('clients')" :is-active="$isThisLocation('clients')" title="Clients" icon="users" is-hover-disabled="true" />
|
||||
@@ -35,8 +35,8 @@ export default {
|
||||
methods: {
|
||||
showLocation(location) {
|
||||
let routes = {
|
||||
'invoices': 'getInvoices',
|
||||
'advance-invoices': 'getAdvanceInvoices',
|
||||
'regular-invoice': 'getRegularInvoices',
|
||||
'advance-invoice': 'getAdvanceInvoices',
|
||||
'clients': 'getClients',
|
||||
}
|
||||
this.$store.dispatch(routes[location])
|
||||
|
||||
Reference in New Issue
Block a user