feat: 删除亲情卡分类并优化搜索功能

- 移除亲情卡支出分类(前端+后端)
- 搜索结果添加点击编辑功能
- 提取 RecordModal 组件复用(index.js/search.js)
- 添加 useMemo 优化计算性能
- 优化类别查找为 O(1) 映射
- 添加删除分类接口输入验证

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Developer
2026-03-17 11:19:26 +08:00
co-authored by Claude Opus 4.6
parent 3347a256b2
commit b5f9a238bb
8 changed files with 457 additions and 218 deletions
+7
View File
@@ -91,6 +91,13 @@ export async function deleteRecord(id) {
});
}
// 批量删除指定分类的记录
export async function deleteRecordsByCategory(category) {
return apiCall(`/api/records/by-category/${encodeURIComponent(category)}`, {
method: 'DELETE',
});
}
// 搜索
export async function searchRecords(keyword) {
return apiCall(`/api/records/search?q=${encodeURIComponent(keyword)}`);