From f1b9b7c3a961321d871a4af15f21390b5101074e Mon Sep 17 00:00:00 2001 From: "DESKTOP-JKIE562\\PC" <1013397054@qq.com> Date: Thu, 9 Jul 2026 14:01:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(training-workspace):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=91=98=E5=B7=A5=E5=9F=B9=E8=AE=AD=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8C=BA=E4=B8=8E=E8=A7=92=E8=89=B2=E5=8C=96=E5=B8=B8=E8=A7=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/funclist.md | 1 + .../agents/components/AgentFormModal.vue | 33 ++++++++ .../agents/composables/useAgentsAdmin.ts | 32 ++++++-- .../src/features/admin/types/agent.types.ts | 4 + .../chat/components/ChatMessageList.vue | 2 + .../chat/components/ChatViewContent.vue | 4 +- .../chat/components/ChatWelcomePanel.vue | 12 +-- .../components/TrainingWorkspacePanel.vue | 5 +- .../features/chat/composables/useChatAgent.ts | 27 ++++--- .../features/chat/composables/useChatPage.ts | 2 +- .../chat/training/trainingChatQuestions.ts | 79 +++++++++++++++++++ frontend/src/locales/en/admin.json | 6 ++ frontend/src/locales/th/admin.json | 6 ++ frontend/src/locales/zh-CN/admin.json | 6 ++ frontend/src/locales/zh-TW/admin.json | 6 ++ 15 files changed, 199 insertions(+), 26 deletions(-) create mode 100644 frontend/src/features/chat/training/trainingChatQuestions.ts diff --git a/docs/funclist.md b/docs/funclist.md index a44e8872..d4a41f4d 100644 --- a/docs/funclist.md +++ b/docs/funclist.md @@ -28,6 +28,7 @@ | Chat 内培训工作区 | 前端已实现 | 在培训 Agent 聊天页顶部提供视频学习、知识点复盘、逐题考试、成绩结算的一体化工作区 | | Chat 内 HR 管理面板 | 已实现 | 仅具备培训 HR 管理权限的用户可在同一聊天页查看真实培训统计、筛选记录并导出 Excel;权限支持角色默认值与前端用户配置共同控制 | | 培训题库后台配置 | 已实现 | Agent 管理表单支持维护及格线、复盘要点、考前清单与题库;员工培训页优先读取 `extra_config.training_config`,未配置时才回退前端默认题库 | +| 培训聊天常见问题分角色配置 | 已实现 | Agent 管理表单支持分别维护普通员工与 HR 管理员进入“员工培训”聊天页时看到的常见问题;聊天欢迎区会按 `training_hr_manage` 权限自动切换对应问题集 | | 管理端培训模式配置 | 已实现 | Agent 管理表单支持显式开启培训工作区;平台应用说明页支持上传并标记“员工培训视频 / 员工培训试题 PDF”,并可直接把试题 PDF 解析导入题库表单;扫描件 PDF 在 OCR 依赖齐备时也可回退识别 | | 首页培训推荐入口 | 前端已实现 | 当 Agent 开启培训模式后,工作台首页会在应用列表上方展示培训强入口卡片 | | 培训记录后端落库 | 已实现 | 已新增培训记录模型、迁移与用户/管理端 API,考试进度、结果、统计与导出均可走后端数据源 | diff --git a/frontend/src/features/admin/modules/agents/components/AgentFormModal.vue b/frontend/src/features/admin/modules/agents/components/AgentFormModal.vue index d7696e28..3cc6f27c 100644 --- a/frontend/src/features/admin/modules/agents/components/AgentFormModal.vue +++ b/frontend/src/features/admin/modules/agents/components/AgentFormModal.vue @@ -14,6 +14,10 @@ import type { AgentFormState, AgentGuideSummary } from '@/features/admin/types/a import type { ScheduleTask } from '@/shared/types/schedule.types'; import type { AgentTypeCatalogEntry, IntentRouteOption } from '../composables/useAgentsAdminRegistry'; import type { AdminContentProfileOption } from '@/features/admin/api/admin.api'; +import { + DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS, + DEFAULT_TRAINING_HR_CHAT_QUESTIONS, +} from '@/features/chat/training/trainingChatQuestions'; import { applyCatalogDefaultsToForm, applyContentProfileTemplate, @@ -138,6 +142,12 @@ const applySelectedContentProfileTemplate = (force = false) => { const handleTrainingWorkspaceToggle = () => { if (props.form.training_workspace_enabled) { props.form.content_profile = 'training'; + if (!props.form.training_employee_chat_questions_text.trim()) { + props.form.training_employee_chat_questions_text = DEFAULT_TRAINING_EMPLOYEE_CHAT_QUESTIONS.join('\n'); + } + if (!props.form.training_hr_chat_questions_text.trim()) { + props.form.training_hr_chat_questions_text = DEFAULT_TRAINING_HR_CHAT_QUESTIONS.join('\n'); + } } else if (props.form.content_profile === 'training') { props.form.content_profile = ''; } @@ -565,6 +575,29 @@ const handleTrainingQuestionTypeChange = (form: AgentFormState, index: number) = +
{{ t('admin.agent.training.employeeChatQuestionsHint') }}
+{{ t('admin.agent.training.hrChatQuestionsHint') }}
+