add contest problem.
This commit is contained in:
@@ -14,11 +14,10 @@ const data = computed(() => {
|
||||
const status = props.problem.statistic_info
|
||||
const labels = []
|
||||
for (let i in status) {
|
||||
if (status[i] === 0) {
|
||||
delete status[i]
|
||||
if (status[i] !== 0) {
|
||||
// @ts-ignore
|
||||
labels.push(JUDGE_STATUS[i]["name"])
|
||||
}
|
||||
// @ts-ignore
|
||||
labels.push(JUDGE_STATUS[i]["name"])
|
||||
}
|
||||
return {
|
||||
labels,
|
||||
|
||||
28
src/oj/problem/components/ProblemStatus.vue
Normal file
28
src/oj/problem/components/ProblemStatus.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { Select, SemiSelect } from "@element-plus/icons-vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
|
||||
const theme = useThemeVars()
|
||||
const props = defineProps<{
|
||||
status: "not_test" | "passed" | "failed"
|
||||
}>()
|
||||
|
||||
const showIcon = computed(() => props.status !== "not_test")
|
||||
const color = computed(() => {
|
||||
if (props.status === "passed") return theme.value.successColor
|
||||
if (props.status === "failed") return theme.value.errorColor
|
||||
})
|
||||
|
||||
const Icon = computed(() => {
|
||||
if (props.status === "passed") return Select
|
||||
if (props.status === "failed") return SemiSelect
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-icon v-if="showIcon" :color="color">
|
||||
<component :is="Icon"></component>
|
||||
</n-icon>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user