From 2d3f94a8b891063eabd771af14892d8b4c2075f9 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 29 Dec 2025 22:42:29 +0800 Subject: [PATCH] fix --- src/oj/problem/components/SubmitFlowchart.vue | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/oj/problem/components/SubmitFlowchart.vue b/src/oj/problem/components/SubmitFlowchart.vue index fb8cfa3..7f55d63 100644 --- a/src/oj/problem/components/SubmitFlowchart.vue +++ b/src/oj/problem/components/SubmitFlowchart.vue @@ -51,7 +51,8 @@ const { renderError, renderFlowchart } = useMermaid() // 状态管理 const rendering = ref(false) const loading = ref(false) -const rating = ref({ score: 0, grade: "" }) +const latestRating = ref({ score: 0, grade: "" }) +const modalRating = ref({ score: 0, grade: "" }) const submissionCount = ref(0) const myFlowchartZippedStr = ref("") const myMermaidCode = ref("") @@ -72,7 +73,7 @@ const handleWebSocketMessage = (data: FlowchartEvaluationUpdate) => { if (data.type === "flowchart_evaluation_completed") { loading.value = false - rating.value = { + latestRating.value = { score: data.score || 0, grade: data.grade || "", } @@ -114,7 +115,7 @@ async function submitFlowchartData(flowchartEditorRef: any) { const compressed = utoa(JSON.stringify(flowchartData)) loading.value = true - rating.value = { score: 0, grade: "" } + latestRating.value = { score: 0, grade: "" } try { const response = await submitFlowchart({ @@ -152,7 +153,7 @@ async function getCurrentSubmission() { if (!problem.value?.id) return const { data } = await getCurrentProblemFlowchartSubmission(problem.value.id) submissionCount.value = data.count - rating.value = { + latestRating.value = { score: data.score, grade: data.grade, } @@ -167,6 +168,10 @@ async function getSubmission(submissionPage = 0) { const submission = data.submission myFlowchartZippedStr.value = submission.flowchart_data.data myMermaidCode.value = submission.mermaid_code || "" + modalRating.value = { + score: submission.ai_score, + grade: submission.ai_grade, + } evaluation.value = { score: submission.ai_score, grade: submission.ai_grade, @@ -262,20 +267,25 @@ onUnmounted(() => { - {{ rating.score }}分 {{ rating.grade }}级 + {{ latestRating.score }}分 {{ latestRating.grade }}级 +