add auto refresh for contest rank.
This commit is contained in:
@@ -6,6 +6,8 @@ import AcAndSubmission from "../components/AcAndSubmission.vue"
|
|||||||
import { getContestProblems, getContestRank } from "oj/api"
|
import { getContestProblems, getContestRank } from "oj/api"
|
||||||
import { ContestRank, ProblemFiltered } from "~/utils/types"
|
import { ContestRank, ProblemFiltered } from "~/utils/types"
|
||||||
import { secondsToDuration } from "utils/functions"
|
import { secondsToDuration } from "utils/functions"
|
||||||
|
import { ContestStatus } from "~/utils/constants"
|
||||||
|
import { useContestStore } from "~/oj/store/contest"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contestID: string
|
contestID: string
|
||||||
@@ -15,6 +17,9 @@ const props = defineProps<Props>()
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
const contestStore = useContestStore()
|
||||||
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const data = ref<ContestRank[]>([])
|
const data = ref<ContestRank[]>([])
|
||||||
const chart = ref<ContestRank[]>([])
|
const chart = ref<ContestRank[]>([])
|
||||||
@@ -196,7 +201,12 @@ onMounted(() => {
|
|||||||
:data="data"
|
:data="data"
|
||||||
/>
|
/>
|
||||||
<n-space justify="end" align="center">
|
<n-space justify="end" align="center">
|
||||||
<n-form label-placement="left" inline :show-feedback="false">
|
<n-form
|
||||||
|
label-placement="left"
|
||||||
|
inline
|
||||||
|
:show-feedback="false"
|
||||||
|
v-if="contestStore.contestStatus === ContestStatus.underway"
|
||||||
|
>
|
||||||
<n-form-item label="开启自动刷新">
|
<n-form-item label="开启自动刷新">
|
||||||
<n-switch v-model:value="autoRefresh" />
|
<n-switch v-model:value="autoRefresh" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ function changeLanguage(v: LANGUAGE) {
|
|||||||
</n-button>
|
</n-button>
|
||||||
</n-dropdown>
|
</n-dropdown>
|
||||||
<n-button v-if="isDesktop" @click="goSubmissions">提交信息</n-button>
|
<n-button v-if="isDesktop" @click="goSubmissions">提交信息</n-button>
|
||||||
<TestCat />
|
<TestCat v-if="isDesktop" />
|
||||||
<n-button
|
<n-button
|
||||||
v-if="isDesktop && userStore.isSuperAdmin"
|
v-if="isDesktop && userStore.isSuperAdmin"
|
||||||
type="warning"
|
type="warning"
|
||||||
|
|||||||
Reference in New Issue
Block a user