在收支记录页批量操作区新增「AI 生成规则」入口,可基于勾选的账单调用 AI 归纳分类与标签规则,在弹窗中预览、勾选创建,并可选择同时将这些规则应用到所选账单,复用既有规则生成能力并补充本地匹配应用接口。 变更内容: - 后端新增 `POST /api/ai/rule/apply-transactions`(`AiRuleService.applyToTransactions`):按传入规则对指定交易做本地匹配,命中则覆盖分类、追加标签,必要时新建分类与标签,复用 `AiSuggestionService.apply` 落库。 - 新增 DTO `AiRuleTransactionApplyRequest`,复用 `AiRuleApplyRequest.Item` 结构承载规则定义。 - 前端 `api/ai.ts` 抽出 `AiRuleApplyItem` 类型并新增 `applyRulesToTransactions`。 - 新增组件 `AiRuleSuggestModal.vue`:展示规则建议、勾选创建,并提供「同时应用到当前勾选的 N 条账单」开关。 - `TransactionList.vue` 批量操作区新增「AI 生成规则」按钮(受 AI 启用状态控制),勾选账单后一步生成并预览规则。 - `locales/messages.ts` 补充相关中文、英文、日文文案。 说明: - `apply-transactions` 为纯本地匹配、不调用大模型,不外发任何敏感数据;`suggest` 仍遵循白名单只发送类型、备注、渠道与分类标签名称。
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.