mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-26 02:20:39 +00:00
bug fixes
This commit is contained in:
Vendored
+21
-8
@@ -2,10 +2,23 @@ import i18n from '@/i18n/index'
|
||||
import {debounce} from 'lodash'
|
||||
import {events} from './bus'
|
||||
import store from "./store";
|
||||
import router from "./router";
|
||||
|
||||
const OasisHelpers = {
|
||||
install(Vue) {
|
||||
|
||||
Vue.prototype.$goToInvoice = function () {
|
||||
router.push({name: 'InvoicesList'})
|
||||
|
||||
store.commit('STORE_CURRENT_FOLDER', {
|
||||
name: 'Invoices',
|
||||
id: undefined,
|
||||
location: 'regular-invoice',
|
||||
})
|
||||
|
||||
store.dispatch('getRegularInvoices')
|
||||
}
|
||||
|
||||
Vue.prototype.$getInvoiceDataByLocation = function () {
|
||||
|
||||
let currentLocation = store.getters.currentFolder && store.getters.currentFolder.location
|
||||
@@ -18,7 +31,7 @@ const OasisHelpers = {
|
||||
'clients': 'getClients',
|
||||
}
|
||||
|
||||
this.$store.dispatch(actions[currentLocation])
|
||||
store.dispatch(actions[currentLocation])
|
||||
}
|
||||
|
||||
Vue.prototype.$shareInvoice = function (entry) {
|
||||
@@ -29,7 +42,7 @@ const OasisHelpers = {
|
||||
}
|
||||
|
||||
Vue.prototype.$editInvoice = function (entry) {
|
||||
this.$router.push({name: 'EditInvoice', params: {id: entry.id}})
|
||||
router.push({name: 'EditInvoice', params: {id: entry.id}})
|
||||
events.$emit('file-preview:hide')
|
||||
}
|
||||
|
||||
@@ -62,7 +75,7 @@ const OasisHelpers = {
|
||||
}
|
||||
|
||||
Vue.prototype.$goToCompany = function (entry) {
|
||||
this.$router.push({name: 'ClientDetail', params: {id: entry.client_id ?? entry.id}})
|
||||
router.push({name: 'ClientDetail', params: {id: entry.client_id ?? entry.id}})
|
||||
|
||||
events.$emit('file-preview:hide')
|
||||
}
|
||||
@@ -71,10 +84,10 @@ const OasisHelpers = {
|
||||
|
||||
if (value !== '' && typeof value !== 'undefined') {
|
||||
|
||||
if (['regular-invoice', 'advance-invoice'].includes(this.$store.getters.currentFolder.location)) {
|
||||
this.$store.dispatch('getSearchResultForInvoices', value)
|
||||
if (['regular-invoice', 'advance-invoice'].includes(store.getters.currentFolder.location)) {
|
||||
store.dispatch('getSearchResultForInvoices', value)
|
||||
} else {
|
||||
this.$store.dispatch('getSearchResultForClients', value)
|
||||
store.dispatch('getSearchResultForClients', value)
|
||||
}
|
||||
} else if (typeof value !== 'undefined') {
|
||||
|
||||
@@ -84,9 +97,9 @@ const OasisHelpers = {
|
||||
'clients': 'getClients',
|
||||
}
|
||||
|
||||
this.$store.dispatch(locations[this.$store.getters.currentFolder.location])
|
||||
store.dispatch(locations[store.getters.currentFolder.location])
|
||||
|
||||
this.$store.commit('CHANGE_SEARCHING_STATE', false)
|
||||
store.commit('CHANGE_SEARCHING_STATE', false)
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user