mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
do not reload transaction list when filter is not changed actually
This commit is contained in:
@@ -241,6 +241,7 @@ export default {
|
||||
const router = self.f7router;
|
||||
|
||||
const filteredAccountIds = {};
|
||||
let isAllSelected = true;
|
||||
let finalAccountIds = '';
|
||||
|
||||
for (let accountId in self.filterAccountIds) {
|
||||
@@ -252,6 +253,7 @@ export default {
|
||||
|
||||
if (!isAccountOrSubAccountsAllChecked(account, self.filterAccountIds)) {
|
||||
filteredAccountIds[accountId] = true;
|
||||
isAllSelected = false;
|
||||
} else {
|
||||
if (finalAccountIds.length > 0) {
|
||||
finalAccountIds += ',';
|
||||
@@ -268,10 +270,13 @@ export default {
|
||||
filterAccountIds: filteredAccountIds
|
||||
});
|
||||
} else if (this.type === 'transactionListCurrent') {
|
||||
self.transactionsStore.updateTransactionListFilter({
|
||||
accountIds: finalAccountIds
|
||||
const changed = self.transactionsStore.updateTransactionListFilter({
|
||||
accountIds: isAllSelected ? '' : finalAccountIds
|
||||
});
|
||||
self.transactionsStore.updateTransactionListInvalidState(true);
|
||||
|
||||
if (changed) {
|
||||
self.transactionsStore.updateTransactionListInvalidState(true);
|
||||
}
|
||||
}
|
||||
|
||||
router.back();
|
||||
|
||||
@@ -256,6 +256,7 @@ export default {
|
||||
const router = self.f7router;
|
||||
|
||||
const filteredCategoryIds = {};
|
||||
let isAllSelected = true;
|
||||
let finalCategoryIds = '';
|
||||
|
||||
for (let categoryId in self.filterCategoryIds) {
|
||||
@@ -267,6 +268,7 @@ export default {
|
||||
|
||||
if (!isCategoryOrSubCategoriesAllChecked(category, self.filterCategoryIds)) {
|
||||
filteredCategoryIds[categoryId] = true;
|
||||
isAllSelected = false;
|
||||
} else {
|
||||
if (finalCategoryIds.length > 0) {
|
||||
finalCategoryIds += ',';
|
||||
@@ -283,10 +285,13 @@ export default {
|
||||
filterCategoryIds: filteredCategoryIds
|
||||
});
|
||||
} else if (this.type === 'transactionListCurrent') {
|
||||
self.transactionsStore.updateTransactionListFilter({
|
||||
categoryIds: finalCategoryIds
|
||||
const changed = self.transactionsStore.updateTransactionListFilter({
|
||||
categoryIds: isAllSelected ? '' : finalCategoryIds
|
||||
});
|
||||
self.transactionsStore.updateTransactionListInvalidState(true);
|
||||
|
||||
if (changed) {
|
||||
self.transactionsStore.updateTransactionListInvalidState(true);
|
||||
}
|
||||
}
|
||||
|
||||
router.back();
|
||||
|
||||
Reference in New Issue
Block a user