Open source personal finance application
update 3.2.5
ilkomea4447c5c3127
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vueindex 30194d85..c0970191 100644--- a/components/layout/LayoutMobile.vue+++ b/components/layout/LayoutMobile.vue@@ -30,7 +30,7 @@ export default {return this.$store.state.ui.activeTab},- stat () {+ statCurrentPeriod () {return this.$store.getters['stat/statCurrentPeriod']},@@ -109,6 +109,17 @@ export default {.page__navh1: Date+ .page__summary+ SummaryRow(+ :incomesAmount="statCurrentPeriod.incomes.total"+ :expensesAmount="statCurrentPeriod.expenses.total"+ )++ .page__summary+ //- Summary+ //-----------------------------------------------------------+ LazySummaryAverage(v-if="$store.state.ui.stat.averageStatVisibility === 'visible'")+.page__content.chartBar(v-show="$store.state.ui.statGraphsVisibility === 'visible'")ChartMenu2@@ -188,6 +199,14 @@ export default {@onClick="$store.dispatch('ui/toogleShowStatGraphs')")+ ContextMenuItem(+ :title="$t('stat.customize.averageStatVisibility')"+ :showCheckbox="true"+ :checkboxValue="$store.state.ui.stat.averageStatVisibility === 'visible'"+ icon="mdi mdi-chart-timeline"+ @onClick="$store.dispatch('ui/toogleAverageStatVisibility')"+ )+ContextMenuItem(:title="$t('stat.customize.showCategorisChart')":showCheckbox="true"@@ -268,11 +287,6 @@ export default {@import "~assets/stylus/variables/fonts"@import "~assets/stylus/variables/scroll"-.opener- opacity .6- padding 8px 0 0 0- font-size 20px-.pageoverflow hiddenposition relative@@ -280,13 +294,18 @@ export default {height 100%&__nav+ overflow hiddenz-index 100opacity .95position stickytop 0+ height 94pxpadding $m7background var(--c-bg-2)+ &__summary+ padding-top $m6+&__wrapoverflow hiddenoverflow-y autodiff --git a/components/stat/StatChartsLine.vue b/components/stat/StatChartsLine.vueindex 020d4d50..5aa55525 100644--- a/components/stat/StatChartsLine.vue+++ b/components/stat/StatChartsLine.vue@@ -208,16 +208,14 @@ export default {</template><style lang="stylus" scoped>-@import "~assets/stylus/variables/animations"-@import "~assets/stylus/variables/margins"-@import "~assets/stylus/variables/fonts"-@import "~assets/stylus/variables/media"-@import "~assets/stylus/variables/scroll"+@import "~assets/stylus/variables".chartsz-index 5position relative- padding $m6++ +media-tablet()+ padding $m6&__allDataopacity .7diff --git a/components/stat/StatMobile.vue b/components/stat/StatMobile.vueindex 67079552..26de8c2f 100644--- a/components/stat/StatMobile.vue+++ b/components/stat/StatMobile.vue@@ -17,6 +17,14 @@ export default {return this.$store.getters['stat/statCurrentPeriod']},+ statAverage () {+ return this.$store.getters['stat/statAverage']+ },++ periods () {+ return this.$store.state.chart.periods+ },+filterCategory () {return this.$store.state.categories.items[this.$store.state.filter.categoryId]},@@ -82,47 +90,44 @@ export default {//- Header//---------------------------------------------------------------------------.stat__header(:class="{ _withFilter: ($store.state.filter.categoryId || $store.state.filter.walletId) }")- .statItem-header(+ .statItemHeader(:class="{ _active: activeTabStat === 'incomes' }"@click="$store.dispatch('ui/setActiveTabStat', 'incomes')")- .statItem-total- .statItem-total__title {{ $t('money.incomes') }}- .statItem-total__amount- Amount(- :currency="$store.state.currencies.base"- :type="1"- :value="statCurrentPeriod.incomes.total"- size="md"- )-- .statItem-header(+ .statItemHeader__title {{ $t('money.incomes') }}+ //- .statItemHeader__amount+ //- Amount(+ //- :currency="$store.state.currencies.base"+ //- :type="1"+ //- :value="statCurrentPeriod.incomes.total"+ //- size="md"+ //- )++ .statItemHeader(:class="{ _active: activeTabStat === 'expenses' }"@click="$store.dispatch('ui/setActiveTabStat', 'expenses')")- .statItem-total- .statItem-total__title {{ $t('money.expenses') }}- .statItem-total__amount- Amount(- :currency="$store.state.currencies.base"- :type="0"- :value="statCurrentPeriod.expenses.total"- size="md"- )-- .statItem-header(+ .statItemHeader__title {{ $t('money.expenses') }}+ //- .statItemHeader__amount+ //- Amount(+ //- :currency="$store.state.currencies.base"+ //- :type="0"+ //- :value="statCurrentPeriod.expenses.total"+ //- size="md"+ //- )++ .statItemHeader(:class="{ _active: activeTabStat === 'history' }"@click="$store.dispatch('ui/setActiveTabStat', 'history')")- .statItem-total- .statItem-total__title {{ $t('trns.shortTitle') }}- .statItem-total__amount- Amount(- :currency="$store.state.currencies.base"- :type="3"- :value="statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total"- size="md"- )+ .statItemHeader__title {{ $t('trns.history') }}+ //- .statItemHeader__amount+ //- Amount(+ //- :currency="$store.state.currencies.base"+ //- :type="3"+ //- :value="statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total"+ //- size="md"+ //- )//- Content//---------------------------------------------------------------------------@@ -208,11 +213,7 @@ export default {</style><style lang="stylus" scoped>-@import "~assets/stylus/variables/margins"-@import "~assets/stylus/variables/media"-@import "~assets/stylus/variables/flex"-@import "~assets/stylus/variables/fonts"-@import "~assets/stylus/variables/scroll"+@import "~assets/stylus/variables".swiper-slideoverflow hidden@@ -222,31 +223,31 @@ export default {.statposition relativemargin 0 -8px+ padding-top $m7&__filteroverflow autoz-index 10- opacity .95position sticky- top 34px+ top 94pxdisplay flex- padding-top 16px+ padding-bottom $m8background var(--c-bg-2)scrollbar()&__headerz-index 10- opacity .95position sticky- top 50px+ top 93pxdisplay flexalign-items center- justify-content space-between- margin-top $m5+ justify-content space-around+ margin-bottom $m7+ padding-bottom $m5background var(--c-bg-2)&._withFilter- top 86px+ top 138px&__chartspadding-bottom $m7@@ -262,40 +263,26 @@ export default {padding 0 10pxpadding-bottom 20px-.statGroup- padding-top $m7--.statItem-header- flex-grow 1- padding $m3- padding-top $m6- padding-bottom $m6+.statItemHeader+ padding $m6+ padding-top 0+ padding-bottom $m5border-bottom 2px solid transparent&._activeopacity 1border-bottom 2px solid var(--c-bg-9)-.statItem-total- display flex- align-items center- flex-flow column- flex-grow 1- padding 0 $m2-- &__amount- padding-top $m5-&__title- flex-grow 1- font-size 12px- color var(--c-font-3)+ padding 0 $m2+ color var(--c-font-5)+ font-size 14px- &._incomes- color var(--c-incomes-1)+ ~/._active &+ color var(--c-font-2)- &._expenses- color var(--c-expenses-1)+ &__amount+ padding-top $m5.statItem&__trnsdiff --git a/components/stat/StatSummaryMobile.vue b/components/stat/StatSummaryMobile.vuedeleted file mode 100644index 1bc4e267..00000000--- a/components/stat/StatSummaryMobile.vue+++ /dev/null@@ -1,89 +0,0 @@-<script>-export default {- name: 'StatSummaryMobile',-- computed: {- stat () {- return this.$store.getters['stat/statCurrentPeriod']- },- statAverage () {- return this.$store.getters['stat/statAverage']- },- period () {- return this.$store.state.filter.period- }- }-}-</script>--<template lang="pug">-.summary- .summary__item._incomes(@click="$store.dispatch('ui/setActiveTabStat', 'incomes')")- template(v-if="statAverage.incomes > 0 || period === 'all'")- .summary__item__title._incomes {{ $t('money.incomes') }}- .summary__item__amount- Amount(- :center="true"- :currency="$store.state.currencies.base"- :type="1"- :value="stat.incomes.total"- )- template(v-else) .-- .summary__item._total(@click="$store.dispatch('ui/setActiveTabStat', 'stat')")- template(v-if="statAverage.total !== 0")- template(v-if="stat.incomes.total > 0 || stat.expenses.total > 0")- .summary__item__title {{ $t('money.total') }}- .summary__item__amount- Amount(- :center="true"- :currency="$store.state.currencies.base"- :value="stat.incomes.total - stat.expenses.total"- )- template(v-else) .-- .summary__item._expenses(@click="$store.dispatch('ui/setActiveTabStat', 'expenses')")- template(v-if="statAverage.expenses > 0 || period === 'all'")- .summary__item__title._expenses {{ $t('money.expenses') }}- .summary__item__amount- Amount(- :center="true"- :currency="$store.state.currencies.base"- :value="stat.expenses.total"- :type="0"- )- template(v-else) .-</template>--<style lang="stylus" scoped>-@import "~assets/stylus/variables/margins"--.summary- display flex- margin $m6- margin-bottom 0- padding $m6 0- background var(--c-bg-4)- // border-bottom 1px solid var(--c-bg-1)- border-radius $m5-- &__item- flex 1- text-align center- display flex- flex-flow column- align-items center- justify-content center-- &:first-child- align-items flex-start- padding-left $m7-- &:last-child- align-items flex-end- padding-right $m7-- &__title- padding-bottom $m5- color var(--c-font-4)-</style>diff --git a/components/stat/StatSummaryPc.vue b/components/stat/StatSummaryPc.vueindex 3e3bb7d5..9a9aa90a 100644--- a/components/stat/StatSummaryPc.vue+++ b/components/stat/StatSummaryPc.vue@@ -119,8 +119,8 @@ export default {@media $media-laptopflex 0 1 250px- padding 0margin 0+ padding 0@media $media-pcpadding $m3 $m9@@ -163,15 +163,15 @@ export default {font-size 15px&__average- display flexopacity .7+ display flex&__icon- font-size 15pxmargin-right $m5+ font-size 15px&__title+ padding-right $m8font-header-4()font-size 16px- padding-right $m8</style>diff --git a/components/stat/SummaryRow.vue b/components/stat/SummaryRow.vueindex b195f17f..6da8616a 100644--- a/components/stat/SummaryRow.vue+++ b/components/stat/SummaryRow.vue@@ -9,6 +9,12 @@ export default {type: Number,default: 0}+ },++ computed: {+ statAverage () {+ return this.$store.getters['stat/statAverage']+ }}}</script>@@ -16,40 +22,40 @@ export default {<template lang="pug">.summary//- Incomes- .summary__item._incomes+ .summary__item._incomes(v-if="statAverage.incomes !== 0").summary__item__title._incomes {{ $t('money.incomes') }}.summary__item__amountAmount(- :center="true":currency="$store.state.currencies.base":type="1":value="incomesAmount || 0"size="md"+ vertical="left")//- Expenses- .summary__item._expenses+ .summary__item._expenses(v-if="statAverage.expenses !== 0").summary__item__title._expenses {{ $t('money.expenses') }}.summary__item__amountAmount(- :center="true":currency="$store.state.currencies.base"- :value="expensesAmount || 0":type="0"+ :value="expensesAmount || 0"size="md"+ vertical="left")//- Total- .summary__item._total+ .summary__item._total(v-if="statAverage.total !== 0")template(v-if="(incomesAmount - expensesAmount) !== 0").summary__item__title {{ $t('money.total') }}.summary__item__amountAmount(- v-if="incomesAmount > 0 || expensesAmount > 0":center="true":currency="$store.state.currencies.base":value="incomesAmount - expensesAmount"size="md"+ vertical="left")</template>@@ -58,31 +64,29 @@ export default {.summarydisplay flex- // padding $m6 0- // background var(--c-bg-4)- // border-radius $m5&__item+ flex 1 0 0position relative- padding-right 32pxdisplay flex- flex-flow columnjustify-content center+ flex-flow column+ // padding-right 32px- &:after- position absolute- right 16px- top 50%- content ""- width 1px- height 32px- background var(--c-bg-7)- transform translateY(-50%)+ // &:after+ // position absolute+ // top 50%+ // right 16px+ // content ""+ // width 1px+ // height 32px+ // background var(--c-bg-7)+ // transform translateY(-50%)- &:last-child- padding-right 0- &:after- display none+ // &:last-child+ // padding-right 0+ // &:after+ // display none&__titlepadding-bottom $m5diff --git a/components/stat/chart/ChartMenu.vue b/components/stat/chart/ChartMenu.vueindex 758ee8b0..b6b80689 100644--- a/components/stat/chart/ChartMenu.vue+++ b/components/stat/chart/ChartMenu.vue@@ -58,7 +58,8 @@ ContextMenu(:position="{ right: showDropdown ? '-12px' : true }":visible="visibleContextMenu":openerCircle="true"- @onClickOpener="visibleContextMenu = !visibleContextMenu")+ @onClickOpener="visibleContextMenu = !visibleContextMenu"+)template(v-if="showDropdown")template(slot="opener")diff --git a/components/stat/chart/ChartMenu2.vue b/components/stat/chart/ChartMenu2.vueindex 4d3ffabd..800fbe98 100644--- a/components/stat/chart/ChartMenu2.vue+++ b/components/stat/chart/ChartMenu2.vue@@ -66,9 +66,7 @@ export default {<template lang="pug">.switcher- .switcher__name(@click="toogleView")- template(v-if="periods[filterPeriod].grouped") {{ periods[filterPeriod].showedGroups }} {{ $t('chart.view.groupsName') }}- template(v-else) {{ periods[filterPeriod].showedPeriods }} {{ $t(`dates.${periodName}.simple`) }}+ .switcher__name(@click="toogleView") {{ Object.keys($store.getters['stat/statByPeriods']).length }} {{ $t(`dates.${periodName}.simple`) }}.switcher__content(:class="{ _active: visibleContextMenu}").switcher__item(@@ -95,23 +93,23 @@ export default {@import "~assets/stylus/variables".switcher+ overflow hidden+ z-index 15position relativedisplay flexalign-items centerjustify-content space-between- z-index 15// padding 0 $m5margin-bottom $m6border-radius 8px 8px 0 0- overflow hiddenborder-bottom 1px solid var(--c-bg-4)&__nameflex-grow 1+ padding-left $m6+ color var(--c-font-5)font-size 10pxtext-transform uppercase- color var(--c-font-5)- padding-left $m6&__contentdisplay flex@@ -126,14 +124,14 @@ export default {justify-content space-between&__item+ opacity .6display flexalign-items centerjustify-content center- text-align center- opacity .6min-width 48pxpadding $m5 $m7font-size 12px+ text-align center.mdifont-size 16pxdiff --git a/components/summary/SummaryAverage.vue b/components/summary/SummaryAverage.vuenew file mode 100644index 00000000..5d32413f--- /dev/null+++ b/components/summary/SummaryAverage.vue@@ -0,0 +1,72 @@+<script>+export default {+ name: 'SummaryAverage',++ computed: {+ statCurrentPeriod () {+ return this.$store.getters['stat/statCurrentPeriod']+ },++ statAverage () {+ return this.$store.getters['stat/statAverage']+ },++ daysLeft () {+ const filterDate = this.$store.state.filter.date+ const filterPeriod = this.$store.state.filter.period+ console.log(filterDate, filterPeriod)+ return null+ }+ }+}+</script>++<template lang="pug">+.summary+ .summary__name {{ $t('stat.title') }} {{ $t('for') }} {{ Object.keys($store.getters['stat/statByPeriods']).length }} {{ $t(`dates.${$store.state.filter.period}.simple`) }}+ .summary__content+ SummaryRowItem(+ v-if="statAverage.incomes !== 0"+ :amount="statAverage.incomes"+ :type="1"+ :name="$t('money.averageIncomes')"+ )+ SummaryRowItem(+ v-if="statAverage.expenses !== 0"+ :amount="statAverage.expenses"+ :type="0"+ :name="$t('money.averageExpenses')"+ )+ SummaryRowItem(+ v-if="statAverage.total !== 0"+ :amount="statAverage.total"+ :name="$t('money.averageTotal')"+ )++ //- SummaryRowItem(+ //- v-if="statAverage.expenses !== 0"+ //- :amount="statAverage.expenses - statCurrentPeriod.expenses.total"+ //- :name="(statAverage.expenses - statCurrentPeriod.expenses.total) > 0 ? 'Сохранено' : 'Перерасход'"+ //- )+</template>++<style lang="stylus" scoped>+@import "~assets/stylus/variables"++.summary+ padding 0 $m7+ padding-bottom $m9++ &__name+ padding-bottom $m6+ color var(--c-font-2)+ font-size 18px+ font-weight 600+ white-space nowrap+ text-transform uppercase+ letter-spacing .5px+ font-secondary()++ &__content+ display flex+</style>diff --git a/components/summary/SummaryRowItem.vue b/components/summary/SummaryRowItem.vuenew file mode 100644index 00000000..5a06fa52--- /dev/null+++ b/components/summary/SummaryRowItem.vue@@ -0,0 +1,62 @@+<script>+export default {+ name: 'SummaryRowItem',++ props: {+ name: {+ type: String,+ required: true+ },++ amount: {+ type: Number,+ required: true+ },++ type: {+ type: Number,+ required: true+ }+ },++ computed: {+ className () {+ return {+ _expenses: this.type === 0,+ _incomes: this.type === 1+ }+ }+ }+}+</script>++<template lang="pug">+.summaryRowItem(:class="className")+ .summaryRowItem__title {{ name }}+ .summaryRowItem__amount+ Amount(+ :currency="$store.state.currencies.base"+ :type="type"+ :value="amount || 0"+ size="md"+ vertical="left"+ )+</template>++<style lang="stylus" scoped>+@import "~assets/stylus/variables"++.summaryRowItem+ flex 1 0 0+ position relative+ display flex+ justify-content center+ flex-flow column+ // padding-right 32px+ // text-align center++ &__title+ padding-bottom $m5+ color var(--c-font-4)+ font-size 12px+</style>diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vueindex 15b0475b..95e6d097 100644--- a/components/trns/list/TrnsList.vue+++ b/components/trns/list/TrnsList.vue@@ -97,13 +97,6 @@ export default {<template lang="pug">.trnsList- //- .trnsList__sort(- //- v-if="$store.getters['user/isTester'] && ui === 'history'"- //- @click="sortByEditDate = !sortByEditDate"- //- )- //- template(v-if="sortByEditDate") Sort by transaction date- //- template(v-else) Sort by edit date-.trnsList__contenttemplate(v-if="trnsIds.length > 0")//- history view@@ -147,6 +140,9 @@ export default {.trnsListpadding-bottom 8px+ &:last-child+ padding-bottom 0++media-laptop()padding 0diff --git a/locales/en-US.js b/locales/en-US.jsindex 46c678d4..4bc9438d 100644--- a/locales/en-US.js+++ b/locales/en-US.js@@ -1,6 +1,8 @@export default {appName: 'Finapp',+ for: 'for',+locale: {toogle: 'Toogle locale'},@@ -198,12 +200,14 @@ export default {},stat: {+ title: 'Statistics',shortTitle: 'Stat',balanceTitle: 'Balance',empty: 'No stat for this period',customize: {showPeriodsChart: 'Show periods chart',showCategorisChart: 'Show categories chart',+ averageStatVisibility: 'Show average statistics',showCategorisList: 'Show categories list'}},@@ -242,6 +246,9 @@ export default {transfer: 'Transfer',total: 'Total',average: 'Average',+ averageIncomes: 'Average incomes',+ averageExpenses: 'Average expenses',+ averageTotal: 'Average total',also: 'Also',wallets: 'Wallets',all: 'Total'diff --git a/locales/ru-RU.js b/locales/ru-RU.jsindex 11f184d3..77fa2292 100644--- a/locales/ru-RU.js+++ b/locales/ru-RU.js@@ -2,6 +2,8 @@export default {appName: 'Финапка',+ for: 'за',+locale: {toogle: 'Сменить язык'},@@ -200,11 +202,13 @@ export default {},stat: {+ title: 'Статистика',shortTitle: 'Статистика',balanceTitle: 'Баланс',empty: 'Статистики по выбранным параметрам нет :)',customize: {showPeriodsChart: 'Показывать график периодов',+ averageStatVisibility: 'Показывать средниюю статистику',showCategorisChart: 'Показывать график категорий',showCategorisList: 'Показывать список категорий'}@@ -244,6 +248,9 @@ export default {transfer: 'Перевод',total: 'Итого',average: 'Среднее',+ averageIncomes: 'Средний доход',+ averageExpenses: 'Средний расход',+ averageTotal: 'Средний баланс',also: 'Еще',wallets: 'Кошельки',all: 'Всего'diff --git a/nuxt.config.js b/nuxt.config.jsindex 9cdd0b81..abdff1bf 100644--- a/nuxt.config.js+++ b/nuxt.config.js@@ -4,19 +4,19 @@ export default {},/**- * https://nuxtjs.org/guides/configuration-glossary/configuration-ssr+ * https://nuxtjs.org/guides/configuration-glossary/configuration-modern*/- ssr: false,+ modern: 'client',/**- * https://nuxtjs.org/guides/configuration-glossary/configuration-modern+ * https://nuxtjs.org/guides/configuration-glossary/configuration-ssr*/- modern: 'client',+ ssr: false,/*** https://nuxtjs.org/guides/configuration-glossary/configuration-target*/- target: 'server',+ target: 'static',/*** https://nuxtjs.org/guides/configuration-glossary/configuration-telemetry@@ -89,7 +89,6 @@ export default {* Nuxt.js dev-modules*/buildModules: [- '@nuxtjs/color-mode','@nuxtjs/pwa','nuxt-composition-api'],@@ -106,9 +105,10 @@ export default {* Nuxt.js modules*/modules: [+ '@nuxtjs/color-mode','@nuxtjs/pwa',- 'portal-vue/nuxt',- 'nuxt-i18n'+ 'nuxt-i18n',+ 'portal-vue/nuxt'],/**diff --git a/package.json b/package.jsonindex 7849f7f7..77b02576 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "finapp",- "version": "3.2.4",+ "version": "3.2.5","scripts": {"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt","build": "nuxt build",diff --git a/store/stat/getters.js b/store/stat/getters.jsindex 968320ea..2beb8bde 100644--- a/store/stat/getters.js+++ b/store/stat/getters.js@@ -11,7 +11,11 @@ export default {*/statAverage (state, getters, rootState) {const statPeriods = getters.statByPeriods- const numberOfPeriods = rootState.stat.showedPeriods++ let notEmptyPeriods = 0+ if (statPeriods) {+ notEmptyPeriods = Object.keys(statPeriods).filter(id => statPeriods[id].total !== 0).length+ }let incomes = 0let expenses = 0@@ -27,9 +31,9 @@ export default {}return {- incomes: Math.ceil(incomes / numberOfPeriods),- expenses: Math.ceil(expenses / numberOfPeriods),- total: Math.ceil(total / numberOfPeriods)+ incomes: Math.ceil(incomes / notEmptyPeriods),+ expenses: Math.ceil(expenses / notEmptyPeriods),+ total: Math.ceil(total / notEmptyPeriods)}},@@ -177,8 +181,8 @@ export default {const statExpenses = {}for (const categoryId in categoriesWithTrnsIds) {const total = categoriesTotal[categoryId]- if (total.incomes > 0) statIncomes[categoryId] = total- if (total.expenses > 0) statExpenses[categoryId] = total+ if (total.incomes > 0) { statIncomes[categoryId] = total }+ if (total.expenses > 0) { statExpenses[categoryId] = total }}// sort categories amount@@ -188,8 +192,8 @@ export default {if (categoriesIds.length) {sortedCategoriesIds = categoriesIds.sort((a, b) => {- if (categories[a][typeName] > categories[b][typeName]) return -1- if (categories[a][typeName] < categories[b][typeName]) return 1+ if (categories[a][typeName] > categories[b][typeName]) { return -1 }+ if (categories[a][typeName] < categories[b][typeName]) { return 1 }return 0})}diff --git a/store/ui/actions.js b/store/ui/actions.jsindex b42893d5..810722f7 100644--- a/store/ui/actions.js+++ b/store/ui/actions.js@@ -2,7 +2,7 @@ import localforage from 'localforage'export default {async initUi ({ commit, dispatch }) {- const uiLocalStore = await localforage.getItem('uiLocalStore')+ const uiLocalStore = await localforage.getItem('finapp.statActiveTab')// uiif (uiLocalStore) {@@ -76,7 +76,7 @@ export default {setActiveTabStat ({ commit, state }, nextTab) {if (state.stat.activeTab !== nextTab) {commit('setActiveTabStat', nextTab)- localforage.setItem('uiLocalStore', state)+ localforage.setItem('finapp.statActiveTab', state)}},@@ -103,6 +103,19 @@ export default {dispatch('ui/saveUiView', null, { root: true })},+ /**+ * toogleAverageStatVisibility+ */+ toogleAverageStatVisibility ({ commit, dispatch, state }) {+ let nextStatus+ state.stat.averageStatVisibility === 'visible'+ ? nextStatus = 'hidden'+ : nextStatus = 'visible'++ commit('setAverageStatVisibility', nextStatus)+ dispatch('ui/saveUiView', null, { root: true })+ },+/*** Toggle stat cats items*/@@ -143,7 +156,10 @@ export default {period: rootState.filter.period,statGraphsVisibility: rootState.ui.statGraphsVisibility,statItems: rootState.ui.statItems,- totalChartPeriods: rootState.chart.periods+ totalChartPeriods: rootState.chart.periods,+ stat: {+ averageStatVisibility: rootState.ui.stat.averageStatVisibility+ }}})},@@ -176,6 +192,11 @@ export default {? commit('setVisibilityStatItems', 'visible'): commit('setVisibilityStatItems', 'hidden')+ // Average statistics+ localFilterUiItem.stat.averageStatVisibility === 'visible'+ ? commit('setAverageStatVisibility', 'visible')+ : commit('setAverageStatVisibility', 'hidden')+// periods in total chartconst currentPeriodName = rootState.filter.periodconst localPeriodValues = localFilterUiItem.totalChartPeriods[currentPeriodName]diff --git a/store/ui/index.js b/store/ui/index.jsindex cfa7d9da..f53d1aef 100644--- a/store/ui/index.js+++ b/store/ui/index.js@@ -11,7 +11,8 @@ const state = () => ({statGraphsVisibility: 'visible',statItems: 'visible',stat: {- activeTab: 'stat'+ activeTab: 'incomes',+ averageStatVisibility: 'visible'},width: 0})diff --git a/store/ui/mutations.js b/store/ui/mutations.jsindex 7fe32165..df91062a 100644--- a/store/ui/mutations.js+++ b/store/ui/mutations.js@@ -22,9 +22,14 @@ export default {},setVisibleCatsChart (state, status) {+ console.log('setVisibleCatsChart', status)state.catsChart = status},+ setAverageStatVisibility (state, status) {+ state.stat.averageStatVisibility = status+ },+setVisibilityStatItems (state, status) {state.statItems = status},