diff --git a/apps/web/src/admin/announcement/components/Actions.vue b/apps/web/src/admin/announcement/components/Actions.vue
index 2d2f11e..978ee98 100644
--- a/apps/web/src/admin/announcement/components/Actions.vue
+++ b/apps/web/src/admin/announcement/components/Actions.vue
@@ -1,9 +1,8 @@
-
+
编辑
-
-
-
-
-
+
+ {{ props.top ? "取消置顶" : "置顶" }}
+
+ 删除
diff --git a/apps/web/src/admin/announcement/list.vue b/apps/web/src/admin/announcement/list.vue
index 85a3dba..b20a390 100644
--- a/apps/web/src/admin/announcement/list.vue
+++ b/apps/web/src/admin/announcement/list.vue
@@ -18,7 +18,7 @@ const announcements = ref([])
/**
* 后台公告列表(设计稿「后台公告」AnnAdmin):一行一条,标题(置顶挂标,公告 / 更新淡淡写在后面)、
- * 发布、改过、学生看得到;「编辑」常驻,置顶 / 删除收进 ⋯。ID、作者(都是同一个人)、
+ * 发布、改过、学生看得到;编辑、置顶、删除直接摆出来。ID、作者(都是同一个人)、
* 精确到秒的两列时间拿掉
*/
const theme = useThemeVars()
@@ -27,7 +27,7 @@ const columns: DataTableColumn[] = [
{
title: "标题",
key: "title",
- minWidth: 300,
+ width: 360,
render: (row) =>
h("span", { class: "title-cell" }, [
h(
@@ -73,7 +73,7 @@ const columns: DataTableColumn[] = [
{
title: "",
key: "actions",
- width: 110,
+ minWidth: 240,
render: (row) =>
h(Actions, {
announcementID: row.id,
diff --git a/apps/web/src/admin/contest/components/Actions.vue b/apps/web/src/admin/contest/components/Actions.vue
index a38100f..0a6cee6 100644
--- a/apps/web/src/admin/contest/components/Actions.vue
+++ b/apps/web/src/admin/contest/components/Actions.vue
@@ -1,5 +1,4 @@
-
+
+
编辑
{{ contest.status === "-1" ? "成绩" : "全班情况" }}
-
-
-
-
-
+ 复制一份
+ 前台看
diff --git a/apps/web/src/admin/contest/list.vue b/apps/web/src/admin/contest/list.vue
index 6cf72be..693882c 100644
--- a/apps/web/src/admin/contest/list.vue
+++ b/apps/web/src/admin/contest/list.vue
@@ -12,7 +12,7 @@ import Actions from "./components/Actions.vue"
/**
* 后台比赛列表(设计稿「比赛重设计」CtAdminList)。一行一场:比赛名(期中 / 期末挂标,
* 要密码的带锁)、开始时间和多长、状态、几道题、几人参加、出卷人、学生看得到;
- * 操作「编辑」「成绩 / 全班情况」+ ⋯。按开始时间排 —— 原来按创建时间,复制出来的旧比赛
+ * 操作「编辑」「成绩 / 全班情况」「复制一份」「在前台看」直接摆出来。按开始时间排 —— 原来按创建时间,复制出来的旧比赛
* 会跑到最前面。ID、标签、类型三列拿掉(标签只在期中 / 期末时挂出来,类型就是那把锁)
*/
const theme = useThemeVars()
@@ -47,7 +47,7 @@ const columns: DataTableColumn[] = [
{
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[] = [
{
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[] = [
{
title: "状态",
key: "status",
- width: 80,
+ width: 72,
render: (row) =>
h(
"span",
@@ -89,7 +89,7 @@ const columns: DataTableColumn[] = [
{
title: "出卷",
key: "created_by",
- width: 96,
+ width: 84,
ellipsis: { tooltip: true },
render: (row) => row.createdBy.username,
},
@@ -108,7 +108,7 @@ const columns: DataTableColumn[] = [
{
title: "",
key: "actions",
- width: 190,
+ minWidth: 270,
render: (row) => h(Actions, { contest: row }),
},
]
diff --git a/apps/web/src/admin/problem/components/Actions.vue b/apps/web/src/admin/problem/components/Actions.vue
index 3ca505a..ed6df49 100644
--- a/apps/web/src/admin/problem/components/Actions.vue
+++ b/apps/web/src/admin/problem/components/Actions.vue
@@ -1,13 +1,12 @@
-
+
编辑
-
-
-
+ 前台看
+ 测试数据
+
+ 转成公开题
+
+
+
+ 删除
-
+
[
{ value: "0" as const, label: "藏着的", count: counts.value?.hidden },
])
-/** 知识点只摆前两个,多的写 +N,鼠标放上去看全部(P073 这类题挂了六个) */
+/**
+ * 知识点:两个以内全摆,多了只摆第一个 + 「+N」,鼠标放上去看全部(P073 这类题挂了六个)。
+ * 列宽只放得下两个,摆两个再加 +N 的话 +N 会被截掉
+ */
function renderTags(tags: string[]) {
if (!tags.length) return h("span", { class: "muted" }, "—")
+ const shown = tags.length > 2 ? tags.slice(0, 1) : tags
return h("span", { class: "tags", title: tags.join("、") }, [
- ...tags.slice(0, 2).map((tag) => h("span", { class: "tag", key: tag }, tag)),
- tags.length > 2 ? h("span", { class: "muted more" }, `+${tags.length - 2}`) : null,
+ ...shown.map((tag) => h("span", { class: "tag", key: tag }, tag)),
+ tags.length > shown.length
+ ? h("span", { class: "muted more" }, `+${tags.length - shown.length}`)
+ : null,
])
}
@@ -146,15 +152,17 @@ const baseColumns: DataTableColumn[] = [
{
title: "题号",
key: "_id",
- width: 84,
+ width: 70,
render: (row) => h("span", { class: "did", title: `内部编号 ${row.id}` }, row._id),
},
- { title: "题目", key: "title", minWidth: 220, ellipsis: false, render: renderTitle },
- { title: "知识点", key: "tags", width: 190, render: (row) => renderTags(row.tags) },
+ // 题目定宽:p90 也就 12 个字加一两个类型标签。原来 minWidth 让它吃掉整行剩余空间(用户嫌空太多),
+ // 剩下的宽度给最后的操作列
+ { title: "题目", key: "title", width: 196, ellipsis: false, render: renderTitle },
+ { title: "知识点", key: "tags", width: 158, render: (row) => renderTags(row.tags) },
{
title: "做对 / 做过",
key: "users",
- width: 100,
+ width: 96,
render: (row) =>
row.triedUsers
? h("span", { class: "num" }, [
@@ -163,11 +171,11 @@ const baseColumns: DataTableColumn[] = [
])
: h("span", { class: "muted" }, "没人做过"),
},
- { title: "出题人", key: "username", width: 100, ellipsis: { tooltip: true } },
+ { title: "出题人", key: "username", width: 86, ellipsis: { tooltip: true } },
{
title: "创建",
key: "create_time",
- width: 96,
+ width: 100,
render: (row) => h("span", { class: "num muted" }, parseTime(row.createTime, "YYYY-MM-DD")),
},
{
@@ -185,7 +193,7 @@ const baseColumns: DataTableColumn[] = [
{
title: "",
key: "actions",
- width: 104,
+ minWidth: 240,
render: (row) =>
h(Actions, {
problemID: row.id,
@@ -385,6 +393,11 @@ watch(() => [query.page, query.limit, query.author, query.kind, query.visible],
opacity: 0.7;
}
+/* 表头不折行:「做对 / 做过」「学生看得到」折成两行时整张表头变高 */
+.problem-table :deep(.n-data-table-th) {
+ white-space: nowrap;
+}
+
.problem-table :deep(.did) {
font-weight: 600;
font-variant-numeric: tabular-nums;
@@ -409,10 +422,11 @@ watch(() => [query.page, query.limit, query.author, query.kind, query.visible],
}
.problem-table :deep(.tags) {
- display: inline-flex;
+ display: flex;
align-items: center;
gap: 4px;
white-space: nowrap;
+ overflow: hidden;
}
.problem-table :deep(.tag) {
@@ -435,5 +449,6 @@ watch(() => [query.page, query.limit, query.author, query.kind, query.visible],
.problem-table :deep(.num) {
font-variant-numeric: tabular-nums;
+ white-space: nowrap;
}
diff --git a/apps/web/src/admin/problem/tags.vue b/apps/web/src/admin/problem/tags.vue
index 93f0791..a088b05 100644
--- a/apps/web/src/admin/problem/tags.vue
+++ b/apps/web/src/admin/problem/tags.vue
@@ -1,5 +1,4 @@
-
+
重置密码
-
-
-
-
-
+ 编辑
+
+ {{ props.user.isDisabled ? "解除禁用" : "禁用" }}
+
+ 删除
diff --git a/apps/web/src/admin/user/list.vue b/apps/web/src/admin/user/list.vue
index 0f73064..827909f 100644
--- a/apps/web/src/admin/user/list.vue
+++ b/apps/web/src/admin/user/list.vue
@@ -96,7 +96,9 @@ const columns: DataTableColumn[] = [
{
title: "用户名",
key: "username",
- minWidth: 200,
+ // 定宽:用户名一般就 ks + 班号 + 两三个字,原来 minWidth 让它把整行剩下的空都吃掉了(用户嫌空太多)。
+ // 剩下的宽度给最后的操作列,操作直接摆出来
+ width: 230,
render: (row) => h(UserNameCell, { user: row }),
},
{
@@ -133,7 +135,7 @@ const columns: DataTableColumn[] = [
{
key: "actions",
title: "",
- width: 130,
+ minWidth: 300,
render: (row) =>
h(Actions, {
user: row,