update
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
getFlowchartSubmissions,
|
getFlowchartSubmissions,
|
||||||
getSubmissions,
|
getSubmissions,
|
||||||
getTodaySubmissionCount,
|
getTodaySubmissionCount,
|
||||||
|
retryFlowchartSubmission,
|
||||||
} from "oj/api"
|
} from "oj/api"
|
||||||
import { parseTime } from "utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import type {
|
import type {
|
||||||
@@ -150,6 +151,12 @@ async function rejudge(submissionID: string) {
|
|||||||
listSubmissions()
|
listSubmissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function retryFlowchart(submissionId: string) {
|
||||||
|
await retryFlowchartSubmission(submissionId)
|
||||||
|
message.success("重新评分已提交")
|
||||||
|
listSubmissions()
|
||||||
|
}
|
||||||
|
|
||||||
function problemClicked(row: SubmissionListItem | FlowchartSubmissionListItem) {
|
function problemClicked(row: SubmissionListItem | FlowchartSubmissionListItem) {
|
||||||
if (route.name === "contest submissions") {
|
if (route.name === "contest submissions") {
|
||||||
const path = router.resolve({
|
const path = router.resolve({
|
||||||
@@ -300,61 +307,81 @@ const columns = computed(() => {
|
|||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
|
|
||||||
const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
const flowchartColumns = computed(() => {
|
||||||
{
|
const res: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
||||||
title: renderTableTitle("提交时间", "noto:seven-oclock"),
|
{
|
||||||
key: "create_time",
|
title: renderTableTitle("提交时间", "noto:seven-oclock"),
|
||||||
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
key: "create_time",
|
||||||
},
|
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
||||||
{
|
},
|
||||||
title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"),
|
{
|
||||||
key: "id",
|
title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"),
|
||||||
render: (row) =>
|
key: "id",
|
||||||
h(FlowchartLink, {
|
render: (row) =>
|
||||||
flowchart: row,
|
h(FlowchartLink, {
|
||||||
onShowDetail: (id: string) => showScoreDetail(id),
|
flowchart: row,
|
||||||
}),
|
onShowDetail: (id: string) => showScoreDetail(id),
|
||||||
},
|
}),
|
||||||
{
|
},
|
||||||
title: renderTableTitle("题目", "streamline-emojis:blossom"),
|
{
|
||||||
key: "problem_title",
|
title: renderTableTitle("题目", "streamline-emojis:blossom"),
|
||||||
render: (row) =>
|
key: "problem_title",
|
||||||
h(
|
render: (row) =>
|
||||||
ButtonWithSearch,
|
h(
|
||||||
{
|
ButtonWithSearch,
|
||||||
type: "题目",
|
{
|
||||||
onClick: () => problemClicked(row),
|
type: "题目",
|
||||||
onSearch: () => (query.problem = row.problem),
|
onClick: () => problemClicked(row),
|
||||||
},
|
onSearch: () => (query.problem = row.problem),
|
||||||
() => `${row.problem} ${row.problem_title}`,
|
},
|
||||||
|
() => `${row.problem} ${row.problem_title}`,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: renderTableTitle("评分", "streamline-emojis:bar-chart"),
|
||||||
|
key: "ai_score",
|
||||||
|
render: (row) => h(Grade, { score: row.ai_score, grade: row.ai_grade }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: renderTableTitle(
|
||||||
|
"用户",
|
||||||
|
"streamline-emojis:smiling-face-with-sunglasses",
|
||||||
),
|
),
|
||||||
},
|
key: "username",
|
||||||
{
|
minWidth: 200,
|
||||||
title: renderTableTitle("评分", "streamline-emojis:bar-chart"),
|
render: (row) =>
|
||||||
key: "ai_score",
|
h(
|
||||||
render: (row) => h(Grade, { score: row.ai_score, grade: row.ai_grade }),
|
ButtonWithSearch,
|
||||||
},
|
{
|
||||||
{
|
type: "用户",
|
||||||
title: renderTableTitle(
|
username: row.username,
|
||||||
"用户",
|
onClick: () => window.open("/user?name=" + row.username, "_blank"),
|
||||||
"streamline-emojis:smiling-face-with-sunglasses",
|
onSearch: () => (query.username = row.username),
|
||||||
),
|
onFilterClass: (classname: string) => (query.username = classname),
|
||||||
key: "username",
|
},
|
||||||
minWidth: 200,
|
() => row.username,
|
||||||
render: (row) =>
|
),
|
||||||
h(
|
},
|
||||||
ButtonWithSearch,
|
]
|
||||||
{
|
if (!route.params.contestID && userStore.isTeacherOrAbove) {
|
||||||
type: "用户",
|
res.push({
|
||||||
username: row.username,
|
title: renderTableTitle("选项", "streamline-emojis:wrench"),
|
||||||
onClick: () => window.open("/user?name=" + row.username, "_blank"),
|
key: "retry",
|
||||||
onSearch: () => (query.username = row.username),
|
render: (row) =>
|
||||||
onFilterClass: (classname: string) => (query.username = classname),
|
h(
|
||||||
},
|
NButton,
|
||||||
() => row.username,
|
{
|
||||||
),
|
quaternary: true,
|
||||||
},
|
size: "small",
|
||||||
]
|
type: "primary",
|
||||||
|
onClick: () => retryFlowchart(row.id),
|
||||||
|
},
|
||||||
|
() => "重新判题",
|
||||||
|
),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<n-flex vertical size="large">
|
<n-flex vertical size="large">
|
||||||
|
|||||||
Reference in New Issue
Block a user