problem list.

This commit is contained in:
2023-03-14 20:58:43 +08:00
parent b987749ff6
commit 51328770c6
7 changed files with 118 additions and 39 deletions

View File

@@ -0,0 +1,24 @@
<script lang="ts" setup>
import { deleteProblem } from "~/admin/api"
interface Props {
problemID: number
}
const props = defineProps<Props>()
const emit = defineEmits(["deleted"])
const message = useMessage()
async function handleDeleteProblem(problemID: number) {
await deleteProblem(problemID)
message.success("删除成功")
emit("deleted")
}
</script>
<template>
<n-popconfirm @positive-click="() => handleDeleteProblem(props.problemID)">
<template #trigger>
<n-button tertiary size="small" type="error">删除</n-button>
</template>
确定删除这道题目吗相关的提交也会被相应删除哦 😯
</n-popconfirm>
</template>

View File

@@ -0,0 +1,15 @@
<script lang="ts" setup>
const props = defineProps<{ problemID: number }>()
function download() {
console.log(props.problemID)
}
</script>
<template>
<n-tooltip>
<template #trigger>
<n-button size="small" tertiary @click="download">下载</n-button>
</template>
下载测试用例
</n-tooltip>
</template>