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') }}
+
+
+
diff --git a/frontend/src/features/admin/modules/agents/composables/useAgentsAdmin.ts b/frontend/src/features/admin/modules/agents/composables/useAgentsAdmin.ts
index c44fbef8..498d08c0 100644
--- a/frontend/src/features/admin/modules/agents/composables/useAgentsAdmin.ts
+++ b/frontend/src/features/admin/modules/agents/composables/useAgentsAdmin.ts
@@ -24,6 +24,9 @@ import {
} from '@/features/admin/api/admin.api';
import { listAdminSchedules } from '@/features/admin/api/schedule.api';
import { useMessage } from '@/shared/composables/useMessage';
+import {
+ resolveTrainingRoleChatQuestions,
+} from '@/features/chat/training/trainingChatQuestions';
import type { AdminUserRow } from '@/features/admin/types/admin.types';
import type {
AgentFormState,
@@ -115,21 +118,30 @@ const parseTrainingConfigFromExtra = (extra: Record
| undefined
const hasTrainingContent = questionBank.length > 0
|| Boolean(toMultilineText(merged.summary_points ?? merged.summaryPoints))
|| Boolean(toMultilineText(merged.summary_checklist ?? merged.summaryChecklist));
+ const workspaceEnabled =
+ extra?.training_workspace_enabled === true
+ || extra?.training_workspace_enabled === 'true'
+ || extra?.training_mode === true
+ || extra?.training_mode === 'true'
+ || extra?.training_agent === true
+ || extra?.training_agent === 'true'
+ || hasTrainingContent;
+ const employeeQuestions = resolveTrainingRoleChatQuestions(extra, 'employee');
+ const hrQuestions = resolveTrainingRoleChatQuestions(extra, 'hr');
return {
- training_workspace_enabled:
- extra?.training_workspace_enabled === true
- || extra?.training_workspace_enabled === 'true'
- || extra?.training_mode === true
- || extra?.training_mode === 'true'
- || extra?.training_agent === true
- || extra?.training_agent === 'true'
- || hasTrainingContent,
+ training_workspace_enabled: workspaceEnabled,
training_pass_score: Number.isFinite(Number(merged.pass_score ?? merged.passScore))
? Math.max(0, Math.min(100, Math.round(Number(merged.pass_score ?? merged.passScore))))
: 90,
training_summary_points_text: toMultilineText(merged.summary_points ?? merged.summaryPoints),
training_summary_checklist_text: toMultilineText(merged.summary_checklist ?? merged.summaryChecklist),
+ training_employee_chat_questions_text: employeeQuestions.configured || workspaceEnabled
+ ? toMultilineText(employeeQuestions.questions)
+ : '',
+ training_hr_chat_questions_text: hrQuestions.configured || workspaceEnabled
+ ? toMultilineText(hrQuestions.questions)
+ : '',
training_question_bank: questionBank,
};
};
@@ -170,6 +182,8 @@ const hasTrainingConfigContent = (form: AgentFormState) => (
form.training_workspace_enabled
|| Boolean(form.training_summary_points_text.trim())
|| Boolean(form.training_summary_checklist_text.trim())
+ || Boolean(form.training_employee_chat_questions_text.trim())
+ || Boolean(form.training_hr_chat_questions_text.trim())
|| form.training_question_bank.length > 0
);
@@ -461,6 +475,8 @@ export function useAgentsAdmin() {
pass_score: Math.max(0, Math.min(100, Math.round(Number(form.value.training_pass_score) || 90))),
summary_points: splitMultilineText(form.value.training_summary_points_text),
summary_checklist: splitMultilineText(form.value.training_summary_checklist_text),
+ employee_chat_suggested_questions: splitMultilineText(form.value.training_employee_chat_questions_text),
+ hr_chat_suggested_questions: splitMultilineText(form.value.training_hr_chat_questions_text),
question_bank: form.value.training_question_bank.map((question, index) => buildTrainingQuestionPayload(question, index)),
};
} else {
diff --git a/frontend/src/features/admin/types/agent.types.ts b/frontend/src/features/admin/types/agent.types.ts
index 4722b4dc..99060b53 100644
--- a/frontend/src/features/admin/types/agent.types.ts
+++ b/frontend/src/features/admin/types/agent.types.ts
@@ -109,6 +109,8 @@ export interface AgentFormState {
training_pass_score: number;
training_summary_points_text: string;
training_summary_checklist_text: string;
+ training_employee_chat_questions_text: string;
+ training_hr_chat_questions_text: string;
training_question_bank: AgentTrainingQuestionFormItem[];
}
@@ -163,5 +165,7 @@ export const createEmptyAgentForm = (
training_pass_score: 90,
training_summary_points_text: '',
training_summary_checklist_text: '',
+ training_employee_chat_questions_text: '',
+ training_hr_chat_questions_text: '',
training_question_bank: [],
});
diff --git a/frontend/src/features/chat/components/ChatMessageList.vue b/frontend/src/features/chat/components/ChatMessageList.vue
index e0e49848..d4e5e7df 100644
--- a/frontend/src/features/chat/components/ChatMessageList.vue
+++ b/frontend/src/features/chat/components/ChatMessageList.vue
@@ -26,6 +26,7 @@ const {
suggestedQuestionsStyle: 'plain' | 'styled';
styledSections: WelcomeQuestionSection[];
suggestedQuestions: WelcomeQuestionItem[];
+ hideWelcomeTitle?: boolean;
showThinkingBubble: boolean;
isThinking: boolean;
showChatRating: boolean;
@@ -104,6 +105,7 @@ const isLatestAssistantMessage = (items: ChatMessage[], index: number) => {
:suggested-questions-style="suggestedQuestionsStyle"
:styled-sections="styledSections"
:suggested-questions="suggestedQuestions"
+ :hide-title="hideWelcomeTitle"
@select-question="emit('select-question', $event)"
/>
diff --git a/frontend/src/features/chat/components/ChatViewContent.vue b/frontend/src/features/chat/components/ChatViewContent.vue
index 30d560e7..114aef09 100644
--- a/frontend/src/features/chat/components/ChatViewContent.vue
+++ b/frontend/src/features/chat/components/ChatViewContent.vue
@@ -45,7 +45,8 @@ const embeddedIframeSrc = computed(() => {
return url ? String(url) : undefined;
});
const canManageMaintenance = computed(() => ['admin', 'maintenance_manager'].includes(String(page.currentUser?.role || '')));
-const hideWelcomePanel = computed(() => isTrainingAgentPage.value);
+const hideWelcomePanel = computed(() => false);
+const hideWelcomeTitle = computed(() => isTrainingAgentPage.value);
const isTrainingWorkspaceExpanded = ref(false);
const maintenancePanel = ref<'ledger' | 'record' | null>(null);
const maintenanceEditRecord = ref(null);
@@ -243,6 +244,7 @@ watch(() => page.currentAgentId, () => {
:tool-run-progress-title="page.toolRunProgressTitle"
:show-scroll-to-bottom="page.showScrollToBottom"
:hide-welcome-panel="hideWelcomePanel"
+ :hide-welcome-title="hideWelcomeTitle"
:pin-messages-to-bottom="!isTrainingAgentPage"
:scroll-container-holder="page.scrollContainerHolder"
@copy="page.copyToClipboard($event.message, $event.index)"
diff --git a/frontend/src/features/chat/components/ChatWelcomePanel.vue b/frontend/src/features/chat/components/ChatWelcomePanel.vue
index 92515eb5..a52bfde0 100644
--- a/frontend/src/features/chat/components/ChatWelcomePanel.vue
+++ b/frontend/src/features/chat/components/ChatWelcomePanel.vue
@@ -23,6 +23,7 @@ const props = defineProps<{
suggestedQuestionsStyle: 'plain' | 'styled';
styledSections: WelcomeQuestionSection[];
suggestedQuestions: WelcomeQuestionItem[];
+ hideTitle?: boolean;
}>();
const emit = defineEmits<{
@@ -32,18 +33,19 @@ const emit = defineEmits<{
const { t } = useI18n();
const displayAgentName = computed(() => props.agentName || t('chat.assistantLabel'));
+const shouldShowTitle = computed(() => !props.hideTitle);
-
+
{{ $t('chat.welcomeAgentTitlePrefix') }}
{{ displayAgentName }}
{{ $t('chat.welcomeAgentTitleSuffix') }}
-
+
props.agentName || t('chat.assistantLabe
-
+
{{ $t('chat.welcomeAgentTitlePrefix') }}
{{ displayAgentName }}
{{ $t('chat.welcomeAgentTitleSuffix') }}
-
+