refactor(课堂任务): 「课堂看板」改名「课堂任务」,地址换成 /task;班级 PK 换成 /pk
- 界面上的「课堂看板」「课堂作业」统一叫「课堂任务」,顶栏、老师首页、后台菜单一起改 - 前端 oj/classroom → oj/task、oj/class → oj/pk,两个名字不再只差几个字母却毫不相干;旧地址不留跳转 - 后端 routes/classroom.ts 拆开:课堂任务的接口进 routes/task.ts(/task/board|lesson|today), 首页的「上次来」「班里在做」进 routes/home.ts;共用的取题口径挪进 services/lesson.ts - 契约 classroom.ts 同样拆成 task.ts / home.ts,ClassBoard* 改叫 TaskBoard* Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
46d3fe2dbe
commit
29c31640b5
82 files changed
+798
-766
No files matched your search
@@ -2,7 +2,7 @@ import { onMounted, ref } from 'vue'
|
||||
import { parseTime } from 'utils/functions'
|
||||
|
||||
/**
|
||||
* 课堂看板的「请假」:老师手动标记今天不在的学生,看板的人数、进度、「还没交过」都不算他们。
|
||||
* 课堂任务的「请假」:老师手动标记今天不在的学生,任务页的人数、进度、「还没交过」都不算他们。
|
||||
*
|
||||
* **今天有效**(按东八区的日子),第二天自动清掉 —— 请假一般是请一整天,原来按两小时算,
|
||||
* 连上两节课的第二节中途人又冒出来,得重标一遍。
|
||||
@@ -11,7 +11,7 @@ import { parseTime } from 'utils/functions'
|
||||
* 换个人、换台机器都不该继承(2026-10 用户定的,不上服务器)。
|
||||
*
|
||||
* 原来叫「请假隐藏」(开关 → 名字变成带 × 的标签 → 点 ×),用户说不会用,2026-10 改成
|
||||
* 看板上一个「请假」按钮勾名单。旧键 `oj_hidden_students` 存的是两小时的过期时刻,
|
||||
* 任务页上一个「请假」按钮勾名单。旧键 `oj_hidden_students` 存的是两小时的过期时刻,
|
||||
* 口径不同,不迁移,直接删掉。
|
||||
*
|
||||
* @param storageKey localStorage 的键
|
||||
@@ -36,7 +36,7 @@ export function useLeaveStudents(storageKey: string) {
|
||||
try {
|
||||
localStorage.setItem(storageKey, JSON.stringify(data))
|
||||
} catch {
|
||||
// 存不下就只在这次打开里有效,不影响看板
|
||||
// 存不下就只在这次打开里有效,不影响任务页
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export function useLeaveStudents(storageKey: string) {
|
||||
|
||||
/**
|
||||
* 把 `usernames` 这批人的标记换成 `selected`:在里面但没选的取消,选了的标上。
|
||||
* 只动这一批(看板上这个班),别的班标着的人不受影响
|
||||
* 只动这一批(任务页上这个班),别的班标着的人不受影响
|
||||
*/
|
||||
function setLeave(usernames: string[], selected: string[]) {
|
||||
const scope = new Set(usernames)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useCollabStore } from 'shared/store/collab'
|
||||
|
||||
/**
|
||||
* 老师接单 / 主动打开学生的编辑器。两处入口(顶栏举手面板、课堂看板)共用。
|
||||
* 老师接单 / 主动打开学生的编辑器。两处入口(顶栏举手面板、课堂任务)共用。
|
||||
*
|
||||
* 只发消息,不跳页面:房间开好(room_open 到了)才跳到那道题,跳转统一在 CollabHost 里做
|
||||
* —— 原来是点完就跳,服务端拒了(别的老师先接走、学生刚走)前端也已经跳过去了。
|
||||
|
||||
@@ -7,9 +7,9 @@ import { useUserStore } from 'shared/store/user'
|
||||
import { getAccessToken } from 'utils/auth'
|
||||
import { STORAGE_KEY } from 'utils/constants'
|
||||
import storage from 'utils/storage'
|
||||
import type { ClassBoardCell } from 'utils/types'
|
||||
import type { TaskBoardCell } from 'utils/types'
|
||||
|
||||
type BoardLatest = NonNullable<ClassBoardCell['latest']>
|
||||
type BoardLatest = NonNullable<TaskBoardCell['latest']>
|
||||
|
||||
// 全站唯一一处,脱离 n-message-provider 也能弹 —— 强制登出跟当前挂着哪个组件无关。
|
||||
// utils/api.ts 里也是这么做的
|
||||
@@ -580,7 +580,7 @@ export interface CollabRequestItem {
|
||||
className: string | null
|
||||
problemId: string
|
||||
problemTitle: string
|
||||
/** 他这道题最后一次代码提交(和看板格子的 latest 同形),面板按它写错法;没交过为 null */
|
||||
/** 他这道题最后一次代码提交(和任务页格子的 latest 同形),面板按它写错法;没交过为 null */
|
||||
latest: BoardLatest | null
|
||||
createdAt: number
|
||||
status: 'pending' | 'active'
|
||||
|
||||
Reference in new issue
Block a user