From 3bf24ce319580fd24fa02afd3997e6b2b46c1535 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Sat, 9 May 2026 03:29:20 -0600 Subject: [PATCH] update --- src/oj/problem/components/SubmitFlowchart.vue | 25 ++++++- .../components/FlowchartScoreDetail.vue | 74 +++++-------------- 2 files changed, 40 insertions(+), 59 deletions(-) diff --git a/src/oj/problem/components/SubmitFlowchart.vue b/src/oj/problem/components/SubmitFlowchart.vue index 74d6e66..dfa8e7b 100644 --- a/src/oj/problem/components/SubmitFlowchart.vue +++ b/src/oj/problem/components/SubmitFlowchart.vue @@ -71,6 +71,18 @@ const evaluation = ref({ criteria_details: {}, }) const page = ref(1) +const suggestionLines = computed(() => + splitSuggestionLines(evaluation.value.suggestions), +) + +function splitSuggestionLines(suggestions?: string | null) { + return suggestions + ? suggestions + .split("\n") + .map((suggestion) => suggestion.trim()) + .filter(Boolean) + : [] +} // ==================== WebSocket 相关函数 ==================== // 处理 WebSocket 消息 @@ -306,7 +318,7 @@ onUnmounted(() => { - + { - {{ evaluation.suggestions }} + + + {{ suggestion }} + + diff --git a/src/oj/submission/components/FlowchartScoreDetail.vue b/src/oj/submission/components/FlowchartScoreDetail.vue index 800d0c5..a457581 100644 --- a/src/oj/submission/components/FlowchartScoreDetail.vue +++ b/src/oj/submission/components/FlowchartScoreDetail.vue @@ -43,24 +43,19 @@ -
-
+ - - 重点 - - {{ item.text }} -
-
+ {{ suggestion }} + +
@@ -120,30 +115,18 @@ const submission = ref(null) const loading = ref(false) const rendering = ref(false) const showLargeImage = ref(false) +const suggestionLines = computed(() => + splitSuggestionLines(submission.value?.ai_suggestions), +) -const suggestionItems = computed(() => { - const suggestions = submission.value?.ai_suggestions ?? "" - +function splitSuggestionLines(suggestions?: string | null) { return suggestions - .split(/\r?\n/) - .flatMap((line) => line.split(/(?=【重点】)/)) - .map((raw) => raw.trim()) - .filter(Boolean) - .map((raw) => { - const textWithoutBullet = raw - .replace(/^(?:[-*]\s*|\d+[.)、]\s*)/, "") - .trim() - const important = textWithoutBullet.startsWith("【重点】") - const text = important - ? textWithoutBullet.replace(/^【重点】\s*/, "").trim() - : textWithoutBullet - - return { - important, - text: text || textWithoutBullet, - } - }) -}) + ? suggestions + .split("\n") + .map((suggestion) => suggestion.trim()) + .filter(Boolean) + : [] +} function getPercentType(percent: number) { if (percent >= 0.8) return "primary" @@ -199,25 +182,4 @@ watch(() => props.submissionId, loadSubmission, { immediate: true }) justify-content: center; align-items: center; } - -.suggestion-list { - display: flex; - flex-direction: column; - gap: 8px; -} - -.suggestion-item { - display: flex; - align-items: flex-start; - gap: 8px; - padding: 8px 10px; - border-radius: 6px; - background: var(--n-color); - line-height: 1.6; -} - -.suggestion-item--important { - border: 1px solid var(--n-warning-color); - background: var(--n-warning-color-suppl); -}