+
还可以更好
{{ detail.aiSuggestions }}
@@ -556,15 +573,26 @@ function goCode() {
margin-bottom: 12px;
}
-.tip {
+.review {
margin: 0 0 14px;
padding: 10px 12px;
border-radius: 6px;
- background-color: rgba(128, 128, 128, 0.08);
+ background: v-bind("tone('error').background");
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
font-size: 14px;
line-height: 1.7;
}
+.review-title {
+ font-weight: 600;
+}
+
+.review p {
+ margin: 2px 0 0;
+}
+
.better {
margin-bottom: 14px;
font-size: 14px;
diff --git a/apps/web/src/oj/submission/components/FlowchartPane.vue b/apps/web/src/oj/submission/components/FlowchartPane.vue
index 67b4830..b217485 100644
--- a/apps/web/src/oj/submission/components/FlowchartPane.vue
+++ b/apps/web/src/oj/submission/components/FlowchartPane.vue
@@ -89,6 +89,14 @@ async function load() {
detail.value = res
await nextTick()
await renderFlowchart(graph.value, res.mermaidCode)
+ markFocus(graph.value)
+}
+
+/** AI 指出的要改的那个框标红。pele 把 Mermaid 的框号放在节点
的 data-id 上 */
+function markFocus(el: HTMLElement | null) {
+ const focus = report.value?.focus
+ if (!el || !focus) return
+ el.querySelector(`.pele-node[data-id="${focus}"]`)?.classList.add("oj-focus")
}
// 分开写三个来源:列表每次轮询都换一批新的行对象,一个 getter 返回数组的话回调次次都跑
@@ -100,6 +108,7 @@ watch(bigOpen, async (open) => {
if (!open || !detail.value) return
await nextTick()
await renderFlowchart(bigGraph.value, detail.value.mermaidCode)
+ markFocus(bigGraph.value)
})
const shown = computed(() => (detail.value?.id === props.row.id ? detail.value : null))
@@ -129,6 +138,7 @@ function barColor(score: number, max: number) {
/** 2026-10 起的「走例子」报告;老提交是 null,照旧显示四项分 */
const report = computed(() => caseReport(shown.value?.aiCriteriaDetails))
+const allPassed = computed(() => !!report.value && report.value.passed === report.value.total)
const openCase = ref(null)
watch(
() => shown.value?.id,
@@ -258,9 +268,19 @@ const canRetry = computed(
{{ caseHeadline(report) }}
+
+
+
+
哪里错了
+
{{ shown.aiFeedback }}
+
+
+
可以这样改
+
{{ shown.aiSuggestions }}
+
+
- {{ shown.aiFeedback }}
-
+
还可以更好:
{{ shown.aiSuggestions }}
@@ -521,6 +541,29 @@ const canRetry = computed(
font-size: 16px;
}
+/* 要改的框:压过 useMermaid 里按框类型上的色(那边也是 !important) */
+.graph :deep(.pele-node.oj-focus > :not(text)),
+.big-graph :deep(.pele-node.oj-focus > :not(text)) {
+ fill: v-bind("tone('error').background") !important;
+ stroke: v-bind("tone('error').solid") !important;
+ stroke-width: 3px !important;
+}
+
+.review {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ padding: 10px 12px;
+ border-radius: 6px;
+ background: v-bind("tone('error').background");
+ font-size: 14px;
+ line-height: 1.7;
+}
+
+.review p {
+ margin: 2px 0 0;
+}
+
.score-box {
flex: 1 1 0;
min-width: 0;
diff --git a/apps/web/src/utils/flowchart.ts b/apps/web/src/utils/flowchart.ts
index 919b79c..c826aa5 100644
--- a/apps/web/src/utils/flowchart.ts
+++ b/apps/web/src/utils/flowchart.ts
@@ -26,6 +26,7 @@ export function caseReport(details: Record
| null | undefined)
passed: cases.filter((row) => row.ok).length,
total: cases.length,
cases,
+ focus: typeof details.focus === "string" ? details.focus : null,
} satisfies FlowchartCaseReport
}
diff --git a/packages/contract/src/flowchart.ts b/packages/contract/src/flowchart.ts
index 9871d81..1703806 100644
--- a/packages/contract/src/flowchart.ts
+++ b/packages/contract/src/flowchart.ts
@@ -151,6 +151,12 @@ export interface FlowchartCaseReport {
passed: number
total: number
cases: FlowchartCaseResult[]
+ /**
+ * 没走对时 AI 对着老师的答案指出的「真正要改的那个框」(Mermaid 编号)。和每组的 wrongAt
+ * 不同:wrongAt 是程序找到的出结果的框,错的根子常常在它前面(判断条件写反了之类)。
+ * 「哪里错 / 怎么改」两句存在提交的 ai_feedback / ai_suggestions 里。2026-10-19 之前的报告没有它
+ */
+ focus?: string | null
}
export const flowchartUpdateSchema = z.object({