|
|
@@ -45,14 +45,14 @@
|
|
|
<div v-else class="report-stage">
|
|
|
<div class="report-scroll">
|
|
|
<OverallReport
|
|
|
- :evaluation="mockEvaluation"
|
|
|
+ :evaluation="displayEvaluation"
|
|
|
:role="mockRole"
|
|
|
:scoreDisplayMode="'numeric'"
|
|
|
@restart="resetPreview"
|
|
|
@complete="resetPreview"
|
|
|
/>
|
|
|
<div class="report-divider" />
|
|
|
- <DetailedReport :sentenceEvaluations="mockEvaluation.sentenceEvaluations" />
|
|
|
+ <DetailedReport :sentenceEvaluations="displayEvaluation.sentenceEvaluations" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -60,8 +60,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, watch, onMounted, onUnmounted } from 'vue'
|
|
|
-import type { OverallEvaluation, PreviewAIRole, PreviewDialogueState } from '@/types/englishSpeaking'
|
|
|
+import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
|
|
|
+import type { DialogueReport, OverallEvaluation, PreviewAIRole, PreviewDialogueState } from '@/types/englishSpeaking'
|
|
|
import { useSpeakingStore } from '@/store/speaking'
|
|
|
import { getSpeakingConfig } from '@/services/speaking'
|
|
|
|
|
|
@@ -187,16 +187,26 @@ const mockEvaluation: OverallEvaluation = {
|
|
|
],
|
|
|
}
|
|
|
|
|
|
+const realEvaluation = ref<OverallEvaluation | null>(null)
|
|
|
+
|
|
|
+const displayEvaluation = computed<OverallEvaluation>(() => {
|
|
|
+ const real = realEvaluation.value
|
|
|
+ if (real && real.sentenceEvaluations.length > 0) return real
|
|
|
+ return mockEvaluation
|
|
|
+})
|
|
|
+
|
|
|
function startDialogue() {
|
|
|
dialogueState.value = 'chatting'
|
|
|
}
|
|
|
|
|
|
-function handleDialogueComplete() {
|
|
|
+function handleDialogueComplete(report: DialogueReport | null) {
|
|
|
+ realEvaluation.value = report?.evaluation ?? null
|
|
|
dialogueState.value = 'completed'
|
|
|
}
|
|
|
|
|
|
function resetPreview() {
|
|
|
dialogueState.value = 'ready'
|
|
|
+ realEvaluation.value = null
|
|
|
}
|
|
|
|
|
|
// ── Sync with speakingStore (让 CanvasTool 可以驱动"重置预览") ──
|