add contest details.

This commit is contained in:
2023-03-30 18:49:32 +08:00
parent 301fc1be6d
commit eb652d1c86
10 changed files with 153 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { deleteContestProblem, deleteProblem } from "~/admin/api"
import download from "~/utils/download"
interface Props {
problemID: number
@@ -30,8 +31,8 @@ async function handleDeleteProblem() {
}
}
function download() {
console.log(props.problemID)
function downloads() {
download("test_case?problem_id=" + props.problemID)
}
function goEdit() {
@@ -60,7 +61,7 @@ function goCheck() {
</n-popconfirm>
<n-tooltip>
<template #trigger>
<n-button size="small" secondary @click="download">下载</n-button>
<n-button size="small" secondary @click="downloads">下载</n-button>
</template>
下载测试用例
</n-tooltip>

View File

@@ -91,7 +91,10 @@ const tagOptions = computed(() =>
)
async function getProblemDetail() {
if (!props.problemID) return
if (!props.problemID) {
toggleReady(true)
return
}
const { data } = await getProblem(props.problemID)
toggleReady(true)
problem.id = data.id
@@ -307,12 +310,6 @@ async function submit() {
}
onMounted(() => {
if (
route.name === "admin problem create" ||
route.name === "admin contest problem create"
) {
toggleReady(true)
}
listTags()
getProblemDetail()
})