From 8ea2dd38d75c12083ac043194880088d3478d25c Mon Sep 17 00:00:00 2001 From: brianling Date: Thu, 16 Jul 2026 07:05:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=86=85=E8=81=94=E6=98=BE=E7=A4=BA=E5=9C=A8=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ResultDrawer.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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; }