mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
support filtering account or category in statistics page
This commit is contained in:
@@ -231,6 +231,10 @@
|
||||
</date-range-selection-sheet>
|
||||
|
||||
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
||||
<f7-actions-group>
|
||||
<f7-actions-button @click="filterAccounts">{{ $t('Filter Accounts') }}</f7-actions-button>
|
||||
<f7-actions-button @click="filterCategories">{{ $t('Filter Transaction Categories') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
<f7-actions-group>
|
||||
<f7-actions-button @click="settings">{{ $t('Settings') }}</f7-actions-button>
|
||||
</f7-actions-group>
|
||||
@@ -535,6 +539,12 @@ export default {
|
||||
clickPieChartItem(item) {
|
||||
this.$f7router.navigate(this.$options.filters.itemLinkUrl(item, this.query, this.$constants.statistics.allChartDataTypes));
|
||||
},
|
||||
filterAccounts() {
|
||||
this.$f7router.navigate('/statistic/filter/account');
|
||||
},
|
||||
filterCategories() {
|
||||
this.$f7router.navigate('/statistic/filter/category');
|
||||
},
|
||||
settings() {
|
||||
this.$f7router.navigate('/statistic/settings');
|
||||
},
|
||||
@@ -565,6 +575,14 @@ export default {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.query.filterAccountIds && this.query.filterAccountIds[item.account.id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.query.filterCategoryIds && this.query.filterCategoryIds[item.category.id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.query.chartDataType === this.$constants.statistics.allChartDataTypes.ExpenseByAccount.type ||
|
||||
this.query.chartDataType === this.$constants.statistics.allChartDataTypes.IncomeByAccount.type) {
|
||||
if (this.$utilities.isNumber(item.amountInDefaultCurrency)) {
|
||||
@@ -656,6 +674,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.query.filterAccountIds && this.query.filterAccountIds[account.id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let primaryAccount = this.$store.state.allAccountsMap[account.parentId];
|
||||
|
||||
if (!primaryAccount) {
|
||||
|
||||
Reference in New Issue
Block a user