为比赛添加标签
This commit is contained in:
@@ -23,16 +23,12 @@ async function handleDelete() {
|
||||
emit("deleted")
|
||||
}
|
||||
|
||||
function goDetail() {}
|
||||
</script>
|
||||
<template>
|
||||
<n-space>
|
||||
<n-button size="small" type="success" secondary @click="goEdit">
|
||||
编辑
|
||||
</n-button>
|
||||
<n-button size="small" type="info" secondary @click="goDetail">
|
||||
查看
|
||||
</n-button>
|
||||
<n-popconfirm @positive-click="handleDelete">
|
||||
<template #trigger>
|
||||
<n-button size="small" type="error" secondary>删除</n-button>
|
||||
|
||||
@@ -39,6 +39,7 @@ async function init() {
|
||||
announcement.title = res.data.title
|
||||
announcement.content = res.data.content
|
||||
announcement.visible = res.data.visible
|
||||
announcement.tag = res.data.tag
|
||||
announcement.top = res.data.top
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,17 @@ const [ready, toggleReady] = useToggle()
|
||||
const startTime = ref(after10mins)
|
||||
const endTime = ref(after70mins)
|
||||
|
||||
const tags: SelectOption[] = [
|
||||
{ label: "练习", value: "练习" },
|
||||
{ label: "期中", value: "期中" },
|
||||
{ label: "期末", value: "期末" },
|
||||
]
|
||||
|
||||
const contest = reactive<BlankContest & { id: number }>({
|
||||
id: 0,
|
||||
title: "",
|
||||
description: "",
|
||||
tag: "练习",
|
||||
start_time: formatISO(after10mins),
|
||||
end_time: formatISO(after70mins),
|
||||
rule_type: "ACM",
|
||||
@@ -48,6 +55,7 @@ async function getContestDetail() {
|
||||
contest.id = data.id
|
||||
contest.title = data.title
|
||||
contest.description = data.description
|
||||
contest.tag = data.tag
|
||||
contest.start_time = data.start_time
|
||||
contest.end_time = data.end_time
|
||||
contest.rule_type = "ACM"
|
||||
@@ -93,6 +101,13 @@ onMounted(getContestDetail)
|
||||
<n-form-item label="标题">
|
||||
<n-input class="contestTitle" v-model:value="contest.title" />
|
||||
</n-form-item>
|
||||
<n-form-item label="标签">
|
||||
<n-select
|
||||
style="width: 100px"
|
||||
:options="tags"
|
||||
v-model:value="contest.tag"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="开始">
|
||||
<n-date-picker v-model:value="startTime" type="datetime" />
|
||||
</n-form-item>
|
||||
|
||||
@@ -29,6 +29,11 @@ const columns: DataTableColumn<Contest>[] = [
|
||||
minWidth: 250,
|
||||
render: (row) => h(ContestTitle, { contest: row }),
|
||||
},
|
||||
{
|
||||
title: "标签",
|
||||
key: "tag",
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
key: "contest_type",
|
||||
|
||||
Reference in New Issue
Block a user