diff --git a/src/components/ResultDrawer.vue b/src/components/ResultDrawer.vue index 6466c17..955196a 100644 --- a/src/components/ResultDrawer.vue +++ b/src/components/ResultDrawer.vue @@ -7,6 +7,7 @@
+
{{ errorMsg }}
上一题 {{ currentIdx + 1 }} / {{ questions.length }} @@ -88,6 +89,7 @@ const settingsStore = useSettingsStore() const visible = ref(false) const isGrading = ref(false) +const errorMsg = ref('') const teacherScore = ref(0) const teacherComment = ref('') const questions = ref([]) @@ -133,6 +135,7 @@ function closeDrawer() { async function gradeAt(idx: number) { if (!gradingStore.currentImage) return isGrading.value = true + errorMsg.value = '' try { const q = questions.value[idx] const result = await window.electronAPI.ai.grade({ @@ -159,7 +162,7 @@ async function gradeAt(idx: number) { }) ElMessage.success(`第 ${idx + 1} 题评分完成`) } catch (err) { - ElMessage.error('评分失败:' + (err as Error).message) + errorMsg.value = (err as Error).message } finally { isGrading.value = false } @@ -333,6 +336,16 @@ async function confirmScore() { border-radius: 6px; white-space: pre-wrap; } +.error-message { + background: #fef0f0; + color: #f56c6c; + border: 1px solid #fde2e2; + border-radius: 6px; + padding: 10px; + font-size: 13px; + line-height: 1.5; + margin-bottom: 12px; +} .teacher-score-input { margin-top: 4px; }