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-26 02:19:39 -06:00
parent bf69a355fe
commit 714e07d514
4 changed files with 11 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ function filterResult(result: Problem) {
author: result.created_by.username, author: result.created_by.username,
allow_flowchart: result.allow_flowchart, allow_flowchart: result.allow_flowchart,
show_flowchart: result.show_flowchart, show_flowchart: result.show_flowchart,
has_ast_rules: result.has_ast_rules,
} }
if (result.my_status === null || result.my_status === undefined) { if (result.my_status === null || result.my_status === undefined) {
newResult.status = "not_test" newResult.status = "not_test"

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ProblemFiltered } from "utils/types" import type { ProblemFiltered } from "utils/types"
import { Icon } from "@iconify/vue" import { Icon } from "@iconify/vue"
defineProps<{ defineProps<{
@@ -19,5 +19,10 @@ defineProps<{
width="18" width="18"
icon="vscode-icons:file-type-graphql" icon="vscode-icons:file-type-graphql"
/> />
<Icon
v-if="problem.has_ast_rules"
width="18"
icon="vscode-icons:file-type-light-todo"
/>
</n-flex> </n-flex>
</template> </template>

View File

@@ -45,6 +45,7 @@ const sortOptions = [
{ label: "最多通过", value: "-accepted_number" }, { label: "最多通过", value: "-accepted_number" },
{ label: "最少通过", value: "accepted_number" }, { label: "最少通过", value: "accepted_number" },
{ label: "画流程图", value: "flowchart" }, { label: "画流程图", value: "flowchart" },
{ label: "语法检查", value: "ast" },
] ]
const router = useRouter() const router = useRouter()
@@ -240,6 +241,7 @@ function rowProps(row: ProblemFiltered) {
style="width: 120px" style="width: 120px"
v-model:value="query.sort" v-model:value="query.sort"
:options="sortOptions" :options="sortOptions"
:dropdown-style="{ maxHeight: 'unset' }"
/> />
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>

View File

@@ -138,6 +138,7 @@ export interface Problem {
flowchart_hint?: string flowchart_hint?: string
show_flowchart?: boolean show_flowchart?: boolean
ast_rules?: { [key: string]: { engine: string; target?: string; min?: number; max?: number; message: string }[] } | null ast_rules?: { [key: string]: { engine: string; target?: string; min?: number; max?: number; message: string }[] } | null
has_ast_rules?: boolean
} }
export type AdminProblem = Problem & AlterProblem export type AdminProblem = Problem & AlterProblem
@@ -175,6 +176,7 @@ export interface ProblemFiltered {
author: string author: string
allow_flowchart: boolean allow_flowchart: boolean
show_flowchart: boolean show_flowchart: boolean
has_ast_rules: boolean
} }
export interface AdminProblemFiltered { export interface AdminProblemFiltered {