diff --git a/src/components/mobile/MonthRangeSelectionSheet.vue b/src/components/mobile/MonthRangeSelectionSheet.vue new file mode 100644 index 00000000..63d7c724 --- /dev/null +++ b/src/components/mobile/MonthRangeSelectionSheet.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/mobile/TrendsBarChart.vue b/src/components/mobile/TrendsBarChart.vue new file mode 100644 index 00000000..d688033f --- /dev/null +++ b/src/components/mobile/TrendsBarChart.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/mobile-main.js b/src/mobile-main.js index 445c78b4..f5427726 100644 --- a/src/mobile-main.js +++ b/src/mobile-main.js @@ -100,11 +100,13 @@ import MapView from '@/components/common/MapView.vue'; import ItemIcon from '@/components/mobile/ItemIcon.vue'; import PieChart from '@/components/mobile/PieChart.vue'; +import TrendsBarChart from '@/components/mobile/TrendsBarChart.vue'; import PinCodeInputSheet from '@/components/mobile/PinCodeInputSheet.vue'; import PasswordInputSheet from '@/components/mobile/PasswordInputSheet.vue'; import PasscodeInputSheet from '@/components/mobile/PasscodeInputSheet.vue'; import DateTimeSelectionSheet from '@/components/mobile/DateTimeSelectionSheet.vue'; import DateRangeSelectionSheet from '@/components/mobile/DateRangeSelectionSheet.vue'; +import MonthRangeSelectionSheet from '@/components/mobile/MonthRangeSelectionSheet.vue'; import ListItemSelectionSheet from '@/components/mobile/ListItemSelectionSheet.vue'; import TwoColumnListItemSelectionSheet from '@/components/mobile/TwoColumnListItemSelectionSheet.vue'; import TreeViewSelectionSheet from '@/components/mobile/TreeViewSelectionSheet.vue'; @@ -181,11 +183,13 @@ app.component('MapView', MapView); app.component('ItemIcon', ItemIcon); app.component('PieChart', PieChart); +app.component('TrendsBarChart', TrendsBarChart); app.component('PinCodeInputSheet', PinCodeInputSheet); app.component('PasswordInputSheet', PasswordInputSheet); app.component('PasscodeInputSheet', PasscodeInputSheet); app.component('DateTimeSelectionSheet', DateTimeSelectionSheet); app.component('DateRangeSelectionSheet', DateRangeSelectionSheet); +app.component('MonthRangeSelectionSheet', MonthRangeSelectionSheet); app.component('ListItemSelectionSheet', ListItemSelectionSheet); app.component('TwoColumnListItemSelectionSheet', TwoColumnListItemSelectionSheet); app.component('TreeViewSelectionSheet', TreeViewSelectionSheet); diff --git a/src/stores/statistics.js b/src/stores/statistics.js index 200ac755..36d30279 100644 --- a/src/stores/statistics.js +++ b/src/stores/statistics.js @@ -819,21 +819,29 @@ export const useStatisticsStore = defineStore('statistics', { querys.push('type=3'); } - if (this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.IncomeByAccount.type + if (itemId && (this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.IncomeByAccount.type || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.ExpenseByAccount.type || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.AccountTotalAssets.type - || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.AccountTotalLiabilities.type) { + || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.AccountTotalLiabilities.type)) { querys.push('accountIds=' + itemId); if (!isObjectEmpty(this.transactionStatisticsFilter.filterCategoryIds)) { querys.push('categoryIds=' + getFinalCategoryIdsByFilteredCategoryIds(transactionCategoriesStore.allTransactionCategoriesMap, this.transactionStatisticsFilter.filterCategoryIds)); } - } else if (this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.IncomeByPrimaryCategory.type + } else if (itemId && (this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.IncomeByPrimaryCategory.type || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.IncomeBySecondaryCategory.type || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.ExpenseByPrimaryCategory.type - || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.ExpenseBySecondaryCategory.type) { + || this.transactionStatisticsFilter.chartDataType === statisticsConstants.allChartDataTypes.ExpenseBySecondaryCategory.type)) { querys.push('categoryIds=' + itemId); + if (!isObjectEmpty(this.transactionStatisticsFilter.filterAccountIds)) { + querys.push('accountIds=' + getFinalAccountIdsByFilteredAccountIds(accountsStore.allAccountsMap, this.transactionStatisticsFilter.filterAccountIds)); + } + } else if (!itemId) { + if (!isObjectEmpty(this.transactionStatisticsFilter.filterCategoryIds)) { + querys.push('categoryIds=' + getFinalCategoryIdsByFilteredCategoryIds(transactionCategoriesStore.allTransactionCategoriesMap, this.transactionStatisticsFilter.filterCategoryIds)); + } + if (!isObjectEmpty(this.transactionStatisticsFilter.filterAccountIds)) { querys.push('accountIds=' + getFinalAccountIdsByFilteredAccountIds(accountsStore.allAccountsMap, this.transactionStatisticsFilter.filterAccountIds)); } diff --git a/src/styles/mobile/global.css b/src/styles/mobile/global.css index 70420a74..ee2c2c65 100644 --- a/src/styles/mobile/global.css +++ b/src/styles/mobile/global.css @@ -609,3 +609,47 @@ i.icon.la, i.icon.las, i.icon.lab { .dp__main .dp__calendar .dp__calendar_item > .dp__cell_inner { width: 100%; } + +/* statistics-list */ +.statistics-list-item-overview-amount { + margin-top: 2px; + font-size: 1.5em; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 6px; +} + +.statistics-list-item-text { + overflow: hidden; + text-overflow: ellipsis; +} + +.statistics-list-item .item-content { + margin-top: 8px; + margin-bottom: 12px; +} + +.statistics-icon { + margin-bottom: -2px; +} + +.statistics-percent { + font-size: 0.7em; + opacity: 0.6; + margin-left: 6px; +} + +.statistics-item-end { + position: absolute; + bottom: 0; + width: 100%; +} + +.statistics-percent-line { + margin-right: calc(var(--f7-list-chevron-icon-area) + var(--f7-list-item-padding-horizontal) + var(--f7-safe-area-right)); +} + +.statistics-percent-line .progressbar { + height: 4px; + --f7-progressbar-bg-color: #f8f8f8; +} diff --git a/src/views/mobile/statistics/SettingsPage.vue b/src/views/mobile/statistics/SettingsPage.vue index 322e4778..491f7470 100644 --- a/src/views/mobile/statistics/SettingsPage.vue +++ b/src/views/mobile/statistics/SettingsPage.vue @@ -62,8 +62,8 @@ - - + {{ $t('Trend Analysis Settings') }} + @@ -74,16 +74,16 @@ - - - - - - - - - - + + + + diff --git a/src/views/mobile/statistics/TransactionPage.vue b/src/views/mobile/statistics/TransactionPage.vue index 13d98fb5..3b641b04 100644 --- a/src/views/mobile/statistics/TransactionPage.vue +++ b/src/views/mobile/statistics/TransactionPage.vue @@ -14,22 +14,39 @@ + v-model:opened="showChartDataTypePopover" + @popover:open="scrollPopoverToSelectedItem"> - - - - + + + + + + + + + + + + - +
{{ $t('Sort by') }} @@ -77,7 +94,7 @@ - +
@@ -134,7 +151,7 @@ + + +
+
+ +
+
+ {{ $t('Sort by') }} + {{ querySortingTypeName }} +
+
+
+ + + +
+ @@ -187,18 +236,22 @@ - + - {{ dateRangeName() }} + {{ dateRangeName(query) }} - + + + {{ queryTrendDateAggregationTypeName }} + - {{ chartType.displayName }} + {{ chartType.displayName }} @@ -207,15 +260,15 @@ @popover:open="scrollPopoverToSelectedItem">