feat(ai): 新增 AI 模块并集成至备课/错题集/试卷/改题四大业务场景
- 新增 src/modules/ai 独立模块,遵循三层架构(actions → services → shared/lib/ai) - 通过 AiClientProvider + useAiClient 实现 React Context 依赖注入,业务组件零直接 import - 6 个 Server Actions 均调用 requirePermission() 权限校验,返回 ActionState<T> - withAiTracking 统一埋点,覆盖 chat/similar_question/grading_assist/lesson_content/question_variant/weakness_analysis - 集成场景:作业批改 AiGradingAssist、错题集 AiErrorBookAnalysis、备课 AiLessonContentGenerator、试卷 AiQuestionVariantGenerator - 全量 i18n(en/zh-CN ai.json),Error Boundary + Skeleton 边界处理 - 同步架构图 004/005,新增审计报告 ai-module-audit-report.md
This commit is contained in:
109
src/shared/i18n/messages/zh-CN/ai.json
Normal file
109
src/shared/i18n/messages/zh-CN/ai.json
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"chat": {
|
||||
"title": "AI 助手",
|
||||
"placeholder": "请输入您的问题...",
|
||||
"inputLabel": "消息输入",
|
||||
"send": "发送",
|
||||
"thinking": "AI 正在思考...",
|
||||
"maxReached": "已达到最大消息数",
|
||||
"clear": "清空对话"
|
||||
},
|
||||
"provider": {
|
||||
"label": "AI 服务商",
|
||||
"placeholder": "选择服务商",
|
||||
"loading": "加载服务商中...",
|
||||
"default": "默认",
|
||||
"description": "选择本次操作使用的 AI 配置。",
|
||||
"manage": "管理",
|
||||
"manageTitle": "AI 服务商设置",
|
||||
"manageDescription": "新建服务商或更新已有配置。"
|
||||
},
|
||||
"suggestion": {
|
||||
"title": "AI 建议",
|
||||
"generate": "生成建议",
|
||||
"regenerate": "重新生成",
|
||||
"loading": "AI 思考中...",
|
||||
"empty": "暂无建议",
|
||||
"error": "生成建议失败",
|
||||
"loaded": "建议已加载",
|
||||
"selected": "已选择建议",
|
||||
"select": "选择",
|
||||
"difficulty": "难度"
|
||||
},
|
||||
"grading": {
|
||||
"title": "AI 批改建议",
|
||||
"suggestedScore": "建议分数",
|
||||
"confidence": "置信度",
|
||||
"feedback": "反馈",
|
||||
"reasoning": "评分依据",
|
||||
"applyScore": "应用分数",
|
||||
"applyFeedback": "应用反馈",
|
||||
"loading": "AI 批改中...",
|
||||
"error": "AI 批改失败",
|
||||
"notAvailable": "此题型不支持 AI 批改"
|
||||
},
|
||||
"errorBook": {
|
||||
"similarQuestions": "相似题目",
|
||||
"weaknessAnalysis": "薄弱点分析",
|
||||
"studyPlan": "学习计划",
|
||||
"recommendedResources": "推荐资源",
|
||||
"weakAreas": "薄弱领域",
|
||||
"severity": {
|
||||
"high": "高",
|
||||
"medium": "中",
|
||||
"low": "低"
|
||||
}
|
||||
},
|
||||
"lessonPrep": {
|
||||
"generateContent": "生成内容",
|
||||
"generateActivity": "建议活动",
|
||||
"generateAssessment": "生成评估",
|
||||
"generateQuestion": "生成讨论题",
|
||||
"loading": "生成中...",
|
||||
"error": "内容生成失败"
|
||||
},
|
||||
"exam": {
|
||||
"generate": "生成",
|
||||
"generating": "生成中...",
|
||||
"preview": "预览",
|
||||
"queue": "加入队列",
|
||||
"queueRunning": "运行中",
|
||||
"queueQueued": "排队中",
|
||||
"backgroundTasks": "后台任务",
|
||||
"taskStatus": {
|
||||
"queued": "排队中",
|
||||
"running": "生成中",
|
||||
"success": "已完成",
|
||||
"failed": "失败"
|
||||
},
|
||||
"openPreview": "打开预览",
|
||||
"sourceText": "试卷原文",
|
||||
"sourceTextPlaceholder": "粘贴试卷文本以解析为题目",
|
||||
"sourceTextDesc": "AI 将从文本中提取题目和结构。",
|
||||
"generationTitle": "AI 生成",
|
||||
"generationDesc": "粘贴试卷文本并生成结构化预览。"
|
||||
},
|
||||
"error": {
|
||||
"invalidInput": "输入数据无效",
|
||||
"chatFailed": "AI 请求失败",
|
||||
"suggestionFailed": "AI 建议失败",
|
||||
"gradingFailed": "AI 批改失败",
|
||||
"contentFailed": "内容生成失败",
|
||||
"variantFailed": "题目变体生成失败",
|
||||
"analysisFailed": "薄弱点分析失败",
|
||||
"boundaryTitle": "AI 功能错误",
|
||||
"boundaryDescription": "处理 AI 请求时发生错误,请重试。",
|
||||
"retry": "重试",
|
||||
"unauthorized": "您没有使用 AI 功能的权限",
|
||||
"providerNotConfigured": "AI 服务商未配置,请联系管理员。"
|
||||
},
|
||||
"capability": {
|
||||
"chat": "AI 对话",
|
||||
"examGenerate": "AI 出题",
|
||||
"gradingAssist": "AI 辅助批改",
|
||||
"lessonContent": "AI 备课内容",
|
||||
"questionVariant": "AI 题目变体",
|
||||
"similarQuestion": "AI 相似题",
|
||||
"weaknessAnalysis": "AI 薄弱点分析"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user