This commit is contained in:
2024-10-16 20:56:43 +08:00
parent c2a59e8aa1
commit 20813375dd

View File

@@ -59,14 +59,12 @@
班级完成度{{ person.rate }} 班级完成度{{ person.rate }}
</n-gradient-text> </n-gradient-text>
</n-h1> </n-h1>
<n-button <n-flex v-if="listUnaccepted.length > 0" style="margin-top: 8px">
type="warning" <n-button type="warning" @click="toggleUnaccepted(!unaccepted)">
style="margin-top: 8px"
v-if="listUnaccepted.length > 0"
@click="toggleUnaccepted(!unaccepted)"
>
{{ unaccepted ? "隐藏没有完成的" : "显示没有完成的" }} {{ unaccepted ? "隐藏没有完成的" : "显示没有完成的" }}
</n-button> </n-button>
<n-button @click="copyUnaccepted">复制名单</n-button>
</n-flex>
</n-space> </n-space>
<n-h1 v-if="count.total === 0"> <n-h1 v-if="count.total === 0">
<n-gradient-text type="primary">暂无数据统计</n-gradient-text> <n-gradient-text type="primary">暂无数据统计</n-gradient-text>
@@ -91,6 +89,7 @@ interface Props {
const props = defineProps<Props>() const props = defineProps<Props>()
const message = useMessage()
const options: SelectOption[] = [ const options: SelectOption[] = [
{ label: "30分钟内", value: "minutes:30" }, { label: "30分钟内", value: "minutes:30" },
{ label: "本节课内", value: "hours:1" }, { label: "本节课内", value: "hours:1" },
@@ -160,4 +159,14 @@ function removeClassname(name: string) {
} }
return name return name
} }
function copyUnaccepted() {
const grade = query.username.slice(2, 4)
const classname = query.username.slice(4, 5)
const prefix = `${grade}计算机${classname}${query.problem}这道题有${listUnaccepted.value.length}人没有完成,分别是:`
const names = listUnaccepted.value.map(removeClassname).join("、")
const suffix = "。请以上同学尽快完成!"
console.log(prefix+names+suffix)
message.success("到 DevTool 中手动复制")
}
</script> </script>