diff --git a/config/CHANGELOG.md b/config/CHANGELOG.md index 3c02f2b..cab3f1c 100644 --- a/config/CHANGELOG.md +++ b/config/CHANGELOG.md @@ -1,5 +1,12 @@ # 版本更新记录 +## v0.2.3 (2026-05-11) + +### 前端更新 +- **News.jsx** + - 修复:统计表格点击均价弹出的成交详情列表按成交日期倒序排序 + - 更新:calcAvg函数过滤后对items按deal_date排序 + ## v0.2.2 (2026-05-11) ### 后端更新 diff --git a/config/VERSION.json b/config/VERSION.json index bf39de9..cb4fda1 100644 --- a/config/VERSION.json +++ b/config/VERSION.json @@ -1,12 +1,12 @@ { - "version": "0.2.2", + "version": "0.2.3", "updated": "2026-05-11", "modules": { "frontend": { - "version": "0.1.9", + "version": "0.2.0", "pages": { "Add": "0.0.2", - "News": "0.1.0" + "News": "0.2.0" } }, "backend": { diff --git a/frontend/src/pages/News.jsx b/frontend/src/pages/News.jsx index 5686ed4..aeba8e9 100644 --- a/frontend/src/pages/News.jsx +++ b/frontend/src/pages/News.jsx @@ -588,6 +588,12 @@ export default function News() { return p === pkg && c === cat }) if (items.length === 0) return null + // 按成交日期倒序排序 + items.sort((a, b) => { + const dateA = a.deal_date || a.created_at?.split('T')[0] || '' + const dateB = b.deal_date || b.created_at?.split('T')[0] || '' + return dateB.localeCompare(dateA) + }) const sum = items.reduce((a, b) => a + (b.deal_price || 0), 0) return { avg: Math.round(sum / items.length), count: items.length, items } }