diff --git a/src/api.ts b/src/api.ts index 494faf2..ae6a9d3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -181,7 +181,6 @@ export const Submission = { score_min?: number score_max_exclusive?: number score_lt_threshold?: number - nominated?: boolean ordering?: string grouped?: boolean }) { @@ -223,11 +222,6 @@ export const Submission = { return res.data as { cleared: number } }, - async nominate(id: string) { - const res = await http.put(`/submission/${id}/nominate`) - return res.data as { nominated: boolean } - }, - async getStats(taskId: number, classname?: string): Promise { const params: Record = {} if (classname) params.classname = classname diff --git a/src/components/TaskStatsModal.vue b/src/components/TaskStatsModal.vue index 00e9a8b..4c8e6d5 100644 --- a/src/components/TaskStatsModal.vue +++ b/src/components/TaskStatsModal.vue @@ -279,72 +279,6 @@ - -
-
- 人气提交 Top 5 - (按打分人数) -
-
-
-
- {{ i + 1 }} -
-
-
- {{ displayName(sub.username, sub.classname) }} -
-
- {{ sub.score.toFixed(1) }} 分 · - {{ sub.rating_count }} 人打分 -
-
-
查看 →
-
- 暂无打分记录 -
-
-
{ color: "#2080f0", }, { label: "未打分", value: stats.value.unrated_count, color: "#d03050" }, - { label: "参与排名", value: stats.value.nominated_count, color: "#f0a020" }, ] }) diff --git a/src/components/Toolbar.vue b/src/components/Toolbar.vue index 607a0e4..89856ea 100644 --- a/src/components/Toolbar.vue +++ b/src/components/Toolbar.vue @@ -77,15 +77,6 @@ const menu = computed(() => [ width: 20, }), }, - { - label: "排名榜", - key: "ranking", - icon: () => - h(Icon, { - icon: "streamline-emojis:sunglasses", - width: 20, - }), - }, { label: "退出账号", key: "logout", @@ -117,9 +108,6 @@ function clickMenu(name: string) { query: { username: user.username }, }) break - case "ranking": - router.push({ name: "ranking" }) - break case "logout": handleLogout() break diff --git a/src/components/submissions/ExpandedSubTable.vue b/src/components/submissions/ExpandedSubTable.vue index 1d451e0..1c8ad27 100644 --- a/src/components/submissions/ExpandedSubTable.vue +++ b/src/components/submissions/ExpandedSubTable.vue @@ -37,7 +37,6 @@ const emit = defineEmits<{ select: [id: string] delete: [row: SubmissionOut, parentId: string] "show-chain": [conversationId: string] - nominate: [row: SubmissionOut] }>() const isChallenge = computed(() => props.row.task_type === TASK_TYPE.Challenge) @@ -77,30 +76,6 @@ const subColumns = computed((): DataTableColumn[] => [ ) }, }, - { - title: "排名", - key: "nominated", - width: 60, - render: (r: SubmissionOut) => { - if (r.username !== user.username) { - return r.nominated - ? h("span", { style: { color: "#f0a020" } }, "🏅") - : null - } - return h( - NButton, - { - text: true, - title: r.nominated ? "已参与排名(点击可重新提名)" : "参与排名", - onClick: (e: Event) => { - e.stopPropagation() - emit("nominate", r) - }, - }, - () => (r.nominated ? "🏅" : "☆"), - ) - }, - }, ...(isChallenge.value ? [ { diff --git a/src/pages/Submissions.vue b/src/pages/Submissions.vue index 8ccc247..5fdd05f 100644 --- a/src/pages/Submissions.vue +++ b/src/pages/Submissions.vue @@ -195,7 +195,6 @@ const columns: DataTableColumn[] = [ onSelect: (id) => getSubmissionByID(id), onDelete: (r, parentId) => handleDelete(r, parentId), "onShow-chain": (id) => showChain(id), - onNominate: (r) => handleNominateChild(r, row.id), }), }, { @@ -313,23 +312,6 @@ async function getSubmissionByID(id: string) { submission.value = await Submission.get(id) } -async function handleNominateChild(row: SubmissionOut, parentId: string) { - await Submission.nominate(row.id) - const items = expandedData.get(parentId) - if (items) { - expandedData.set( - parentId, - items.map((d) => ({ ...d, nominated: d.id === row.id })), - ) - } - data.value = data.value.map((d) => { - if (d.username === user.username && d.task_id === row.task_id) { - d.nominated = d.id === row.id - } - return d - }) -} - function afterScore() { data.value = data.value.map((d) => { if (d.id === submission.value.id) d.my_score = submission.value.my_score diff --git a/src/utils/type.ts b/src/utils/type.ts index 6be28d0..484c04a 100644 --- a/src/utils/type.ts +++ b/src/utils/type.ts @@ -78,7 +78,6 @@ export interface SubmissionOut { my_score: number conversation_id?: string flag?: FlagType - nominated: boolean submit_count: number created: Date modified: Date @@ -107,14 +106,6 @@ export interface UserTag { classname: string } -export interface TopSubmission { - submission_id: string - username: string - classname: string - score: number - rating_count: number -} - export interface SubmissionCountBucket { count_1: number count_2: number @@ -142,12 +133,10 @@ export interface TaskStatsOut { unsubmitted_count: number average_score: number | null unrated_count: number - nominated_count: number unsubmitted_users: UserTag[] unrated_users: UserTag[] submission_count_distribution: SubmissionCountBucket score_distribution: ScoreBucket - top_submissions: TopSubmission[] flag_stats: FlagStats classes: string[] }