diff --git a/Web/src/router/index.js b/Web/src/router/index.js
index d628a3c..08b9775 100644
--- a/Web/src/router/index.js
+++ b/Web/src/router/index.js
@@ -71,6 +71,12 @@ const router = createRouter({
component: () => import('../views/StatisticsView.vue'),
meta: { requiresAuth: true }
},
+ {
+ path: '/statistics-v2',
+ name: 'statistics-v2',
+ component: () => import('../views/statisticsV2/Index.vue'),
+ meta: { requiresAuth: true }
+ },
{
path: '/bill-analysis',
name: 'bill-analysis',
diff --git a/Web/src/views/calendarV2/Index.vue b/Web/src/views/calendarV2/Index.vue
index 6c36351..1694db5 100644
--- a/Web/src/views/calendarV2/Index.vue
+++ b/Web/src/views/calendarV2/Index.vue
@@ -65,6 +65,14 @@
+
+
+
@@ -75,6 +83,8 @@ import { showToast } from 'vant'
import CalendarModule from './modules/Calendar.vue'
import StatsModule from './modules/Stats.vue'
import TransactionListModule from './modules/TransactionList.vue'
+import TransactionDetailSheet from '@/components/Transaction/TransactionDetailSheet.vue'
+import { getTransactionDetail } from '@/api/transactionRecord'
// 定义组件名称(keep-alive 需要通过 name 识别)
defineOptions({
@@ -135,12 +145,35 @@ const onDayClick = async (day) => {
selectedDate.value = clickedDate
}
-// 点击交易卡片 - 跳转到详情页
-const onTransactionClick = (txn) => {
- router.push({
- path: '/transaction-detail',
- query: { id: txn.id }
- })
+// 交易详情弹窗相关
+const showTransactionDetail = ref(false)
+const currentTransaction = ref(null)
+
+// 点击交易卡片 - 打开详情弹窗
+const onTransactionClick = async (txn) => {
+ try {
+ // 获取完整的交易详情
+ const response = await getTransactionDetail(txn.id)
+ if (response.success && response.data) {
+ currentTransaction.value = response.data
+ showTransactionDetail.value = true
+ } else {
+ showToast('获取交易详情失败')
+ }
+ } catch (error) {
+ console.error('获取交易详情失败:', error)
+ showToast('获取交易详情失败')
+ }
+}
+
+// 保存交易后刷新列表
+const handleTransactionSave = () => {
+ handleTransactionsChanged()
+}
+
+// 删除交易后刷新列表
+const handleTransactionDelete = () => {
+ handleTransactionsChanged()
}
// 点击通知按钮
diff --git a/Web/src/views/statisticsV2/Index.vue b/Web/src/views/statisticsV2/Index.vue
new file mode 100644
index 0000000..9398230
--- /dev/null
+++ b/Web/src/views/statisticsV2/Index.vue
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+ {{ currentYear }}年
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Web/src/views/statisticsV2/modules/BudgetSection.vue b/Web/src/views/statisticsV2/modules/BudgetSection.vue
new file mode 100644
index 0000000..59f9eec
--- /dev/null
+++ b/Web/src/views/statisticsV2/modules/BudgetSection.vue
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
diff --git a/Web/src/views/statisticsV2/modules/CategorySection.vue b/Web/src/views/statisticsV2/modules/CategorySection.vue
new file mode 100644
index 0000000..e7eb2aa
--- /dev/null
+++ b/Web/src/views/statisticsV2/modules/CategorySection.vue
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ category.classify || '未分类' }}
+
+
+ {{ category.count }}笔
+
+
+
+
+
+ ¥{{ formatMoney(category.amount) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Web/src/views/statisticsV2/modules/MetricsCards.vue b/Web/src/views/statisticsV2/modules/MetricsCards.vue
new file mode 100644
index 0000000..e7c2fbd
--- /dev/null
+++ b/Web/src/views/statisticsV2/modules/MetricsCards.vue
@@ -0,0 +1,401 @@
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{ formatMoney(stats.totalExpense) }}
+
+
+ {{ getChangeDescription('expense') }}
+
+
+
+
+
+
+
+ {{ stats.totalCount }}
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{ formatMoney(stats.totalIncome) }}
+
+
+ 工资、红包等
+
+
+
+
+
+
+
+ {{ stats.balance >= 0 ? '+' : '' }}¥{{ formatMoney(Math.abs(stats.balance)) }}
+
+
+
+
{{ balanceDescription }}
+
+
+
+
+
+
+
+
+
diff --git a/Web/src/views/statisticsV2/modules/PeriodSelector.vue b/Web/src/views/statisticsV2/modules/PeriodSelector.vue
new file mode 100644
index 0000000..18af9a4
--- /dev/null
+++ b/Web/src/views/statisticsV2/modules/PeriodSelector.vue
@@ -0,0 +1,85 @@
+
+
+
+
+ {{ period.label }}
+
+
+
+
+
+
+
+
diff --git a/Web/src/views/statisticsV2/modules/TrendSection.vue b/Web/src/views/statisticsV2/modules/TrendSection.vue
new file mode 100644
index 0000000..0531081
--- /dev/null
+++ b/Web/src/views/statisticsV2/modules/TrendSection.vue
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ day.label }}
+
+
+
+
+
+
+
+
+
+