feat(training): 培训配置改造
This commit is contained in:
1 parent
d21c83433e
commit
15225ef1ce
15 files changed
+602
-56
No files matched your search
@@ -2,7 +2,8 @@
|
||||
* features/chat/composables/useTrainingWorkspace.ts
|
||||
* 用途:封装员工培训 Agent 的工作区状态,包括学员考试流、进度持久化与 HR 真实统计导出。
|
||||
* 依赖:Vue reactivity、vue-i18n、training.api,以及 training.types。
|
||||
* 逻辑:仅在培训 Agent 下启用;学员端按“视频 -> 知识点 -> 一题一答 -> 结算”推进,并把进度同步到后端,聊天区只保留问答能力。
|
||||
* 逻辑:仅在培训 Agent 下启用;学员端按“视频 -> 知识点 -> 一题一答 -> 结算”推进,并把进度同步到后端;
|
||||
* 非安全培训页额外按后台配置动态渲染进度项与步骤说明文案。
|
||||
*/
|
||||
import { computed, ref, watch, type ComputedRef } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -39,6 +40,8 @@ import type {
|
||||
import {
|
||||
SAFETY_STAGE_GUIDE_USAGE_MAP,
|
||||
matchesTrainingAgent,
|
||||
resolveLearnerCopyText,
|
||||
resolveLearnerProgressItems,
|
||||
resolveTrainingContentConfig,
|
||||
resolveSafetyTrainingVideoGuide,
|
||||
type TrainingGuideLike,
|
||||
@@ -269,6 +272,9 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
const value = (summaries as Record<string, unknown>)[safetyViewStage.value];
|
||||
return Array.isArray(value) ? value.map((item) => String(item)) : [];
|
||||
});
|
||||
const learnerProgressItems = computed(() => resolveLearnerProgressItems(publishedConfig.value));
|
||||
const learnerProgressHintText = computed(() => resolveLearnerCopyText(publishedConfig.value, 'progress_hint_text'));
|
||||
const learnerStepIntroText = computed(() => resolveLearnerCopyText(publishedConfig.value, 'step_intro_text'));
|
||||
|
||||
const currentQuestion = computed(() => questionBank.value[currentQuestionIndex.value] || null);
|
||||
const totalQuestionCount = computed(() => questionBank.value.length);
|
||||
@@ -1159,6 +1165,9 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
hasPublishedTrainingConfig,
|
||||
publishedTrainingMaterials,
|
||||
publishedSafetySummary,
|
||||
learnerProgressItems,
|
||||
learnerProgressHintText,
|
||||
learnerStepIntroText,
|
||||
activeView,
|
||||
learnerTab,
|
||||
trainingTypes,
|
||||
|
||||
Reference in new issue
Block a user