From 315df11b5d6923c93608e01b6fe27007c6a00fe5 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Sat, 9 May 2026 03:12:57 -0600 Subject: [PATCH] styling ai score --- src/oj/problem/components/SubmitFlowchart.vue | 2 +- .../components/FlowchartScoreDetail.vue | 61 ++++++++++++++++++- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/oj/problem/components/SubmitFlowchart.vue b/src/oj/problem/components/SubmitFlowchart.vue index d6304c9..74d6e66 100644 --- a/src/oj/problem/components/SubmitFlowchart.vue +++ b/src/oj/problem/components/SubmitFlowchart.vue @@ -306,7 +306,7 @@ onUnmounted(() => { - + - {{ submission.ai_suggestions }} +
+
+ + 重点 + + {{ item.text }} +
+
@@ -109,6 +121,30 @@ const loading = ref(false) const rendering = ref(false) const showLargeImage = ref(false) +const suggestionItems = computed(() => { + const suggestions = submission.value?.ai_suggestions ?? "" + + 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, + } + }) +}) + function getPercentType(percent: number) { if (percent >= 0.8) return "primary" else if (percent >= 0.6) return "info" @@ -163,4 +199,25 @@ 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); +}