update
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-05-25 22:24:56 -06:00
parent 11e447d4b7
commit 3a33c8ff3a
5 changed files with 25 additions and 9 deletions

View File

@@ -289,7 +289,7 @@ function type(status: ProblemStatus) {
<n-list bordered style="margin-bottom: 8px">
<n-list-item v-for="(rule, i) in rules" :key="i">
<n-flex align="center">
<n-tag size="small" :type="ruleTagType(rule.engine)">
<n-tag :type="ruleTagType(rule.engine)">
{{ ruleDescription(rule) }}
</n-tag>
<span v-if="rule.message" class="rule-message">{{ rule.message }}</span>

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import { Icon } from "@iconify/vue"
import { useThemeVars } from "naive-ui"
import { JUDGE_STATUS, SubmissionStatus } from "utils/constants"
import {
getCSRFToken,
@@ -19,6 +21,7 @@ const props = defineProps<{
const isDark = useDark()
const problemStore = useProblemStore()
const theme = useThemeVars()
// AI 提示状态
const hintContent = ref("")
@@ -40,11 +43,7 @@ const msg = computed(() => {
msg += "请仔细检查,看看代码的格式是不是写错了!\n\n"
}
if (result === SubmissionStatus.ast_check_failed) {
msg += "你的答案是正确的,但是代码结构不符合要求:\n\n"
}
if (props.submission.statistic_info?.err_info) {
if (result !== SubmissionStatus.ast_check_failed && props.submission.statistic_info?.err_info) {
msg += props.submission.statistic_info.err_info
}
@@ -154,7 +153,22 @@ const columns: DataTableColumn<Submission["info"]["data"][number]>[] = [
:title="JUDGE_STATUS[submission.result]['name']"
class="mb-3"
/>
<n-flex vertical v-if="msg || infoTable.length">
<n-flex vertical v-if="msg || infoTable.length || submission.statistic_info?.ast_results?.length">
<n-card v-if="submission.statistic_info?.ast_results?.length" embedded>
<n-flex vertical :size="8">
<n-flex
v-for="(rule, i) in submission.statistic_info.ast_results"
:key="i"
align="center"
:size="6"
>
<n-icon :color="rule.passed ? theme.successColor : theme.errorColor">
<Icon :icon="rule.passed ? 'ep:select' : 'ep:close-bold'" />
</n-icon>
<span>{{ rule.description }}</span>
</n-flex>
</n-flex>
</n-card>
<n-card v-if="msg" embedded class="msg">{{ msg }}</n-card>
<n-data-table
v-if="infoTable.length"

View File

@@ -72,6 +72,7 @@ const selectedFlowchart = computed(() => {
const resultOptions: SelectOption[] = [
{ label: "全部", value: "" },
{ label: "答案正确", value: "0" },
{ label: "语法未通过", value: "10" },
{ label: "答案错误", value: "-1" },
{ label: "编译失败", value: "-2" },
{ label: "运行时错误", value: "4" },

View File

@@ -82,8 +82,8 @@ export const JUDGE_STATUS: {
type: "info",
},
"10": {
name: "代码检查未通过",
type: "warning",
name: "语法未通过",
type: "success",
},
}

View File

@@ -390,6 +390,7 @@ export interface Submission {
err_info?: string
time_cost?: number
memory_cost?: number
ast_results?: Array<{ description: string; passed: boolean }>
}
ip: string
contest: number