feat: 批改页加“课堂总结”入口
- 作品墙顶部“开始讲评”旁边加“课堂总结”,用批改页当前的班级和任务打开 - 在批改页里打开时不显示“去批改”;点高分作品直接在批改页里打开, 那个学生不在当前班就先切过去(地址栏跟着切,关掉作品回到那个班) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
54003fd404
commit
915b48ebc0
2 files changed
+52
-8
No files matched your search
@@ -134,7 +134,7 @@
|
||||
</div>
|
||||
</n-spin>
|
||||
|
||||
<template #footer>
|
||||
<template v-if="!inReview" #footer>
|
||||
<n-flex justify="end">
|
||||
<n-button type="primary" icon-placement="right" @click="openReview">
|
||||
去批改{{ isAll ? "" : " " + classname + " 班" }}
|
||||
@@ -153,8 +153,19 @@ import { Submission } from "../../api"
|
||||
import type { TaskStatsOut, TopScoredItem, UserTag } from "../../utils/type"
|
||||
|
||||
// 老师下课前看的这道题的总结:默认看批改页正在看的班
|
||||
const props = defineProps<{ taskId: number; show: boolean; title?: string }>()
|
||||
defineEmits<{ (e: "update:show", v: boolean): void }>()
|
||||
const props = defineProps<{
|
||||
taskId: number
|
||||
show: boolean
|
||||
title?: string
|
||||
// 在批改页里打开:不显示“去批改”,点高分作品直接在批改页里打开
|
||||
inReview?: boolean
|
||||
// 批改页正在看的班级(“__all__” 是全部班级);不传就用记住的
|
||||
initialClass?: string | null
|
||||
}>()
|
||||
const emit = defineEmits<{
|
||||
"update:show": [v: boolean]
|
||||
open: [submissionId: string, classname: string]
|
||||
}>()
|
||||
|
||||
// 和批改页共用“当前班级”
|
||||
const ALL = "__all__"
|
||||
@@ -237,11 +248,11 @@ watch(
|
||||
() => props.show,
|
||||
async (open) => {
|
||||
if (!open || !props.taskId) return
|
||||
let saved: string | null = props.initialClass ?? null
|
||||
try {
|
||||
classname.value = localStorage.getItem(CLASS_KEY) || ALL
|
||||
} catch {
|
||||
classname.value = ALL
|
||||
}
|
||||
saved ||= localStorage.getItem(CLASS_KEY)
|
||||
} catch {}
|
||||
classname.value = saved || ALL
|
||||
await load()
|
||||
// 记住的班级已经没有学生了
|
||||
if (!isAll.value && !stats.value?.classes.includes(classname.value)) {
|
||||
@@ -257,6 +268,10 @@ function openInNewTab(query: Record<string, string>) {
|
||||
}
|
||||
|
||||
function openSubmission(item: TopScoredItem) {
|
||||
if (props.inReview) {
|
||||
emit("open", item.submission_id, item.classname)
|
||||
return
|
||||
}
|
||||
openInNewTab({
|
||||
class: isAll.value ? item.classname : classname.value,
|
||||
task: String(props.taskId),
|
||||
|
||||
Reference in new issue
Block a user