fix(后台): 用户、题目、比赛、公告、标签几张列表的操作不再收进 ⋯,直接摆在行尾;名字和题目那列不再吃掉整行的空,创建日期不再折成两行
1366 宽的屏上题目列表、比赛列表的按钮都放得下;题目的知识点多于两个时只摆一个加「+N」。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd3a57468f
commit
6470f56f87
9 files changed
+119
-158
No files matched your search
@@ -1,5 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
import { Icon } from "@iconify/vue"
|
||||
import type { AdminContest } from "utils/types"
|
||||
import { cloneContest } from "../../api"
|
||||
|
||||
@@ -22,14 +21,8 @@ function goClass() {
|
||||
window.open(`/contest/${props.contest.id}/class`, "_blank")
|
||||
}
|
||||
|
||||
const menuOptions: DropdownOption[] = [
|
||||
{ label: "复制一份", key: "clone" },
|
||||
{ label: "在前台看", key: "view" },
|
||||
]
|
||||
|
||||
function onMenu(key: string) {
|
||||
if (key === "clone") clone()
|
||||
else if (key === "view") window.open(`/contest/${props.contest.id}`, "_blank")
|
||||
function openFront() {
|
||||
window.open(`/contest/${props.contest.id}`, "_blank")
|
||||
}
|
||||
|
||||
async function clone() {
|
||||
@@ -46,16 +39,14 @@ async function clone() {
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<n-flex :size="4" justify="end" :wrap="false">
|
||||
<!-- 操作直接摆出来,不收进 ⋯(用户说的) -->
|
||||
<n-flex :size="4" :wrap="false">
|
||||
<n-button size="small" @click="goEdit">编辑</n-button>
|
||||
<n-button size="small" @click="goClass">
|
||||
{{ contest.status === "-1" ? "成绩" : "全班情况" }}
|
||||
</n-button>
|
||||
<n-dropdown trigger="click" placement="bottom-end" :options="menuOptions" @select="onMenu">
|
||||
<n-button size="small" quaternary aria-label="更多">
|
||||
<template #icon><Icon icon="ph:dots-three-bold" /></template>
|
||||
</n-button>
|
||||
</n-dropdown>
|
||||
<n-button size="small" @click="clone">复制一份</n-button>
|
||||
<n-button size="small" title="在前台打开这场比赛" @click="openFront">前台看</n-button>
|
||||
</n-flex>
|
||||
</template>
|
||||
<style scoped></style>
|
||||
@@ -12,7 +12,7 @@ import Actions from "./components/Actions.vue"
|
||||
/**
|
||||
* 后台比赛列表(设计稿「比赛重设计」CtAdminList)。一行一场:比赛名(期中 / 期末挂标,
|
||||
* 要密码的带锁)、开始时间和多长、状态、几道题、几人参加、出卷人、学生看得到;
|
||||
* 操作「编辑」「成绩 / 全班情况」+ ⋯。按开始时间排 —— 原来按创建时间,复制出来的旧比赛
|
||||
* 操作「编辑」「成绩 / 全班情况」「复制一份」「在前台看」直接摆出来。按开始时间排 —— 原来按创建时间,复制出来的旧比赛
|
||||
* 会跑到最前面。ID、标签、类型三列拿掉(标签只在期中 / 期末时挂出来,类型就是那把锁)
|
||||
*/
|
||||
const theme = useThemeVars()
|
||||
@@ -47,7 +47,7 @@ const columns: DataTableColumn<AdminContestListItem>[] = [
|
||||
{
|
||||
title: "比赛",
|
||||
key: "title",
|
||||
minWidth: 220,
|
||||
width: 260,
|
||||
render: (row) =>
|
||||
h("span", { class: "title-cell" }, [
|
||||
h(ContestTitle, { contest: row }),
|
||||
@@ -57,7 +57,7 @@ const columns: DataTableColumn<AdminContestListItem>[] = [
|
||||
{
|
||||
title: "开始 · 多长",
|
||||
key: "start_time",
|
||||
width: 220,
|
||||
width: 200,
|
||||
render: (row) =>
|
||||
h("span", { class: "num" }, [
|
||||
parseTime(row.startTime, "YYYY-MM-DD HH:mm"),
|
||||
@@ -67,7 +67,7 @@ const columns: DataTableColumn<AdminContestListItem>[] = [
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
width: 80,
|
||||
width: 72,
|
||||
render: (row) =>
|
||||
h(
|
||||
"span",
|
||||
@@ -89,7 +89,7 @@ const columns: DataTableColumn<AdminContestListItem>[] = [
|
||||
{
|
||||
title: "出卷",
|
||||
key: "created_by",
|
||||
width: 96,
|
||||
width: 84,
|
||||
ellipsis: { tooltip: true },
|
||||
render: (row) => row.createdBy.username,
|
||||
},
|
||||
@@ -108,7 +108,7 @@ const columns: DataTableColumn<AdminContestListItem>[] = [
|
||||
{
|
||||
title: "",
|
||||
key: "actions",
|
||||
width: 190,
|
||||
minWidth: 270,
|
||||
render: (row) => h(Actions, { contest: row }),
|
||||
},
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user