This commit is contained in:
2023-04-04 11:46:28 +08:00
parent ae621b7dd2
commit 2066cb441b
18 changed files with 210 additions and 105 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { parseTime } from "utils/functions"
import { useContestStore } from "oj/store/contest"
import ContestTypeVue from "~/shared/ContestType.vue"
import ContestType from "~/shared/ContestType.vue"
const contestStore = useContestStore()
</script>
@@ -27,7 +27,7 @@ const contestStore = useContestStore()
{{ parseTime(contestStore.contest.end_time, "YYYY年M月D日 hh:mm:ss") }}
</n-descriptions-item>
<n-descriptions-item label="比赛类型">
<ContestTypeVue :contest="contestStore.contest" />
<ContestType :contest="contestStore.contest" />
</n-descriptions-item>
<n-descriptions-item label="发起人">
{{ contestStore.contest.created_by.username }}

View File

@@ -29,14 +29,17 @@ const passwordFormVisible = computed(
</script>
<template>
<div v-if="contestStore.contest">
<n-space class="title" align="center" justify="space-between">
<n-space vertical v-if="contestStore.contest">
<n-space align="center" justify="space-between">
<n-space align="center">
<h2 class="contestTitle">{{ contestStore.contest.title }}</h2>
<n-icon size="large" v-if="contestStore.isPrivate" class="lockIcon">
<i-ep-lock />
</n-icon>
<n-tag :type="CONTEST_STATUS[contestStore.contestStatus]['type']">
<n-tag
size="small"
:type="CONTEST_STATUS[contestStore.contestStatus]['type']"
>
{{ contestStore.countdown }}
</n-tag>
</n-space>
@@ -67,14 +70,10 @@ const passwordFormVisible = computed(
</n-form-item>
</n-form>
<router-view></router-view>
</div>
</n-space>
</template>
<style scoped>
.title {
margin-bottom: 16px;
}
.contestTitle {
font-weight: 500;
margin: 0;

View File

@@ -119,31 +119,29 @@ function rowProps(row: Contest) {
}
</script>
<template>
<n-form label-placement="left" :inline="isDesktop">
<n-form-item label="状态">
<n-select
class="select"
:options="options"
v-model:value="query.status"
/>
</n-form-item>
<n-form-item label="搜索比赛标题">
<n-input placeholder="输入后回车或点击搜索" clearable @change="search" />
</n-form-item>
<n-form-item>
<n-space>
<n-button @click="search(query.keyword)">搜索</n-button>
<n-button @click="clear">重置</n-button>
</n-space>
</n-form-item>
</n-form>
<n-data-table
size="small"
striped
:columns="columns"
:data="data"
:row-props="rowProps"
/>
<n-space>
<n-form :show-feedback="false" label-placement="left" inline>
<n-form-item label="比赛状态">
<n-select
class="select"
:options="options"
v-model:value="query.status"
/>
</n-form-item>
<n-form-item label="搜索">
<n-input clearable @change="search" />
</n-form-item>
</n-form>
<n-form label-placement="left" inline>
<n-form-item>
<n-space>
<n-button @click="search(query.keyword)">搜索</n-button>
<n-button @click="clear">重置</n-button>
</n-space>
</n-form-item>
</n-form>
</n-space>
<n-data-table striped :columns="columns" :data="data" :row-props="rowProps" />
<Pagination
v-model:limit="query.limit"
v-model:page="query.page"

View File

@@ -34,7 +34,6 @@ function rowProps(row: ProblemFiltered) {
<template>
<n-data-table
striped
size="small"
:data="contestStore.problems"
:columns="problemsColumns"
:row-props="rowProps"

View File

@@ -165,7 +165,6 @@ onMounted(() => {
striped
:single-line="false"
:scroll-x="1200"
size="small"
:columns="columns"
:data="data"
/>