mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
clear displayed transactions when changing filter
This commit is contained in:
@@ -307,6 +307,11 @@ export const useTransactionsStore = defineStore('transactions', {
|
|||||||
this.transactionsNextTimeId = 0;
|
this.transactionsNextTimeId = 0;
|
||||||
this.transactionListStateInvalid = true;
|
this.transactionListStateInvalid = true;
|
||||||
},
|
},
|
||||||
|
clearTransactions() {
|
||||||
|
this.transactions = [];
|
||||||
|
this.transactionsNextTimeId = 0;
|
||||||
|
this.transactionListStateInvalid = true;
|
||||||
|
},
|
||||||
initTransactionListFilter(filter) {
|
initTransactionListFilter(filter) {
|
||||||
if (filter && isNumber(filter.dateType)) {
|
if (filter && isNumber(filter.dateType)) {
|
||||||
this.transactionsFilter.dateType = filter.dateType;
|
this.transactionsFilter.dateType = filter.dateType;
|
||||||
|
|||||||
@@ -740,7 +740,9 @@ export default {
|
|||||||
minTime: recentDateRange.minTime
|
minTime: recentDateRange.minTime
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
this.currentPageTransactions = [];
|
this.currentPageTransactions = [];
|
||||||
|
this.transactionsStore.clearTransactions();
|
||||||
this.$router.push(this.getFilterLinkUrl());
|
this.$router.push(this.getFilterLinkUrl());
|
||||||
},
|
},
|
||||||
changeCustomDateFilter(minTime, maxTime) {
|
changeCustomDateFilter(minTime, maxTime) {
|
||||||
@@ -756,7 +758,9 @@ export default {
|
|||||||
|
|
||||||
this.showCustomDateRangeDialog = false;
|
this.showCustomDateRangeDialog = false;
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
this.currentPageTransactions = [];
|
this.currentPageTransactions = [];
|
||||||
|
this.transactionsStore.clearTransactions();
|
||||||
this.$router.push(this.getFilterLinkUrl());
|
this.$router.push(this.getFilterLinkUrl());
|
||||||
},
|
},
|
||||||
changeTypeFilter(type) {
|
changeTypeFilter(type) {
|
||||||
@@ -775,6 +779,9 @@ export default {
|
|||||||
categoryId: removeCategoryFilter ? '0' : undefined
|
categoryId: removeCategoryFilter ? '0' : undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
this.currentPageTransactions = [];
|
||||||
|
this.transactionsStore.clearTransactions();
|
||||||
this.$router.push(this.getFilterLinkUrl());
|
this.$router.push(this.getFilterLinkUrl());
|
||||||
},
|
},
|
||||||
changeCategoryFilter(categoryId) {
|
changeCategoryFilter(categoryId) {
|
||||||
@@ -786,6 +793,9 @@ export default {
|
|||||||
categoryId: categoryId
|
categoryId: categoryId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
this.currentPageTransactions = [];
|
||||||
|
this.transactionsStore.clearTransactions();
|
||||||
this.$router.push(this.getFilterLinkUrl());
|
this.$router.push(this.getFilterLinkUrl());
|
||||||
},
|
},
|
||||||
changeAccountFilter(accountId) {
|
changeAccountFilter(accountId) {
|
||||||
@@ -797,6 +807,9 @@ export default {
|
|||||||
accountId: accountId
|
accountId: accountId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
this.currentPageTransactions = [];
|
||||||
|
this.transactionsStore.clearTransactions();
|
||||||
this.$router.push(this.getFilterLinkUrl());
|
this.$router.push(this.getFilterLinkUrl());
|
||||||
},
|
},
|
||||||
changeKeywordFilter(keyword) {
|
changeKeywordFilter(keyword) {
|
||||||
|
|||||||
Reference in New Issue
Block a user