From 0c95b6aa6e203dfea9303d0e710e5ab896d96097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=AF=9A?= Date: Fri, 16 Jan 2026 15:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Repository/TransactionRecordRepository.cs | 10 - Web/src/api/statistics.js | 2 - Web/src/assets/base.css | 51 +- .../components/Budget/BudgetChartAnalysis.vue | 514 ++++++++++ Web/src/components/ContributionHeatmap.vue | 86 +- Web/src/utils/theme.js | 4 + Web/src/views/BudgetView.vue | 510 ++++++---- Web/src/views/StatisticsView.vue | 879 +++++------------- 8 files changed, 1150 insertions(+), 906 deletions(-) create mode 100644 Web/src/components/Budget/BudgetChartAnalysis.vue create mode 100644 Web/src/utils/theme.js diff --git a/Repository/TransactionRecordRepository.cs b/Repository/TransactionRecordRepository.cs index fc7cd30..38ad5a2 100644 --- a/Repository/TransactionRecordRepository.cs +++ b/Repository/TransactionRecordRepository.cs @@ -517,19 +517,11 @@ public class TransactionRecordRepository(IFreeSql freeSql) : BaseRepository statistics.MaxExpense) - { - statistics.MaxExpense = amount; - } } else if (record.Type == TransactionType.Income) { statistics.TotalIncome += amount; statistics.IncomeCount++; - if (amount > statistics.MaxIncome) - { - statistics.MaxIncome = amount; - } } } @@ -778,8 +770,6 @@ public class MonthlyStatistics public int ExpenseCount { get; set; } public int IncomeCount { get; set; } public int TotalCount { get; set; } - public decimal MaxExpense { get; set; } - public decimal MaxIncome { get; set; } } /// diff --git a/Web/src/api/statistics.js b/Web/src/api/statistics.js index cdffb56..f935d16 100644 --- a/Web/src/api/statistics.js +++ b/Web/src/api/statistics.js @@ -17,8 +17,6 @@ * @returns {Object} data.expenseCount - 支出笔数 * @returns {Object} data.incomeCount - 收入笔数 * @returns {Object} data.totalCount - 总笔数 - * @returns {Object} data.maxExpense - 最大单笔支出 - * @returns {Object} data.maxIncome - 最大单笔收入 */ export const getMonthlyStatistics = (params) => { return request({ diff --git a/Web/src/assets/base.css b/Web/src/assets/base.css index f31f5f3..1acaed8 100644 --- a/Web/src/assets/base.css +++ b/Web/src/assets/base.css @@ -1,4 +1,4 @@ -/* color palette from */ +/* color palette from */ /* Most variables are replaced by Vant CSS variables. Keeping only what's necessary or mapping to Vant. @@ -17,6 +17,55 @@ --color-text: var(--van-text-color); --section-gap: 160px; + + /* Chart Colors */ + --chart-color-1: #FF6B6B; + --chart-color-2: #4ECDC4; + --chart-color-3: #45B7D1; + --chart-color-4: #FFA07A; + --chart-color-5: #98D8C8; + --chart-color-6: #F7DC6F; + --chart-color-7: #BB8FCE; + --chart-color-8: #85C1E2; + --chart-color-9: #F8B88B; + --chart-color-10: #AAB7B8; + --chart-color-11: #FF8ED4; + --chart-color-12: #67E6DC; + --chart-color-13: #FFAB73; + --chart-color-14: #C9B1FF; + --chart-color-15: #7BDFF2; + + /* Status Colors for Charts */ + --chart-success: #52c41a; + --chart-warning: #faad14; + --chart-danger: #f5222d; + --chart-primary: #1890ff; + --chart-shadow: rgba(0,138,255,0.45); + --chart-axis: #E6EBF8; + --chart-split: #eee; + --chart-text-muted: #999; + + /* Heatmap Colors - Light Mode */ + --heatmap-level-0: var(--van-gray-2); + --heatmap-level-1: #9be9a8; + --heatmap-level-2: #40c463; + --heatmap-level-3: #30a14e; + --heatmap-level-4: #216e39; +} + +@media (prefers-color-scheme: dark) { + :root { + --chart-axis: #333; + --chart-split: #333; + --chart-text-muted: #666; + + /* Heatmap Colors - Dark Mode (GitHub Style) */ + --heatmap-level-0: #161b22; + --heatmap-level-1: #0e4429; + --heatmap-level-2: #006d32; + --heatmap-level-3: #26a641; + --heatmap-level-4: #39d353; + } } /* Removed manual dark mode media query as Vant handles it */ diff --git a/Web/src/components/Budget/BudgetChartAnalysis.vue b/Web/src/components/Budget/BudgetChartAnalysis.vue new file mode 100644 index 0000000..2d3042a --- /dev/null +++ b/Web/src/components/Budget/BudgetChartAnalysis.vue @@ -0,0 +1,514 @@ + + + + + \ No newline at end of file diff --git a/Web/src/components/ContributionHeatmap.vue b/Web/src/components/ContributionHeatmap.vue index 733037c..2b1ccb7 100644 --- a/Web/src/components/ContributionHeatmap.vue +++ b/Web/src/components/ContributionHeatmap.vue @@ -3,13 +3,22 @@
-
-
-
+
+ 二 +
+
+ 四 +
+
+ 六 +
-
+
@@ -25,7 +34,11 @@
-
+