feat(training): 打通新人培训真实数据闭环

This commit is contained in:
runny committed 2026-06-30 18:15:02 +08:00
1 parent 3f13bb5b46
commit 19f43e8018
13 files changed
+1144 -162

No files matched your search

@@ -109,7 +109,7 @@ const currentAnswerLabel = computed(() => {
const workspaceExpanded = ref(false);
const autoSyncInitialPrompt = () => {
if (workspace.isTrainingAgent && !props.hasMessages) {
if (workspace.isTrainingAgent && workspace.isHydrated && !props.hasMessages) {
emit('push-local-assistant-message', workspace.learnerChatPrompt);
}
};
@@ -121,16 +121,6 @@ watch(
userExpandedOverride.value = false;
workspaceExpanded.value = false;
emit('update:expanded', false);
// 切换 Agent 后,如果是培训 Agent 且没有消息,立即触发引导
if (workspace.isTrainingAgent && !props.hasMessages) {
// 给予极短延迟确保其它状态同步完成
setTimeout(() => {
if (workspace.isTrainingAgent && !props.hasMessages) {
autoSyncInitialPrompt();
}
}, 300);
}
},
{ immediate: true }
);
@@ -143,6 +133,15 @@ watch(() => props.hasMessages, () => {
}
});
watch(
() => workspace.isHydrated,
(ready) => {
if (ready && workspace.isTrainingAgent && !props.hasMessages) {
autoSyncInitialPrompt();
}
},
);
const isCompactMode = computed(() => !workspaceExpanded.value);
const compactSummary = computed(() => {
@@ -803,7 +802,6 @@ const compactSummary = computed(() => {
</button>
<div class="aspect-video bg-black">
<video
ref="videoPlayer"
controls
autoplay
class="h-full w-full"
@@ -811,7 +809,7 @@ const compactSummary = computed(() => {
@seeking="handleVideoSeeking"
@ended="handleVideoEnded"
>
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<source :src="workspace.videoUrl" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>