diff --git a/src/App.vue b/src/App.vue index ad5769d..3919369 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,6 +30,7 @@ const isSpaceSelected = computed( const menu = [ { name: "Dashboard", icon: "pi pi-chart-bar", link: "/", navStack: 'dashboard' }, + { name: "Analytics", icon: "pi pi-chart-line", link: "/analytics", navStack: 'analytics' }, { name: "Transactions", icon: "pi pi-list", link: "/transactions", navStack: 'transactions' }, { name: "Settings", icon: "pi pi-cog", link: "/settings", navStack: 'settings' }, ]; diff --git a/src/router/index.ts b/src/router/index.ts index 6ee3de9..1451490 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -24,6 +24,7 @@ declare module 'vue-router' { // ⚙️ Ленивая загрузка компонентов (code-splitting) const SettingsList = () => import('@/components/settings/SettingsList.vue') const CategoriesList = () => import('@/components/settings/CategoriesList.vue') +const AnalyticsView = () => import('@/views/AnalyticsView.vue') const RecurrentsList = () => import('@/components/settings/RecurrentsList.vue') const SpaceSettings = () => import('@/components/settings/SpaceSettings.vue') const NotificationSettings = () => import('@/components/settings/NotificationSettings.vue') @@ -32,6 +33,7 @@ const NotificationSettings = () => import('@/components/settings/NotificationSet export const RouteName = { Login: 'login', Dashboard: 'dashboard', + Analytics: 'analytics', TransactionList: 'transaction-list', TransactionCreate: 'transaction-create', TransactionUpdate: 'transaction-update', @@ -59,6 +61,12 @@ const routes: RouteRecordRaw[] = [ component: DashboardView, meta: { requiresAuth: true, navStack: 'dashboard', title: "Home" } }, + { + path: '/analytics', + name: RouteName.Analytics, + component: AnalyticsView, + meta: { requiresAuth: true, navStack: 'analytics', title: "Analytics" } + }, { path: '/transactions', name: RouteName.TransactionList, diff --git a/src/views/AnalyticsView.vue b/src/views/AnalyticsView.vue new file mode 100644 index 0000000..f2b052c --- /dev/null +++ b/src/views/AnalyticsView.vue @@ -0,0 +1,322 @@ + + + + + + + Analytics + + + + 3 Months + + + 6 Months + + + + + + + + + + + + + + Total Expenses + + {{ formatAmount(totalExpense) }} ₽ + + + + Average Monthly + + {{ formatAmount(averageExpense) }} ₽ + + + + + + + Expenses Overview + + + + + + + + Top Categories + + + + + {{ cat.icon }} + + {{ cat.name }} + avg. {{ formatAmount(cat.averageAmount) }} + ₽/mo + + + + + {{ + formatAmount(cat.totalAmount) }} ₽ + {{ cat.percentage }}% + + + + + + + + Monthly Breakdown + + + + + + {{ item.label + }} + + + + - {{ formatAmount(item.data.totalExpense) }} ₽ + + {{ formatAmount(item.data.totalIncome) }} ₽ + + + + + + + + + + {{ cat.category.icon }} + {{ + cat.category.name }} + + + + {{ formatAmount(cat.currentPeriodAmount) }} ₽ + + + + No expenses this month + + + + + + + + +```