add acm helper.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
13
src/oj/contest/pages/helper.vue
Normal file
13
src/oj/contest/pages/helper.vue
Normal 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>
|
||||
Reference in New Issue
Block a user