add acm helper.

This commit is contained in:
2023-04-12 19:47:36 +08:00
parent 987d27cb51
commit d99ecfefca
5 changed files with 31 additions and 4 deletions

View File

@@ -24,11 +24,12 @@ function getCurrentType(name: string): "primary" | "default" {
return "default"
}
const options: DropdownOption[] = [
const options = computed<DropdownOption[]>(() => [
{ label: "比赛题目", key: "problems" },
{ label: "提交信息", key: "submissions" },
{ label: "比赛排名", key: "rank" },
]
{ label: "管理员助手", key: "helper", show: contestStore.isContestAdmin },
])
</script>
<template>
<div v-if="contestMenuVisible">
@@ -45,6 +46,13 @@ const options: DropdownOption[] = [
<n-button :type="getCurrentType('rank')" @click="goto('rank')">
比赛排名
</n-button>
<n-button
v-if="contestStore.isContestAdmin"
:type="getCurrentType('helper')"
@click="goto('helper')"
>
管理员助手
</n-button>
</n-space>
<n-dropdown v-else :options="options" trigger="click" @select="goto">
<n-button>菜单</n-button>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { CONTEST_STATUS, ContestStatus } from "utils/constants"
import { CONTEST_STATUS } from "utils/constants"
import { isDesktop } from "~/shared/composables/breakpoints"
import { useContestStore } from "../store/contest"
import ContestInfo from "./components/ContestInfo.vue"

View File

@@ -8,7 +8,6 @@ import ContestTitle from "~/shared/ContestTitle.vue"
import Pagination from "~/shared/Pagination.vue"
import { useUserStore } from "~/shared/store/user"
import { toggleLogin } from "~/shared/composables/modal"
import { isDesktop } from "~/shared/composables/breakpoints"
const route = useRoute()
const router = useRouter()

View File

@@ -0,0 +1,13 @@
<script lang="ts" setup>
const columns: DataTableColumn[] = [
{ title: "AC 时间", key: "ac_time" },
{ title: "问题 ID", key: "problem_display_id" },
{ title: "一血", key: "is_first_ac" },
{ title: "用户名", key: "username" },
{ title: "状态", key: "status" },
{ title: "选项", key: "actions" },
]
</script>
<template>
<n-data-table :columns="columns"></n-data-table>
</template>