This commit is contained in:
@@ -47,7 +47,7 @@ async function getList() {
|
|||||||
query.limit,
|
query.limit,
|
||||||
query.keyword,
|
query.keyword,
|
||||||
"",
|
"",
|
||||||
"ACM",
|
"",
|
||||||
)
|
)
|
||||||
total.value = res.total
|
total.value = res.total
|
||||||
problems.value = res.results
|
problems.value = res.results
|
||||||
|
|||||||
@@ -1,8 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<n-tabs animated v-if="submissions.length && flowcharts.length">
|
||||||
|
<n-tab-pane name="代码提交">
|
||||||
|
<n-data-table
|
||||||
|
v-if="submissions.length"
|
||||||
|
striped
|
||||||
|
:data="submissions"
|
||||||
|
:columns="columns"
|
||||||
|
:max-height="isDesktop ? 1500 : 500"
|
||||||
|
/>
|
||||||
|
</n-tab-pane>
|
||||||
|
<n-tab-pane name="流程图提交">
|
||||||
|
<n-data-table
|
||||||
|
v-if="flowcharts.length"
|
||||||
|
striped
|
||||||
|
:data="flowcharts"
|
||||||
|
:columns="flowchartsColumns"
|
||||||
|
:max-height="isDesktop ? 1500 : 500"
|
||||||
|
/>
|
||||||
|
</n-tab-pane>
|
||||||
|
</n-tabs>
|
||||||
<n-data-table
|
<n-data-table
|
||||||
v-if="solvedProblems.length"
|
v-if="submissions.length && !flowcharts.length"
|
||||||
striped
|
striped
|
||||||
:data="solvedProblems"
|
:data="submissions"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:max-height="isDesktop ? 1500 : 500"
|
:max-height="isDesktop ? 1500 : 500"
|
||||||
/>
|
/>
|
||||||
@@ -11,17 +31,18 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import TagTitle from "./TagTitle.vue"
|
import TagTitle from "./TagTitle.vue"
|
||||||
import { SolvedProblem } from "utils/types"
|
import { FlowchartSummary, SolvedProblem } from "utils/types"
|
||||||
import { useAIStore } from "oj/store/ai"
|
import { useAIStore } from "oj/store/ai"
|
||||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||||
|
import { parseTime } from "utils/functions"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const aiStore = useAIStore()
|
const aiStore = useAIStore()
|
||||||
|
|
||||||
const { isDesktop } = useBreakpoints()
|
const { isDesktop } = useBreakpoints()
|
||||||
|
|
||||||
const solvedProblems = computed(() => aiStore.detailsData.solved)
|
const submissions = computed(() => aiStore.detailsData.solved)
|
||||||
|
const flowcharts = computed(() => aiStore.detailsData.flowcharts)
|
||||||
const columns: DataTableColumn<SolvedProblem>[] = [
|
const columns: DataTableColumn<SolvedProblem>[] = [
|
||||||
{
|
{
|
||||||
title: "完成的题目",
|
title: "完成的题目",
|
||||||
@@ -67,4 +88,39 @@ const columns: DataTableColumn<SolvedProblem>[] = [
|
|||||||
align: "center",
|
align: "center",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const flowchartsColumns: DataTableColumn<FlowchartSummary>[] = [
|
||||||
|
{
|
||||||
|
title: "完成的题目",
|
||||||
|
key: "problem_title",
|
||||||
|
width: 300,
|
||||||
|
render: (row) =>
|
||||||
|
h(
|
||||||
|
NButton,
|
||||||
|
{
|
||||||
|
text: true,
|
||||||
|
onClick: () => {
|
||||||
|
router.push("/problem/" + row.problem__id)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
() => `${row.problem__id} ${row.problem_title}`,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ title: "提交次数", key: "submission_count", width: 100, align: "center" },
|
||||||
|
{
|
||||||
|
title: "最高分",
|
||||||
|
key: "best",
|
||||||
|
width: 100,
|
||||||
|
align: "center",
|
||||||
|
render: (row) => `${row.best_score} (${row.best_grade})`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "最新提交时间",
|
||||||
|
key: "latest_submission_time",
|
||||||
|
width: 200,
|
||||||
|
align: "center",
|
||||||
|
render: (row) => parseTime(row.latest_submission_time),
|
||||||
|
},
|
||||||
|
{ title: "平均分", key: "avg_score", width: 100, align: "center" },
|
||||||
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -283,8 +283,9 @@ export function getFlowchartSubmission(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFlowchartSubmissions(params: {
|
export function getFlowchartSubmissions(params: {
|
||||||
user_id?: number
|
username?: string
|
||||||
problem_id?: number
|
problem_id?: string
|
||||||
|
myself?: string
|
||||||
offset?: number
|
offset?: number
|
||||||
limit?: number
|
limit?: number
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const useAIStore = defineStore("ai", () => {
|
|||||||
difficulty: {},
|
difficulty: {},
|
||||||
contest_count: 0,
|
contest_count: 0,
|
||||||
solved: [],
|
solved: [],
|
||||||
|
flowcharts: [],
|
||||||
})
|
})
|
||||||
const heatmapData = ref<{ timestamp: number; value: number }[]>([])
|
const heatmapData = ref<{ timestamp: number; value: number }[]>([])
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ export const useAIStore = defineStore("ai", () => {
|
|||||||
detailsData.tags = res.data.tags
|
detailsData.tags = res.data.tags
|
||||||
detailsData.difficulty = res.data.difficulty
|
detailsData.difficulty = res.data.difficulty
|
||||||
detailsData.contest_count = res.data.contest_count
|
detailsData.contest_count = res.data.contest_count
|
||||||
|
detailsData.flowcharts = res.data.flowcharts
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchDurationData(end: string, duration: string) {
|
async function fetchDurationData(end: string, duration: string) {
|
||||||
|
|||||||
25
src/oj/submission/components/FlowchartLink.vue
Normal file
25
src/oj/submission/components/FlowchartLink.vue
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<n-button v-if="showLink" type="info" text @click="goto">
|
||||||
|
{{ flowchart.id.slice(0, 12) }}
|
||||||
|
</n-button>
|
||||||
|
<n-text v-else>{{ flowchart.id.slice(0, 12) }}</n-text>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useUserStore } from "shared/store/user"
|
||||||
|
import { FlowchartSubmissionListItem } from "utils/types"
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
flowchart: FlowchartSubmissionListItem
|
||||||
|
}
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
|
const showLink = computed(() => {
|
||||||
|
if (!userStore.isAuthed) return false
|
||||||
|
if (userStore.isSuperAdmin) return true
|
||||||
|
return props.flowchart.username === userStore.user?.username
|
||||||
|
})
|
||||||
|
|
||||||
|
function goto() {}
|
||||||
|
</script>
|
||||||
25
src/oj/submission/components/Grade.vue
Normal file
25
src/oj/submission/components/Grade.vue
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<n-text :type="gradeType(grade)">
|
||||||
|
<span>{{ score }}</span>
|
||||||
|
<span>({{ grade }})</span>
|
||||||
|
</n-text>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { Grade } from "utils/types"
|
||||||
|
defineProps<{
|
||||||
|
score: number
|
||||||
|
grade: Grade
|
||||||
|
}>()
|
||||||
|
|
||||||
|
function gradeType(grade: Grade) {
|
||||||
|
return (
|
||||||
|
{
|
||||||
|
S: "success",
|
||||||
|
A: "info",
|
||||||
|
B: "warning",
|
||||||
|
C: "error",
|
||||||
|
} as const
|
||||||
|
)[grade]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
||||||
@@ -1,9 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NH2, NText } from "naive-ui"
|
import { NButton, NH2, NText } from "naive-ui"
|
||||||
import { useRouteQuery } from "@vueuse/router"
|
import { useRouteQuery } from "@vueuse/router"
|
||||||
import { adminRejudge, getSubmissions, getTodaySubmissionCount } from "oj/api"
|
import {
|
||||||
|
adminRejudge,
|
||||||
|
getFlowchartSubmissions,
|
||||||
|
getSubmissions,
|
||||||
|
getTodaySubmissionCount,
|
||||||
|
} from "oj/api"
|
||||||
import { parseTime } from "utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { LANGUAGE, SubmissionListItem } from "utils/types"
|
import {
|
||||||
|
FlowchartSubmissionListItem,
|
||||||
|
LANGUAGE,
|
||||||
|
SubmissionListItem,
|
||||||
|
} from "utils/types"
|
||||||
import Pagination from "shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
|
||||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||||
@@ -16,6 +25,8 @@ import StatisticsPanel from "shared/components/StatisticsPanel.vue"
|
|||||||
import SubmissionLink from "./components/SubmissionLink.vue"
|
import SubmissionLink from "./components/SubmissionLink.vue"
|
||||||
import SubmissionDetail from "./detail.vue"
|
import SubmissionDetail from "./detail.vue"
|
||||||
import IconButton from "shared/components/IconButton.vue"
|
import IconButton from "shared/components/IconButton.vue"
|
||||||
|
import Grade from "./components/Grade.vue"
|
||||||
|
import FlowchartLink from "./components/FlowchartLink.vue"
|
||||||
|
|
||||||
interface SubmissionQuery {
|
interface SubmissionQuery {
|
||||||
username: string
|
username: string
|
||||||
@@ -33,6 +44,7 @@ const message = useMessage()
|
|||||||
const { isMobile, isDesktop } = useBreakpoints()
|
const { isMobile, isDesktop } = useBreakpoints()
|
||||||
|
|
||||||
const submissions = ref<SubmissionListItem[]>([])
|
const submissions = ref<SubmissionListItem[]>([])
|
||||||
|
const flowcharts = ref<FlowchartSubmissionListItem[]>([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const todayCount = ref(0)
|
const todayCount = ref(0)
|
||||||
|
|
||||||
@@ -58,7 +70,8 @@ const resultOptions: SelectOption[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const languageOptions: SelectOption[] = [
|
const languageOptions: SelectOption[] = [
|
||||||
{ label: "全部", value: "" },
|
{ label: "流程图", value: "Flowchart" },
|
||||||
|
{ label: "全部语言", value: "" },
|
||||||
{ label: "Python", value: "Python3" },
|
{ label: "Python", value: "Python3" },
|
||||||
{ label: "C语言", value: "C" },
|
{ label: "C语言", value: "C" },
|
||||||
{ label: "C++", value: "C++" },
|
{ label: "C++", value: "C++" },
|
||||||
@@ -66,15 +79,27 @@ const languageOptions: SelectOption[] = [
|
|||||||
async function listSubmissions() {
|
async function listSubmissions() {
|
||||||
if (query.page < 1) query.page = 1
|
if (query.page < 1) query.page = 1
|
||||||
const offset = query.limit * (query.page - 1)
|
const offset = query.limit * (query.page - 1)
|
||||||
const res = await getSubmissions({
|
if (query.language === "Flowchart") {
|
||||||
...query,
|
const res = await getFlowchartSubmissions({
|
||||||
offset,
|
username: query.username,
|
||||||
problem_id: query.problem,
|
problem_id: query.problem,
|
||||||
contest_id: <string>route.params.contestID ?? "",
|
myself: query.myself,
|
||||||
language: query.language,
|
offset,
|
||||||
})
|
limit: query.limit,
|
||||||
submissions.value = res.data.results
|
})
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
|
flowcharts.value = res.data.results
|
||||||
|
} else {
|
||||||
|
const res = await getSubmissions({
|
||||||
|
...query,
|
||||||
|
offset,
|
||||||
|
problem_id: query.problem,
|
||||||
|
contest_id: <string>route.params.contestID ?? "",
|
||||||
|
language: query.language,
|
||||||
|
})
|
||||||
|
submissions.value = res.data.results
|
||||||
|
total.value = res.data.total
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTodayCount() {
|
async function getTodayCount() {
|
||||||
@@ -104,7 +129,7 @@ async function rejudge(submissionID: string) {
|
|||||||
listSubmissions()
|
listSubmissions()
|
||||||
}
|
}
|
||||||
|
|
||||||
function problemClicked(row: SubmissionListItem) {
|
function problemClicked(row: SubmissionListItem | FlowchartSubmissionListItem) {
|
||||||
if (route.name === "contest submissions") {
|
if (route.name === "contest submissions") {
|
||||||
const path = router.resolve({
|
const path = router.resolve({
|
||||||
name: "contest problem",
|
name: "contest problem",
|
||||||
@@ -136,27 +161,18 @@ watch(
|
|||||||
listSubmissions,
|
listSubmissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
|
||||||
() =>
|
|
||||||
(route.name === "submissions" || route.name === "contest submissions") &&
|
|
||||||
route.query,
|
|
||||||
(newVal) => {
|
|
||||||
if (newVal) listSubmissions()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
const columns = computed(() => {
|
const columns = computed(() => {
|
||||||
const res: DataTableColumn<SubmissionListItem>[] = [
|
const res: DataTableColumn<SubmissionListItem>[] = [
|
||||||
{
|
{
|
||||||
title: renderTableTitle("提交时间", "noto:seven-oclock"),
|
title: renderTableTitle("提交时间", "noto:seven-oclock"),
|
||||||
key: "create_time",
|
key: "create_time",
|
||||||
width: 200,
|
minWidth: 200,
|
||||||
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"),
|
title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"),
|
||||||
key: "id",
|
key: "id",
|
||||||
minWidth: 180,
|
minWidth: 200,
|
||||||
render: (row) =>
|
render: (row) =>
|
||||||
h(SubmissionLink, {
|
h(SubmissionLink, {
|
||||||
submission: row,
|
submission: row,
|
||||||
@@ -166,13 +182,13 @@ const columns = computed(() => {
|
|||||||
{
|
{
|
||||||
title: renderTableTitle("状态", "streamline-emojis:panda-face"),
|
title: renderTableTitle("状态", "streamline-emojis:panda-face"),
|
||||||
key: "status",
|
key: "status",
|
||||||
width: 140,
|
minWidth: 140,
|
||||||
render: (row) => h(SubmissionResultTag, { result: row.result }),
|
render: (row) => h(SubmissionResultTag, { result: row.result }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: renderTableTitle("题目", "streamline-emojis:blossom"),
|
title: renderTableTitle("题目", "streamline-emojis:blossom"),
|
||||||
key: "problem",
|
key: "problem",
|
||||||
width: 160,
|
minWidth: 300,
|
||||||
render: (row) =>
|
render: (row) =>
|
||||||
h(
|
h(
|
||||||
ButtonWithSearch,
|
ButtonWithSearch,
|
||||||
@@ -181,7 +197,7 @@ const columns = computed(() => {
|
|||||||
onClick: () => problemClicked(row),
|
onClick: () => problemClicked(row),
|
||||||
onSearch: () => (query.problem = row.problem),
|
onSearch: () => (query.problem = row.problem),
|
||||||
},
|
},
|
||||||
() => row.problem,
|
() => `${row.problem} ${row.problem_title}`,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -190,7 +206,7 @@ const columns = computed(() => {
|
|||||||
"streamline-emojis:globe-showing-europe-africa",
|
"streamline-emojis:globe-showing-europe-africa",
|
||||||
),
|
),
|
||||||
key: "language",
|
key: "language",
|
||||||
width: 120,
|
minWidth: 120,
|
||||||
render: (row) => LANGUAGE_SHOW_VALUE[row.language],
|
render: (row) => LANGUAGE_SHOW_VALUE[row.language],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -233,6 +249,58 @@ const columns = computed(() => {
|
|||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
||||||
|
{
|
||||||
|
title: renderTableTitle("提交时间", "noto:seven-oclock"),
|
||||||
|
key: "create_time",
|
||||||
|
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: renderTableTitle("提交编号", "fluent-emoji-flat:input-numbers"),
|
||||||
|
key: "id",
|
||||||
|
render: (row) => h(FlowchartLink, { flowchart: row }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: renderTableTitle("题目", "streamline-emojis:blossom"),
|
||||||
|
key: "problem_title",
|
||||||
|
render: (row) =>
|
||||||
|
h(
|
||||||
|
ButtonWithSearch,
|
||||||
|
{
|
||||||
|
type: "题目",
|
||||||
|
onClick: () => problemClicked(row),
|
||||||
|
onSearch: () => (query.problem = row.problem),
|
||||||
|
},
|
||||||
|
() => `${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,
|
||||||
|
render: (row) =>
|
||||||
|
h(
|
||||||
|
ButtonWithSearch,
|
||||||
|
{
|
||||||
|
type: "用户",
|
||||||
|
username: row.username,
|
||||||
|
onClick: () => window.open("/user?name=" + row.username, "_blank"),
|
||||||
|
onSearch: () => (query.username = row.username),
|
||||||
|
onFilterClass: (classname: string) => (query.username = classname),
|
||||||
|
},
|
||||||
|
() => row.username,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<n-flex vertical size="large">
|
<n-flex vertical size="large">
|
||||||
@@ -245,13 +313,6 @@ const columns = computed(() => {
|
|||||||
unchecked-value="0"
|
unchecked-value="0"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="状态">
|
|
||||||
<n-select
|
|
||||||
class="select"
|
|
||||||
v-model:value="query.result"
|
|
||||||
:options="resultOptions"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
|
||||||
<n-form-item label="语言" v-if="route.name !== 'contest submissions'">
|
<n-form-item label="语言" v-if="route.name !== 'contest submissions'">
|
||||||
<n-select
|
<n-select
|
||||||
class="select"
|
class="select"
|
||||||
@@ -259,10 +320,19 @@ const columns = computed(() => {
|
|||||||
:options="languageOptions"
|
:options="languageOptions"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
<n-form-item label="状态">
|
||||||
|
<n-select
|
||||||
|
:disabled="query.language === 'Flowchart'"
|
||||||
|
class="select"
|
||||||
|
v-model:value="query.result"
|
||||||
|
:options="resultOptions"
|
||||||
|
/>
|
||||||
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
<n-form :show-feedback="false" inline label-placement="left">
|
<n-form :show-feedback="false" inline label-placement="left">
|
||||||
<n-form-item>
|
<n-form-item>
|
||||||
<n-input
|
<n-input
|
||||||
|
:disabled="query.myself === '1'"
|
||||||
class="input"
|
class="input"
|
||||||
clearable
|
clearable
|
||||||
v-model:value="query.username"
|
v-model:value="query.username"
|
||||||
@@ -317,7 +387,18 @@ const columns = computed(() => {
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-data-table :bordered="false" :columns="columns" :data="submissions" />
|
<n-data-table
|
||||||
|
v-if="query.language === 'Flowchart'"
|
||||||
|
:bordered="false"
|
||||||
|
:columns="flowchartColumns"
|
||||||
|
:data="flowcharts"
|
||||||
|
/>
|
||||||
|
<n-data-table
|
||||||
|
v-else
|
||||||
|
:bordered="false"
|
||||||
|
:columns="columns"
|
||||||
|
:data="submissions"
|
||||||
|
/>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<Pagination
|
<Pagination
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ export const CODE_TEMPLATES = {
|
|||||||
Java: blankTemplate,
|
Java: blankTemplate,
|
||||||
JavaScript: blankTemplate,
|
JavaScript: blankTemplate,
|
||||||
Golang: blankTemplate,
|
Golang: blankTemplate,
|
||||||
|
Flowchart: blankTemplate,
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export enum ScreenMode {
|
export enum ScreenMode {
|
||||||
|
|||||||
@@ -223,9 +223,20 @@ export interface FlowchartSubmission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 列表接口返回的字段(包含 username 和 problem_title)
|
// 列表接口返回的字段(包含 username 和 problem_title)
|
||||||
export interface FlowchartSubmissionListItem extends FlowchartSubmission {
|
export interface FlowchartSubmissionListItem {
|
||||||
|
id: string
|
||||||
|
create_time: string
|
||||||
|
evaluation_time: string
|
||||||
|
ai_score: number
|
||||||
|
ai_grade: Grade
|
||||||
|
ai_model: string
|
||||||
|
ai_provider: string
|
||||||
|
processing_time: number
|
||||||
|
status: number
|
||||||
username: string
|
username: string
|
||||||
problem_title: string
|
problem_title: string
|
||||||
|
problem: string
|
||||||
|
show_link: boolean
|
||||||
}
|
}
|
||||||
export interface SubmitFlowchartPayload {
|
export interface SubmitFlowchartPayload {
|
||||||
problem_id: number
|
problem_id: number
|
||||||
@@ -275,6 +286,7 @@ export interface Submission {
|
|||||||
export interface SubmissionListItem {
|
export interface SubmissionListItem {
|
||||||
id: string
|
id: string
|
||||||
problem: string
|
problem: string
|
||||||
|
problem_title: string
|
||||||
show_link: boolean
|
show_link: boolean
|
||||||
create_time: string
|
create_time: string
|
||||||
user_id: number
|
user_id: number
|
||||||
@@ -479,6 +491,16 @@ export interface SolvedProblem {
|
|||||||
difficulty: string
|
difficulty: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface FlowchartSummary {
|
||||||
|
problem__id: string
|
||||||
|
problem_title: string
|
||||||
|
submission_count: number
|
||||||
|
best_score: number
|
||||||
|
best_grade: string
|
||||||
|
latest_submission_time: string
|
||||||
|
avg_score: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface DetailsData {
|
export interface DetailsData {
|
||||||
start: string
|
start: string
|
||||||
end: string
|
end: string
|
||||||
@@ -488,6 +510,7 @@ export interface DetailsData {
|
|||||||
difficulty: { [key: string]: number }
|
difficulty: { [key: string]: number }
|
||||||
contest_count: number
|
contest_count: number
|
||||||
solved: SolvedProblem[]
|
solved: SolvedProblem[]
|
||||||
|
flowcharts: FlowchartSummary[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Grade = "S" | "A" | "B" | "C"
|
export type Grade = "S" | "A" | "B" | "C"
|
||||||
|
|||||||
Reference in New Issue
Block a user