style(提交列表): 「重新判题」是右上角最显眼的按钮,上课却最用不上,收进「⋯」

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-30 08:47:57 +08:00
1 parent b19fc3c1d9
commit cb2fb57fdb
1 file changed
+58 -39
@@ -210,12 +210,27 @@ function caseColor(result: number) {
} }
const canRejudge = computed(() => props.teacher && !props.contest) const canRejudge = computed(() => props.teacher && !props.contest)
const moreOptions = computed(() => [ /**
{ label: "复制回到题目", key: "problem" }, * 老师的「⋯」:复制两项 + 重新判题。重判不常用、点错了会真的重判,所以不放在外面当最显眼的
...(shown.value?.language !== "SQL" ? [{ label: "复制到自测猫", key: "cat" }] : []), * 那个按钮。代码还没拉下来时只有重判一项 —— 代码拉不下来的那条,恰恰可能要重判
]) */
const moreOptions = computed(() => {
const copy = shown.value
? [
{ label: "复制回到题目", key: "problem" },
...(shown.value.language !== "SQL" ? [{ label: "复制到自测猫", key: "cat" }] : []),
]
: []
if (!canRejudge.value) return copy
return [
...copy,
...(copy.length ? [{ type: "divider", key: "divider" }] : []),
{ label: "重新判题", key: "rejudge" },
]
})
function handleMore(key: string) { function handleMore(key: string) {
if (key === "rejudge") return emit("rejudge", props.row.id)
if (!shown.value) return if (!shown.value) return
if (key === "problem") copyToProblem(shown.value) if (key === "problem") copyToProblem(shown.value)
else copyToCat(shown.value) else copyToCat(shown.value)
@@ -285,46 +300,50 @@ function openStandalone() {
题单 {{ row.problemSet.title }} 题单 {{ row.problemSet.title }}
</a> </a>
<div class="spacer"></div> <div class="spacer"></div>
<!-- 重判不用等代码拉下来:代码拉不下来的那条,恰恰可能要重判 --> <template v-if="teacher">
<n-button v-if="canRejudge" size="small" @click="emit('rejudge', row.id)"> <n-button
<template #icon><Icon icon="ph:arrow-clockwise" /></template> v-if="shown"
重新判题 size="small"
</n-button> quaternary
<template v-if="shown"> title="新页面打开(有测试点明细)"
<template v-if="teacher"> aria-label="新页面打开"
@click="openStandalone"
>
<template #icon><Icon icon="ph:arrow-square-out" /></template>
</n-button>
<n-dropdown
v-if="moreOptions.length"
:options="moreOptions"
trigger="click"
@select="handleMore"
>
<n-button <n-button
size="small" size="small"
quaternary quaternary
title="新页面打开(有测试点明细)" aria-label="更多"
aria-label="新页面打开" :title="moreOptions.flatMap((o) => ('label' in o ? [o.label] : [])).join('、')"
@click="openStandalone"
> >
<template #icon><Icon icon="ph:arrow-square-out" /></template> <template #icon><Icon icon="ph:dots-three-bold" /></template>
</n-button> </n-button>
<n-dropdown :options="moreOptions" trigger="click" @select="handleMore"> </n-dropdown>
<n-button size="small" quaternary aria-label="更多" title="复制回到题目、复制到自测猫"> </template>
<template #icon><Icon icon="ph:dots-three-bold" /></template> <template v-else-if="shown">
</n-button> <n-button size="small" type="primary" @click="copyToProblem(shown)">
</n-dropdown> <template #icon><Icon icon="ph:arrow-u-up-left" /></template>
</template> 复制回到题目
<template v-else> </n-button>
<n-button size="small" type="primary" @click="copyToProblem(shown)"> <n-button v-if="shown.language !== 'SQL'" size="small" @click="copyToCat(shown)">
<template #icon><Icon icon="ph:arrow-u-up-left" /></template> 复制到自测猫
复制回到题目 </n-button>
</n-button> <n-button
<n-button v-if="shown.language !== 'SQL'" size="small" @click="copyToCat(shown)"> size="small"
复制到自测猫 quaternary
</n-button> title="新页面打开"
<n-button aria-label="新页面打开"
size="small" @click="openStandalone"
quaternary >
title="新页面打开" <template #icon><Icon icon="ph:arrow-square-out" /></template>
aria-label="新页面打开" </n-button>
@click="openStandalone"
>
<template #icon><Icon icon="ph:arrow-square-out" /></template>
</n-button>
</template>
</template> </template>
</div> </div>