add rank.

This commit is contained in:
2023-02-10 10:19:43 +08:00
parent 5f39ec4fd2
commit c80352b245
22 changed files with 1197 additions and 1170 deletions

View File

@@ -1,12 +1,25 @@
<script setup lang="ts">
import { ContestRank } from "~/utils/types"
import { ContestRank, ProblemFiltered } from "~/utils/types"
defineProps<{ rank: ContestRank }>()
interface Props {
rank: ContestRank
}
const props = defineProps<Props>()
const router = useRouter()
function goto() {
router.push({
name: "contest submissions",
query: { username: props.rank.user.username },
})
}
</script>
<template>
{{ rank.accepted_number }} /
<n-button text type="primary">{{ rank.submission_number }}</n-button>
<n-button text type="primary" @click="goto">
{{ rank.submission_number }}
</n-button>
</template>
<style scoped></style>

View File

@@ -1,22 +1,22 @@
<script setup lang="ts">
import { Contest } from "~/utils/types"
import { ContestType } from "~/utils/constants"
defineProps<{ contest: Contest }>()
</script>
<template>
<n-space>
<span>{{ contest.title }}</span>
<n-icon
class="lockIcon"
v-if="contest.contest_type === ContestType.private"
>
<i-ep-lock />
</n-icon>
</n-space>
</template>
<style scoped>
.lockIcon {
transform: translateY(2px);
}
</style>
<script setup lang="ts">
import { Contest } from "~/utils/types"
import { ContestType } from "~/utils/constants"
defineProps<{ contest: Contest }>()
</script>
<template>
<n-space>
<span>{{ contest.title }}</span>
<n-icon
class="lockIcon"
v-if="contest.contest_type === ContestType.private"
>
<i-ep-lock />
</n-icon>
</n-space>
</template>
<style scoped>
.lockIcon {
transform: translateY(2px);
}
</style>

View File

@@ -1,20 +1,20 @@
<script setup lang="ts">
import { Contest } from "~/utils/types"
import { ContestType } from "~/utils/constants"
interface Props {
contest: Contest
}
const props = defineProps<Props>()
const isPrivate = computed(
() => props.contest.contest_type === ContestType.private
)
</script>
<template>
<n-tag :type="isPrivate ? 'error' : 'default'">
{{ isPrivate ? "需要密码" : "公开" }}
</n-tag>
</template>
<script setup lang="ts">
import { Contest } from "~/utils/types"
import { ContestType } from "~/utils/constants"
interface Props {
contest: Contest
}
const props = defineProps<Props>()
const isPrivate = computed(
() => props.contest.contest_type === ContestType.private
)
</script>
<template>
<n-tag :type="isPrivate ? 'error' : 'default'">
{{ isPrivate ? "需要密码" : "公开" }}
</n-tag>
</template>