feat:合并两个窗口
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled

This commit is contained in:
M了个J 2026-05-19 11:49:43 +08:00
parent 43c14e2e02
commit dda7366807

View File

@ -259,15 +259,15 @@ function formatTime(time?: number | string) {
return date.toLocaleString()
}
/** teacher-electron 注入:打开独立屏幕共享窗口 */
async function openTeacherScreenShareWindow(item: ClassroomItem) {
/** teacher-electron:打开课堂管控窗口(教师推屏 + 学员屏幕监控) */
async function openClassroomControlWindow(item: ClassroomItem) {
const api = window.teacherApi
if (!api?.openScreenShareWindow) {
hud.warning('请在教师端桌面客户端中使用「共享屏幕」')
hud.warning('请在教师端桌面客户端中使用「课堂管控」')
return
}
await hud.load({
option: '准备共享屏幕',
option: '准备课堂管控',
task: async () => {
try {
const page = await classStudentService.findPage(1, 999, {
@ -281,34 +281,7 @@ async function openTeacherScreenShareWindow(item: ClassroomItem) {
}
},
error: async () => {
hud.error('打开屏幕共享窗口失败')
},
})
}
/** teacher-electron学员 JPEG 截屏监控窗口 */
async function openStudentScreenMonitorWindow(item: ClassroomItem) {
const openMon = window.teacherApi?.openStudentScreenMonitorWindow
if (!openMon) {
hud.warning('请在教师端桌面客户端中使用「屏幕监控」')
return
}
await hud.load({
option: '准备屏幕监控',
task: async () => {
try {
const page = await classStudentService.findPage(1, 999, {
classId: item.id,
})
const rows = (page as any)?.data?.rows ?? page?.rows ?? []
await openMon(rows, item.name ?? '', item.id)
} catch (error) {
console.error(error)
throw error
}
},
error: async () => {
hud.error('打开屏幕监控窗口失败')
hud.error('打开课堂管控窗口失败')
},
})
}
@ -332,17 +305,8 @@ async function openStudentScreenMonitorWindow(item: ClassroomItem) {
<span class="class-name">{{ item.name }}</span>
</div>
<div class="class-row-actions">
<el-button
type="primary"
@click="openTeacherScreenShareWindow(item)"
>
共享屏幕
</el-button>
<el-button
type="primary"
@click="openStudentScreenMonitorWindow(item)"
>
屏幕监控
<el-button type="primary" @click="openClassroomControlWindow(item)">
课堂管控
</el-button>
</div>
</div>