< template >
< div class = "task-review" v-loading ="loading" >
< aside class = "task-review__sidebar" >
< el -form label -position = " top " class = "task-review__filters" >
< el -form -item label = "实训项目" >
< el -select v-model ="filters.projectName" placeholder="请选择实训项目" clearable @change="onProjectChange" >
< el -option v -for = " project in review.projects " :key ="project" :label ="project" :value ="project" / >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "实训任务" >
< el -select v-model ="filters.taskId" placeholder="请选择实训任务" :disabled="!filters.classId" @change="loadReview" >
< el -option v -for = " task in review.tasks " :key ="task.taskId" :label ="task.taskName" :value ="task.taskId" / >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "教学班级" >
< el -select v-model ="filters.classId" placeholder="请选择教学班" @change="onClassChange" >
< el -option v -for = " item in teachingClasses " :key ="item.schoolClassId" :label ="item.className" :value ="item.schoolClassId" / >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< div class = "task-review__list-head" >
< span > 学生列表 ( { { review . students . length } } ) < / span >
< div class = "task-review__list-actions" >
< el -button type = "default" size = "small" : disabled = "!canBatchScore || batchAiScoring" :loading ="batchAiScoring" @click ="onBatchAiScore" > {{ batchAiScoring ? " 正 在 评 分 ... " : " 批 量 AI 评 分 " }} < span v-if ="batchAiCompleted && !batchAiScoring" class="task-review__ai-dot" title="AI评分完成" > < / span > < / el -button >
< el -button type = "primary" size = "small" : disabled = "!canBatchScore || batchAiScoring" @ click = "batchDialogVisible = true" > 批量打分 < / e l - b u t t o n >
< / div >
< / div >
< el -table ref = "studentTableRef" class = "task-review__student-table" :data ="paginatedStudents" border size = "small" row -key = " studentUserId " highlight -current -row :row-class-name ="studentRowClass" @selection-change ="onSelectionChange" @row-click ="selectStudent" >
< el -table -column type = "selection" width = "42" :selectable ="canSelectStudent" / >
< el -table -column prop = "name" label = "姓名" width = "86" show -overflow -tooltip / >
< el -table -column prop = "username" label = "学号" width = "102" show -overflow -tooltip / >
< el -table -column label = "AI评分" width = "86" align = "center" >
< template # default = "{ row }" >
< button
v - if = "row.aiAssessmentScore !== null && row.aiAssessmentScore !== undefined"
type = "button"
class = "task-review__ai-score-btn"
title = "点击查看AI评分详情"
@ click . stop = "openAiScorePopover(row)"
>
{ { formatScore ( row . aiAssessmentScore ) } } < span v-if ="batchAiScoredIds.has(row.studentUserId)" class="task-review__ai-dot" title="AI评分完成" > < / span >
< / button >
< span v-else > {{ formatScore ( row.aiAssessmentScore ) }} < span v-if ="batchAiScoredIds.has(row.studentUserId)" class="task-review__ai-dot" title="AI评分完成" > < / span > < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "老师评分" min -width = " 118 " align = "center" >
< template # default = "{ row }" >
< template v-if ="canManageClass && row.scorable" >
< span v-if ="row.teacherScore !== null && row.teacherScore !== undefined" class="task-review__teacher-score" > {{ formatScore ( row.teacherScore ) }} < / span >
< el -button type = "primary" size = "small" text @click ="openScoreDialog(row)" > {{ row.teacherScore = = = null | | row.teacherScore = = = undefined ? " 评 阅 " : " 修 改 " }} < / el -button >
< / template >
< el -tag v -else -if = " ! row.scorable " size = "small" type = "info" > 未完成 < / e l - t a g >
< span v-else > {{ formatScore ( row.teacherScore ) }} < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< el -pagination v -if = " review.students.length > pagination . pageSize " v-model:current-page=" pagination . currentPage " v-model:page-size=" pagination . pageSize " :page-sizes=" [ 10 , 20 , 50 , 100 ] " :total=" review . students . length " layout=" total , sizes , prev , pager , next , jumper " class=" task - review _ _pagination " small background @current-change=" onPageChange " @size-change=" onPageSizeChange " / >
< p v-if ="!canManageClass && filters.classId" class="task-review__readonly-tip" > 仅 班 级 创 建 教 师 可 评 分 < / p >
< / aside >
< section class = "task-review__content" >
< template v-if ="selectedStudent && review.selectedTask" >
< header class = "task-review__student-head" >
< div >
< h2 > { { selectedStudent . name || selectedStudent . username } } < / h2 >
< p > { { review . selectedTask . projectName } } · { { review . selectedTask . taskName } } < / p >
< / div >
< div class = "task-review__head-actions" >
< button type = "button" class = "task-review__action-btn" @click ="onViewReferenceAnswer" >
< el -icon > < DocumentCopy / > < / e l - i c o n >
查看参考答案
< / button >
< button type = "button" class = "task-review__action-btn task-review__action-btn--primary" :disabled ="aiAssistEvaluating" @click ="onAiAssistEvaluation" >
< el -icon v-if ="aiAssistEvaluating" class="is-loading" > < Loading / > < / e l - i c o n >
< el -icon v-else > < CirclePlus / > < / e l - i c o n >
{ { aiAssistEvaluating ? "正在评分..." : "AI助评" } }
< / button >
< / div >
< / header >
< div class = "task-review__scores-section" >
< div class = "task-review__scores" >
< span class = "task-review__score-item" >
< span class = "task-review__score-label" > AI评分 < / span >
< strong class = "task-review__score-value" > { { formatScore ( selectedStudent . aiAssessmentScore ) } } < / strong >
< / span >
< span class = "task-review__score-item" >
< span class = "task-review__score-label" > 老师评分 < / span >
< strong class = "task-review__score-value" > { { formatScore ( selectedStudent . teacherScore ) } } < / strong >
< / span >
< / div >
< / div >
<!-- 定位壳 : 遮罩必须是滚动容器的兄弟节点 。 放在滚动容器内部时 ,
absolute inset : 0 锚定的是滚动内容顶部 , 容器滚下去后遮罩只剩一条灰边 ,
盖不住实际可见区域 。 -- >
< div v-if ="studentPreviewSrc" class="task-review__student-preview-wrap" >
< div ref = "previewScrollRef" class = "task-review__student-preview-scroll" >
<!--
不加 : key 、 不随学生切换重建 src : iframe 只冷启动一次 ,
之后切换学生通过 postMessage 热切换 , 避免每次重载整个 SPA 。
-- >
< iframe ref = "previewFrameRef" class = "task-review__student-preview" :src ="studentPreviewSrc" : style = "{ height: `${previewFrameHeight}px` }" scrolling = "yes" title = "学生任务页面只读预览" / >
< / div >
<!-- 加载遮罩 : 等内嵌页报告 「 组件 + 接口 + DOM 全部就绪 」 后才揭幕 -- >
< transition name = "task-review-preview-fade" >
< div v-if ="previewLoading" class="task-review__preview-loading" >
< div class = "task-review__preview-loading-spinner" aria -hidden = " true " > < / div >
< div class = "task-review__preview-loading-text" > 正在加载学生作答 < / div >
< div class = "task-review__preview-loading-subtext" > 正在准备页面与作答数据 , 请稍候 … < / div >
< / div >
< / transition >
< / div >
< el -empty v -else : description = "studentPreviewError || '当前任务暂不支持页面预览'" :image-size ="104" / >
< / template >
< el -empty v -else description = "请选择教学班和实训任务后查看学生任务步骤" :image-size ="128" / >
< / section >
< el -dialog v-model ="singleScoreDialogVisible" width="480px" append-to-body :show-close="false" class="score-review-dialog" @closed="resetSingleScoreForm" >
< template # header >
< div class = "dialog-header" >
< div class = "dialog-header-main" >
< span class = "dialog-badge" >
< el -icon > < EditPen / > < / e l - i c o n >
任务评阅
< / span >
< h3 class = "dialog-title" > { { singleScoreForm . studentName } } < / h3 >
< / div >
< button type = "button" class = "dialog-close" @ click = "singleScoreDialogVisible = false" >
< el -icon > < Close / > < / e l - i c o n >
< / button >
< / div >
< / template >
< el -form ref = "singleScoreFormRef" label -position = " top " :model ="singleScoreForm" class = "score-review-form" >
< el -form -item label = "老师评分" class = "score-review-form__score" >
< div class = "score-input-wrapper" >
< el -input -number v -model = " singleScoreForm.score " :min ="0" :max ="100" :precision ="0" :controls ="false" placeholder = "0-100" class = "score-number-input" / >
< span class = "score-unit" > 分 < / span >
< / div >
< / e l - f o r m - i t e m >
< el -form -item : label = "generatingComment ? '评语( AI 生成中...) ' : '评语'" class = "score-review-form__comment" >
< el -input v -model = " singleScoreForm.comment " type = "textarea" :rows ="4" placeholder = "请输入对学生任务完成情况的评价(可选),打开评阅时会按 AI 评分/助学数据自动生成 10-50 字评语" maxlength = "1000" show -word -limit class = "score-comment-textarea" / >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< template # footer >
< div class = "dialog-footer" >
< button type = "button" class = "dialog-btn dialog-btn--cancel" @ click = "singleScoreDialogVisible = false" > 取消 < / button >
< button type = "button" class = "dialog-btn dialog-btn--primary" :disabled ="savingSingleScore" @click ="saveSingleScoreDialog" >
< el -icon v-if ="savingSingleScore" > < Loading / > < / e l - i c o n >
< el -icon v-else > < CircleCheck / > < / e l - i c o n >
{ { savingSingleScore ? "保存中..." : "确认评阅" } }
< / button >
< / div >
< / template >
< / e l - d i a l o g >
< el -dialog
v - model = "batchDialogVisible"
width = "480px"
append - to - body
: show - close = "false"
class = "score-review-dialog"
@ closed = "
batchScore = null ;
batchComment = null ;
"
>
< template # header >
< div class = "dialog-header" >
< div class = "dialog-header-main" >
< span class = "dialog-badge" >
< el -icon > < DocumentChecked / > < / e l - i c o n >
批量打分
< / span >
< h3 class = "dialog-title" > 已选择 { { selectedStudents . length } } 名学生 < / h3 >
< / div >
< button type = "button" class = "dialog-close" @ click = "batchDialogVisible = false" >
< el -icon > < Close / > < / e l - i c o n >
< / button >
< / div >
< / template >
< el -form label -position = " top " class = "score-review-form" @submit.prevent ="saveBatchScore" >
< el -form -item label = "统一打分" class = "score-review-form__score" >
< div class = "score-input-wrapper" >
< el -input -number v -model = " batchScore " :min ="0" :max ="100" :precision ="0" :controls ="false" placeholder = "0-100" class = "score-number-input" / >
< span class = "score-unit" > 分 < / span >
< / div >
< / e l - f o r m - i t e m >
< el -form -item label = "统一评语" class = "score-review-form__comment" >
< el -input v -model = " batchComment " type = "textarea" :rows ="4" placeholder = "请输入对选中学生的统一评价(可选)" maxlength = "1000" show -word -limit class = "score-comment-textarea" / >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< template # footer >
< div class = "dialog-footer" >
< button type = "button" class = "dialog-btn dialog-btn--cancel" @ click = "batchDialogVisible = false" > 取消 < / button >
< button type = "button" class = "dialog-btn dialog-btn--primary" :disabled ="savingBatch" @click ="saveBatchScore" >
< el -icon v-if ="savingBatch" > < Loading / > < / e l - i c o n >
< el -icon v-else > < CircleCheck / > < / e l - i c o n >
{ { savingBatch ? "保存中..." : "确认打分" } }
< / button >
< / div >
< / template >
< / e l - d i a l o g >
< el -dialog v-model ="batchAiScoreDialogVisible" width="520px" append-to-body :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false" class="score-review-dialog batch-ai-score-dialog" >
< template # header >
< div class = "dialog-header" >
< div class = "dialog-header-main" >
< span class = "dialog-badge" >
< el -icon > < TrendCharts / > < / e l - i c o n >
批量AI评分
< / span >
< h3 class = "dialog-title" > 已选择 { { selectedStudents . length } } 名学生 < / h3 >
< / div >
< button v-if ="batchAiScoreProgress.status !== 'running'" type="button" class="dialog-close" @click="closeBatchAiScoreDialog" >
< el -icon > < Close / > < / e l - i c o n >
< / button >
< / div >
< / template >
< div class = "batch-ai-score-content" >
<!-- 状态说明 -- >
< div v-if ="batchAiScoreProgress.status === 'idle'" class="batch-ai-info" >
< p class = "batch-ai-info__title" > 准备开始批量AI评分 < / p >
< p class = "batch-ai-info__desc" > AI将自动分析已选中学生的作业内容 , 并生成评分结果 。 此过程可能需要几分钟 , 请耐心等待 。 < / p >
< ul class = "batch-ai-info__list" >
< li > AI会根据任务要求和评分标准进行评估 < / li >
< li > 评分维度包括内容完整性 、 分析深度 、 创新性等 < / li >
< li > 评分完成后可在学生列表中查看AI评分 < / li >
< / ul >
< / div >
<!-- 进度条和状态 -- >
< div v-if ="batchAiScoreProgress.status !== 'idle'" class="batch-ai-progress" >
< div class = "batch-ai-progress__stats" >
< div class = "batch-ai-progress__stat" >
< span class = "batch-ai-progress__label" > 总计 < / span >
< strong class = "batch-ai-progress__value" > { { batchAiScoreProgress . total } } < / strong >
< / div >
< div class = "batch-ai-progress__stat batch-ai-progress__stat--success" >
< span class = "batch-ai-progress__label" > 成功 < / span >
< strong class = "batch-ai-progress__value" > { { batchAiScoreProgress . successCount } } < / strong >
< / div >
< div class = "batch-ai-progress__stat batch-ai-progress__stat--fail" >
< span class = "batch-ai-progress__label" > 失败 < / span >
< strong class = "batch-ai-progress__value" > { { batchAiScoreProgress . failCount } } < / strong >
< / div >
< / div >
< div class = "batch-ai-progress__bar-wrapper" >
< el -progress : percentage = "Math.floor((batchAiScoreProgress.current / batchAiScoreProgress.total) * 100)" : status = "batchAiScoreProgress.status === 'completed' ? 'success' : batchAiScoreProgress.status === 'failed' ? 'exception' : undefined" :stroke-width ="12" / >
< p class = "batch-ai-progress__text" > { { batchAiScoreProgress . current } } / { { batchAiScoreProgress . total } } < / p >
< / div >
< p v-if ="batchAiScoreProgress.status === 'running'" class="batch-ai-progress__tip" >
< el -icon class = "is-loading" > < Loading / > < / e l - i c o n >
正在进行AI评分 , 请稍候 ...
< / p >
< p v-if ="batchAiScoreProgress.status === 'completed'" class="batch-ai-progress__tip batch-ai-progress__tip--success" >
< el -icon > < CircleCheck / > < / e l - i c o n >
批量AI评分已完成 !
< / p >
< p v-if ="batchAiScoreProgress.status === 'failed'" class="batch-ai-progress__tip batch-ai-progress__tip--error" > AI 评 分 过 程 中 出 现 错 误 , 请 重 试 < / p >
< / div >
< / div >
< template # footer >
< div class = "dialog-footer" >
< button v-if ="batchAiScoreProgress.status === 'idle'" type="button" class="dialog-btn dialog-btn--cancel" @click="batchAiScoreDialogVisible = false" > 取 消 < / button >
< button v-if ="batchAiScoreProgress.status === 'idle'" type="button" class="dialog-btn dialog-btn--primary" @click="startBatchAiScore" >
< el -icon > < TrendCharts / > < / e l - i c o n >
开始AI评分
< / button >
< button v-if ="batchAiScoreProgress.status === 'completed' || batchAiScoreProgress.status === 'failed'" type="button" class="dialog-btn dialog-btn--primary" @click="closeBatchAiScoreDialog" > 关 闭 < / button >
< / div >
< / template >
< / e l - d i a l o g >
< el -dialog v-model ="aiAssistEvalDialogVisible" width="420px" append-to-body :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false" class="score-review-dialog ai-assist-eval-dialog" >
< template # header >
< div class = "dialog-header" >
< div class = "dialog-header-main" >
< span class = "dialog-badge" >
< el -icon > < TrendCharts / > < / e l - i c o n >
AI助评
< / span >
< h3 class = "dialog-title" > { { selectedStudent ? . name || selectedStudent ? . username } } < / h3 >
< / div >
< / div >
< / template >
< div class = "ai-assist-eval-content" >
< div class = "ai-assist-eval-loading" >
< el -icon class = "ai-assist-eval-loading__icon" > < Loading / > < / e l - i c o n >
< p class = "ai-assist-eval-loading__text" > AI正在分析学生作业 ... < / p >
< p class = "ai-assist-eval-loading__desc" > 这可能需要15 - 30 秒 , 请稍候 < / p >
< / div >
< / div >
< / e l - d i a l o g >
< el -dialog v-model ="aiScoreDetailVisible" width="640px" append-to-body :show-close="false" class="ai-score-detail-dialog" >
< template # header >
< div class = "dialog-header" >
< div class = "dialog-header-main" >
< span class = "dialog-badge" >
< el -icon > < TrendCharts / > < / e l - i c o n >
AI评分结果
< / span >
< h3 class = "dialog-title" > { { aiScoreDetailStudent || "AI评分结果" } } < / h3 >
< / div >
< button type = "button" class = "dialog-close" @ click = "aiScoreDetailVisible = false" >
< el -icon > < Close / > < / e l - i c o n >
< / button >
< / div >
< / template >
< div class = "ai-score-detail" >
<!-- 综合评分 -- >
< div class = "ai-score-summary" >
< div class = "ai-score-summary__main" >
< span class = "ai-score-summary__label" > 综合评分 < / span >
< div class = "ai-score-summary__score" >
< span class = "ai-score-summary__number" > { { aiScoreDetailData . totalScore ? ? "--" } } < / span >
< span class = "ai-score-summary__total" > / { { aiScoreDetailData . totalFullScore } } < / span >
< / div >
< / div >
< p v-if ="aiScoreDetailData.comment" class="ai-score-summary__comment" > {{ aiScoreDetailData.comment }} < / p >
< / div >
<!-- 各维度评分 -- >
< div v-if ="aiScoreDetailData.dimensions.length > 0" class="ai-score-dimensions" >
< div v-for ="(dimension, index) in aiScoreDetailData.dimensions" :key="index" class="ai-score-dimension" >
< div class = "ai-score-dimension__head" >
< h4 class = "ai-score-dimension__title" > { { dimension . name } } < / h4 >
< span class = "ai-score-dimension__score" >
< strong > { { dimension . score ? ? "--" } } < / strong >
< span > / { { dimension . fullScore } } < / span >
< / span >
< / div >
< p v-if ="dimension.analysis" class="ai-score-dimension__analysis" > {{ dimension.analysis }} < / p >
< / div >
< / div >
<!-- 优先改进 -- >
< div v-if ="aiScoreDetailData.improvements.length > 0" class="ai-score-improvements" >
< h4 class = "ai-score-improvements__title" > 优先改进 < / h4 >
< ul class = "ai-score-improvements__list" >
< li v-for ="(improvement, index) in aiScoreDetailData.improvements" :key ="index" >
{ { improvement } }
< / li >
< / ul >
< / div >
<!-- 无数据提示 -- >
< el -empty v -if = " ! aiScoreDetailData.totalScore & & aiScoreDetailData.dimensions.length = = = 0 " description = "暂无AI评分详情数据" :image-size ="120" / >
< / div >
< / e l - d i a l o g >
< el -dialog
v - model = "referenceAnswerDialogVisible"
title = "参考答案"
width = "min(1000px, calc(100vw - 32px))"
top = "5vh"
append - to - body
draggable
destroy - on - close
: fullscreen = "referenceAnswerMaximized"
: show - close = "false"
class = "reference-answer-dialog"
@ closed = "referenceAnswerMaximized = false"
>
< template # header = "{ close, titleId, titleClass }" >
< div class = "reference-answer-heading" >
< div class = "reference-answer-heading__title" >
< h2 :id ="titleId" :class ="titleClass" > 参考答案 < / h2 >
< span class = "reference-answer-heading__hint" > { { referenceAnswerMaximized ? '还原窗口后可移动和调整大小' : '拖动标题栏移动,拖动右下角调整大小' } } < / span >
< / div >
< div class = "reference-answer-heading__actions" @ mousedown.stop >
< button type = "button" class = "reference-answer-window-button"
: aria - label = "referenceAnswerMaximized ? '还原窗口' : '最大化窗口'"
: title = "referenceAnswerMaximized ? '还原窗口' : '最大化窗口'"
: aria - pressed = "referenceAnswerMaximized" @ click = "referenceAnswerMaximized = !referenceAnswerMaximized" >
< el -icon > < CopyDocument v -if = " referenceAnswerMaximized " / > < FullScreen v -else / > < / e l - i c o n >
< / button >
< button type = "button" class = "reference-answer-window-button" aria -label = " 关 闭 参 考 答 案 " title = "关闭" @click ="close" >
< el -icon > < Close / > < / e l - i c o n >
< / button >
< / div >
< / div >
< / template >
< iframe v -if = " referenceAnswerSrc " :src ="referenceAnswerSrc" class = "reference-answer-frame" title = "参考答案在线预览" / >
< el -empty v -else description = "暂无可预览的参考答案" / >
< / e l - d i a l o g >
< / div >
< / template >
< script setup >
import { ElMessage } from "element-plus" ;
import { EditPen , DocumentChecked , Close , CircleCheck , Loading , DocumentCopy , CopyDocument , FullScreen , CirclePlus , TrendCharts } from "@element-plus/icons-vue" ;
import * as teacherApi from "@/api/teacher" ;
import { listClassTrainingTasks } from "@/api/trainingTask" ;
import useUserStore from "@/store/modules/user" ;
import { clearTrainingReviewPreview , writeTrainingReviewPreview } from "@/utils/trainingReviewPreview" ;
const props = defineProps ( {
teachingClassList : { type : Array , default : ( ) => [ ] } ,
initialClassId : { type : String , default : "" } ,
} ) ;
const userStore = useUserStore ( ) ;
const currentUserId = computed ( ( ) => String ( userStore . userInfo . userId || "" ) ) ;
const isManagerTeacher = computed ( ( ) => userStore . userInfo . teacherAdmin === true ) ;
const fallbackTeachingClassList = ref ( [ ] ) ;
const filterTeachingClasses = ( classes ) => ( classes || [ ] ) . filter ( ( item ) =>
item . classType === "TEACHING"
&& ( isManagerTeacher . value || String ( item . createdBy || "" ) === currentUserId . value )
) ;
const teachingClasses = computed ( ( ) => filterTeachingClasses (
props . teachingClassList . length ? props . teachingClassList : fallbackTeachingClassList . value ,
) ) ;
const filters = ref ( { classId : "" , projectName : "" , taskId : "" } ) ;
const review = ref ( { projects : [ ] , tasks : [ ] , selectedTask : null , students : [ ] } ) ;
const loading = ref ( false ) ;
const savingBatch = ref ( false ) ;
const batchDialogVisible = ref ( false ) ;
const batchScore = ref ( null ) ;
const batchComment = ref ( "" ) ;
const singleScoreDialogVisible = ref ( false ) ;
const savingSingleScore = ref ( false ) ;
const generatingComment = ref ( false ) ;
const singleScoreFormRef = ref ( ) ;
const singleScoreForm = ref ( { studentId : "" , studentName : "" , score : null , comment : "" } ) ;
const selectedStudents = ref ( [ ] ) ;
const selectedStudentId = ref ( "" ) ;
const studentTableRef = ref ( ) ;
const previewKey = ref ( "" ) ;
const studentPreviewSrc = ref ( "" ) ;
const studentPreviewError = ref ( "" ) ;
const previewFrameHeight = ref ( 580 ) ;
const previewLoading = ref ( false ) ;
let previewRequestVersion = 0 ;
const PREVIEW _HEIGHT _MESSAGE = "teacher-task-review-preview-height" ;
/* 与内嵌预览页 StudentTaskReadonlyPreview.vue 约定的热切换协议 */
const PREVIEW _READY _MESSAGE = "teacher-task-review-preview-ready" ;
const PREVIEW _PUSH _MESSAGE = "teacher-task-review-preview-load" ;
const PREVIEW _LOADED _MESSAGE = "teacher-task-review-preview-loaded" ;
const previewFrameRef = ref ( ) ;
const previewScrollRef = ref ( ) ;
const previewFrameReady = ref ( false ) ;
let pendingPreviewPush = null ;
/* 遮罩兜底:内嵌页闸门 8s 会强制放行并上报 loaded, 这里再加一层保险防消息丢失 */
const PREVIEW _LOADING _FALLBACK _DELAY = 12000 ;
let previewLoadingFallbackTimer = 0 ;
/* 班级实训任务配置只依赖班级,与学生无关;按班级缓存,切学生不再重复请求 */
const classTasksCache = new Map ( ) ;
// AI评分详情悬浮层:锚定在学生列表 AI评分 一栏,点击分数弹出该生评分结果
const aiScoreDetailVisible = ref ( false ) ;
const aiScoreDetailStudent = ref ( "" ) ;
const aiScoreDetailData = ref ( {
totalScore : null ,
totalFullScore : 100 ,
comment : "" ,
dimensions : [ ] ,
improvements : [ ] ,
} ) ;
const batchAiScoreDialogVisible = ref ( false ) ;
const batchAiScoring = ref ( false ) ;
const batchAiCompleted = ref ( false ) ;
const batchAiScoredIds = ref ( new Set ( ) ) ;
const batchAiScoreProgress = ref ( {
total : 0 ,
current : 0 ,
successCount : 0 ,
failCount : 0 ,
status : "idle" , // 'idle' | 'running' | 'completed' | 'failed'
} ) ;
const aiAssistEvalDialogVisible = ref ( false ) ;
const aiAssistEvaluating = ref ( false ) ;
const referenceAnswerDialogVisible = ref ( false ) ;
const referenceAnswerMaximized = ref ( false ) ;
const referenceAnswerSrc = ref ( "" ) ;
let referenceAnswerObjectUrl = "" ;
const pagination = ref ( {
currentPage : 1 ,
pageSize : 10 ,
} ) ;
const canManageClass = computed ( ( ) => {
const currentClass = teachingClasses . value . find ( ( item ) => item . schoolClassId === filters . value . classId ) ;
return Boolean ( currentClass )
&& ( isManagerTeacher . value || String ( currentClass . createdBy || "" ) === currentUserId . value ) ;
} ) ;
const selectedStudent = computed ( ( ) => review . value . students . find ( ( row ) => row . studentUserId === selectedStudentId . value ) || review . value . students [ 0 ] || null ) ;
const canBatchScore = computed ( ( ) => canManageClass . value && selectedStudents . value . length > 0 && Boolean ( filters . value . taskId ) ) ;
const paginatedStudents = computed ( ( ) => {
const students = review . value . students ;
const start = ( pagination . value . currentPage - 1 ) * pagination . value . pageSize ;
const end = start + pagination . value . pageSize ;
return students . slice ( start , end ) ;
} ) ;
watch (
teachingClasses ,
( classes ) => {
if ( ! filters . value . classId && classes . length ) {
const ownTeachingClass = classes . find ( ( schoolClass ) => String ( schoolClass . createdBy || "" ) === String ( userStore . userInfo . userId || "" ) ) ;
filters . value . classId = ownTeachingClass ? . schoolClassId || "" ;
if ( filters . value . classId ) loadReview ( ) ;
}
} ,
{ immediate : true } ,
) ;
watch ( [ selectedStudent , ( ) => review . value . selectedTask ] , refreshStudentPreview , { immediate : true , flush : "post" } ) ;
async function refreshStudentPreview ( ) {
const requestVersion = ++ previewRequestVersion ;
if ( previewKey . value ) clearTrainingReviewPreview ( previewKey . value ) ;
const taskKey = review . value . selectedTask ? . taskKey ;
const teachingClassId = filters . value . classId ;
const student = selectedStudent . value ;
studentPreviewError . value = "" ;
previewFrameHeight . value = 580 ;
if ( ! student || ! taskKey || ! teachingClassId ) {
previewKey . value = "" ;
studentPreviewSrc . value = "" ;
previewFrameReady . value = false ;
pendingPreviewPush = null ;
clearPreviewLoading ( ) ;
return ;
}
try {
// 班级任务列表返回该班实际生效的配置:教师覆盖优先,未覆盖时使用管理员案例。
const tasks = await getClassTrainingTasks ( teachingClassId ) ;
if ( requestVersion !== previewRequestVersion ) return ;
const effectiveTask = tasks . find ( ( task ) => task . taskKey === taskKey ) ;
if ( ! effectiveTask ) throw new Error ( "未找到该教学班的有效实训案例" ) ;
const nextPreviewKey = ` review- ${ Date . now ( ) } - ${ Math . random ( ) . toString ( 36 ) . slice ( 2 ) } ` ;
writeTrainingReviewPreview ( nextPreviewKey , {
taskKey ,
teachingClassId ,
taskConfig : effectiveTask ,
answer : { ... student } ,
} ) ;
previewKey . value = nextPreviewKey ;
if ( ! studentPreviewSrc . value ) {
/* 首次:带 query 冷启动 iframe, 由预览页自行加载上下文 */
studentPreviewSrc . value = ` ${ window . location . pathname } #/task-review-preview?taskKey= ${ encodeURIComponent ( taskKey ) } &reviewPreviewKey= ${ encodeURIComponent ( nextPreviewKey ) } ` ;
} else {
/* 复用已加载的 iframe 热切换学生/任务,免去整页重载(渲染慢的主因) */
pushPreviewToFrame ( { type : PREVIEW _PUSH _MESSAGE , taskKey , previewKey : nextPreviewKey } ) ;
}
startPreviewLoading ( ) ;
} catch ( error ) {
if ( requestVersion !== previewRequestVersion ) return ;
previewKey . value = "" ;
studentPreviewSrc . value = "" ;
previewFrameReady . value = false ;
pendingPreviewPush = null ;
clearPreviewLoading ( ) ;
/* 把真实失败原因透出给教师,避免只有一句通用文案没法排查 */
console . error ( "[task-review] 实训案例加载失败" , error ) ;
studentPreviewError . value = ` 该教学班的实训案例加载失败: ${ error ? . message || "未知错误" } ` ;
}
}
/* 遮罩从开始加载一直盖到内嵌页上报 loaded( 组件+接口+DOM 全就绪) */
function startPreviewLoading ( ) {
previewLoading . value = true ;
/ * 重 置 滚 动 位 置 : 否 则 新 学 生 的 预 览 会 停 留 在 上 一 个 学 生 的 滚 动 深 度 ,
遮罩揭开后直接看到页面中间 , 还以为内容错位了 * /
previewScrollRef . value ? . scrollTo ( { top : 0 , left : 0 } ) ;
if ( previewLoadingFallbackTimer ) clearTimeout ( previewLoadingFallbackTimer ) ;
previewLoadingFallbackTimer = setTimeout ( clearPreviewLoading , PREVIEW _LOADING _FALLBACK _DELAY ) ;
}
function clearPreviewLoading ( ) {
if ( previewLoadingFallbackTimer ) clearTimeout ( previewLoadingFallbackTimer ) ;
previewLoadingFallbackTimer = 0 ;
previewLoading . value = false ;
}
async function getClassTrainingTasks ( classId ) {
if ( classTasksCache . has ( classId ) ) return classTasksCache . get ( classId ) ;
const response = await listClassTrainingTasks ( classId , { enabledOnly : false } ) ;
const tasks = response ? . data || [ ] ;
classTasksCache . set ( classId , tasks ) ;
return tasks ;
}
/* iframe 未就绪(首次加载中)时暂存最新一条推送,收到 ready 握手后补发 */
function pushPreviewToFrame ( payload ) {
if ( ! previewFrameReady . value ) {
pendingPreviewPush = payload ;
return ;
}
pendingPreviewPush = null ;
previewFrameRef . value ? . contentWindow ? . postMessage ( payload , window . location . origin ) ;
}
function onPreviewMessage ( event ) {
if ( event . origin !== window . location . origin ) return ;
const data = event . data || { } ;
if ( data . type === PREVIEW _READY _MESSAGE ) {
previewFrameReady . value = true ;
if ( pendingPreviewPush ) pushPreviewToFrame ( pendingPreviewPush ) ;
return ;
}
if ( data . type === PREVIEW _LOADED _MESSAGE ) {
/* 内嵌页闸门放行:组件挂载 + 接口返回 + DOM 稳定,揭掉遮罩 */
if ( data . previewKey === previewKey . value ) clearPreviewLoading ( ) ;
return ;
}
if ( data . type !== PREVIEW _HEIGHT _MESSAGE || data . previewKey !== previewKey . value ) return ;
const height = Number ( data . height ) ;
if ( Number . isFinite ( height ) && height > 0 ) previewFrameHeight . value = Math . max ( 580 , Math . ceil ( height ) ) ;
}
function formatScore ( score ) {
return score === null || score === undefined || score === "" ? "--" : score ;
}
function normalizeReview ( data ) {
const students = ( data ? . students || [ ] ) . map ( ( row ) => ( { ... row } ) ) ;
review . value = { projects : data ? . projects || [ ] , tasks : data ? . tasks || [ ] , selectedTask : data ? . selectedTask || null , students } ;
const selectedTask = review . value . selectedTask ;
filters . value . taskId = selectedTask ? . taskId || "" ;
if ( selectedTask && ! filters . value . projectName ) filters . value . projectName = selectedTask . projectName || "" ;
if ( ! students . some ( ( row ) => row . studentUserId === selectedStudentId . value ) ) selectedStudentId . value = students [ 0 ] ? . studentUserId || "" ;
selectedStudents . value = [ ] ;
studentTableRef . value ? . clearSelection ( ) ;
// 重置分页到第一页
pagination . value . currentPage = 1 ;
}
async function loadReview ( ) {
if ( ! filters . value . classId ) return ;
loading . value = true ;
try {
/ *
* 首次进入 / 切换班级时 , 前端还不知道该选哪个实训项目 , 因此首个请求不带
* projectName ; 后端在 projectName 为空时不会按项目联动过滤 , 会把该教学班的
* 全部实训任务都返回回来 。 normalizeReview 随后用 selectedTask 回填了
* projectName , 但任务列表仍停留在 "全量" 那份数据上 , 表现为 :
* 「 实训任务 」 下拉展示了全部任务 , 手动重选一次实训项目才恢复正常 。
* 这里在回填出 projectName 后按该项目重新查一次 , 保证两个下拉始终联动一致 。
* /
const requestedProject = filters . value . projectName ;
const res = await teacherApi . getTaskReview ( { ... filters . value } ) ;
normalizeReview ( res . data ) ;
if ( ! requestedProject && filters . value . projectName ) {
const projectRes = await teacherApi . getTaskReview ( { ... filters . value } ) ;
const projectTasks = projectRes ? . data ? . tasks || [ ] ;
const currentTaskListed = projectTasks . some ( ( task ) => String ( task . taskId ) === String ( filters . value . taskId ) ) ;
if ( currentTaskListed ) {
// 常规路径:只替换「实训任务」下拉的选项,不动 selectedTask 与学生列表,
// 避免多触发一次右侧学生页预览重建(预览页会真实发起接口请求)。
review . value = {
... review . value ,
projects : projectRes . data . projects || review . value . projects ,
tasks : projectTasks ,
} ;
} else if ( projectTasks . length ) {
// 兜底:过滤后不含当前任务时整体刷新,保证下拉值与选中任务一致。
normalizeReview ( projectRes . data ) ;
}
}
} finally {
loading . value = false ;
}
}
async function loadTeachingClasses ( ) {
if ( props . teachingClassList . length ) return ;
const res = await teacherApi . getAccessibleTeachingClasses ( ) ;
fallbackTeachingClassList . value = filterTeachingClasses ( res . data || [ ] ) ;
}
function onClassChange ( ) {
filters . value . projectName = "" ;
filters . value . taskId = "" ;
loadReview ( ) ;
}
function onProjectChange ( ) {
filters . value . taskId = "" ;
loadReview ( ) ;
}
function onSelectionChange ( rows ) {
selectedStudents . value = rows ;
}
function canSelectStudent ( row ) {
return canManageClass . value && Boolean ( row . scorable ) ;
}
function selectStudent ( row ) {
selectedStudentId . value = row . studentUserId ;
}
function onPageChange ( page ) {
pagination . value . currentPage = page ;
}
function onPageSizeChange ( pageSize ) {
pagination . value . pageSize = pageSize ;
pagination . value . currentPage = 1 ;
}
function studentRowClass ( { row } ) {
return row . studentUserId === selectedStudentId . value ? "task-review__selected-row" : "" ;
}
async function saveBatchScore ( ) {
if ( ! Number . isInteger ( batchScore . value ) || batchScore . value < 0 || batchScore . value > 100 ) {
ElMessage . error ( "请输入0至100之间的整数分数" ) ;
return ;
}
savingBatch . value = true ;
try {
await teacherApi . batchSaveTaskTeacherScore ( {
classId : filters . value . classId ,
taskId : filters . value . taskId ,
studentUserIds : selectedStudents . value . map ( ( row ) => row . studentUserId ) ,
teacherScore : batchScore . value ,
teacherComment : batchComment . value ? . trim ( ) || "" ,
} ) ;
ElMessage . success ( "批量任务评分保存成功" ) ;
batchDialogVisible . value = false ;
await loadReview ( ) ;
} finally {
savingBatch . value = false ;
}
}
let aiCommentRequestToken = 0 ;
async function openScoreDialog ( row ) {
const requestToken = ++ aiCommentRequestToken ;
// 教师已保存过的评语优先展示,不被 AI 生成覆盖
singleScoreForm . value = {
studentId : row . studentUserId ,
studentName : row . name || row . username ,
score : row . teacherScore ? ? null ,
comment : row . teacherComment || "" ,
} ;
singleScoreDialogVisible . value = true ;
if ( row . teacherComment ) return ;
// 点击评阅时让 AI 基于该生的 AI 评分与助学报告生成 10-50 字评语并填入
generatingComment . value = true ;
try {
const response = await teacherApi . generateTaskAiComment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserId : row . studentUserId } ) ;
const comment = response ? . data ? . comment || "" ;
if ( requestToken === aiCommentRequestToken && comment ) {
singleScoreForm . value = { ... singleScoreForm . value , comment } ;
}
} catch {
// AI 评分数据缺失或生成失败时保留空评语,教师可手填
} finally {
if ( requestToken === aiCommentRequestToken ) generatingComment . value = false ;
}
}
function resetSingleScoreForm ( ) {
singleScoreForm . value = { studentId : "" , studentName : "" , score : null , comment : "" } ;
singleScoreFormRef . value ? . clearValidate ( ) ;
}
async function saveSingleScoreDialog ( ) {
const score = singleScoreForm . value . score ;
if ( score === null || score === undefined || score === "" ) {
ElMessage . error ( "请输入0至100之间的整数分数" ) ;
return ;
}
if ( ! Number . isInteger ( score ) || score < 0 || score > 100 ) {
ElMessage . error ( "教师评分必须为0至100之间的整数" ) ;
return ;
}
savingSingleScore . value = true ;
try {
await teacherApi . saveTaskTeacherScore ( {
classId : filters . value . classId ,
studentUserId : singleScoreForm . value . studentId ,
taskId : filters . value . taskId ,
teacherScore : score ,
teacherComment : singleScoreForm . value . comment ? . trim ( ) || "" ,
} ) ;
ElMessage . success ( "任务评分保存成功" ) ;
singleScoreDialogVisible . value = false ;
await loadReview ( ) ;
} finally {
savingSingleScore . value = false ;
}
}
onMounted ( ( ) => {
window . addEventListener ( "message" , onPreviewMessage ) ;
loadTeachingClasses ( ) ;
} ) ;
onBeforeUnmount ( ( ) => {
window . removeEventListener ( "message" , onPreviewMessage ) ;
clearTrainingReviewPreview ( previewKey . value ) ;
} ) ;
// ========== 新增方法 ==========
function onViewReferenceAnswer ( ) {
if ( ! review . value . selectedTask ? . referenceAnswerUrl ) {
ElMessage . info ( "该任务暂未上传参考答案,请先在编辑任务中上传" ) ;
return ;
}
if ( referenceAnswerObjectUrl ) URL . revokeObjectURL ( referenceAnswerObjectUrl ) ;
referenceAnswerSrc . value = "" ;
teacherApi . previewTaskReferenceAnswer ( { classId : filters . value . classId , taskId : filters . value . taskId } ) . then ( ( response ) => {
const blob = response instanceof Blob ? response : new Blob ( [ response ] , { type : "application/pdf" } ) ;
referenceAnswerObjectUrl = URL . createObjectURL ( blob ) ;
// Chromium 使用 navpanes 控制侧栏; 保留工具栏, pagemode 兼容其他查看器。
referenceAnswerSrc . value = ` ${ referenceAnswerObjectUrl } #navpanes=0&toolbar=1&pagemode=none ` ;
referenceAnswerDialogVisible . value = true ;
} ) . catch ( ( error ) => {
// 404 = 任务未上传参考答案;其余才是预览流程异常
if ( error ? . response ? . status === 404 ) ElMessage . info ( "该任务暂未上传参考答案,请先在编辑任务中上传" ) ;
else ElMessage . error ( "参考答案预览失败,请稍后重试" ) ;
} ) ;
}
function onBatchAiScore ( ) {
if ( ! selectedStudents . value || selectedStudents . value . length === 0 ) return ;
batchAiScoreDialogVisible . value = true ;
batchAiCompleted . value = false ;
batchAiScoredIds . value = new Set ( ) ;
batchAiScoreProgress . value = {
total : selectedStudents . value . length ,
current : 0 ,
successCount : 0 ,
failCount : 0 ,
status : "idle" ,
} ;
}
async function startBatchAiScore ( ) {
batchAiScoring . value = true ;
batchAiScoreProgress . value . status = "running" ;
batchAiScoreProgress . value . current = 0 ;
batchAiScoreProgress . value . successCount = 0 ;
batchAiScoreProgress . value . failCount = 0 ;
try {
await teacherApi . startBatchTaskAiAssessment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserIds : selectedStudents . value . map ( ( student ) => student . studentUserId ) } ) ;
const pending = new Set ( selectedStudents . value . map ( ( student ) => student . studentUserId ) ) ;
const succeeded = new Set ( ) ;
while ( pending . size ) {
await new Promise ( ( resolve ) => setTimeout ( resolve , 1500 ) ) ;
for ( const studentId of Array . from ( pending ) ) {
try {
const response = await teacherApi . getTaskAiAssessment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserId : studentId } ) ;
const status = response ? . data ? . assessmentStatus ;
if ( status === "SUCCEEDED" || status === "FAILED" ) {
pending . delete ( studentId ) ;
if ( status === "SUCCEEDED" ) { batchAiScoreProgress . value . successCount ++ ; succeeded . add ( studentId ) ; }
else batchAiScoreProgress . value . failCount ++ ;
batchAiScoreProgress . value . current ++ ;
}
} catch { pending . delete ( studentId ) ; batchAiScoreProgress . value . failCount ++ ; batchAiScoreProgress . value . current ++ ; }
}
}
batchAiScoreProgress . value . status = "completed" ;
batchAiScoredIds . value = succeeded ;
batchAiCompleted . value = true ;
ElMessage . success ( ` AI评分完成! 成功 ${ batchAiScoreProgress . value . successCount } 名学生,失败 ${ batchAiScoreProgress . value . failCount } 名 ` ) ;
// 延迟关闭对话框
setTimeout ( ( ) => {
batchAiScoreDialogVisible . value = false ;
loadReview ( ) ;
} , 2000 ) ;
} catch ( error ) {
batchAiScoreProgress . value . status = "failed" ;
ElMessage . error ( "批量AI评分发生错误" ) ;
} finally {
batchAiScoring . value = false ;
}
}
function closeBatchAiScoreDialog ( ) {
if ( batchAiScoreProgress . value . status === "running" ) {
ElMessage . warning ( "正在进行中,请等待..." ) ;
return ;
}
batchAiScoreDialogVisible . value = false ;
}
async function onAiAssistEvaluation ( ) {
if ( ! selectedStudent . value ) return ;
aiAssistEvalDialogVisible . value = true ;
aiAssistEvaluating . value = true ;
try {
await teacherApi . startTaskAiAssessment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserId : selectedStudent . value . studentUserId } ) ;
let response ;
for ( let attempt = 0 ; attempt < 80 ; attempt ++ ) {
await new Promise ( ( resolve ) => setTimeout ( resolve , 1500 ) ) ;
response = await teacherApi . getTaskAiAssessment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserId : selectedStudent . value . studentUserId } ) ;
if ( [ "SUCCEEDED" , "FAILED" ] . includes ( response ? . data ? . assessmentStatus ) ) break ;
}
if ( response ? . data ? . assessmentStatus !== "SUCCEEDED" ) throw new Error ( "AI评分未完成" ) ;
await loadReview ( ) ;
aiAssistEvalDialogVisible . value = false ;
} catch ( error ) {
ElMessage . error ( "AI助评失败, 请重试" ) ;
} finally {
aiAssistEvaluating . value = false ;
}
}
// 点击学生列表 AI评分 一栏的分数:在分数旁悬浮展示该生的 AI 评分结果
async function openAiScorePopover ( row ) {
aiScoreDetailStudent . value = row . name || row . username || "" ;
aiScoreDetailVisible . value = true ;
try {
const response = await teacherApi . getTaskAiAssessment ( { classId : filters . value . classId , taskId : filters . value . taskId , studentUserId : row . studentUserId } ) ;
applyAiDetail ( response ? . data || { } ) ;
} catch { ElMessage . error ( "获取AI评分详情失败" ) ; }
}
function applyAiDetail ( data ) {
let report = { } ;
try { report = data . assessmentReportJson ? JSON . parse ( data . assessmentReportJson ) : { } ; } catch { report = { } ; }
aiScoreDetailData . value = {
totalScore : data . assessmentScore ? ? report . score ? ? null ,
totalFullScore : 100 ,
comment : data . assessmentComment || report . overallComment || report . overallDiagnosis || "" ,
dimensions : Array . isArray ( report . criteria ) ? report . criteria . map ( ( item ) => ( { name : item . name , score : item . score , fullScore : item . maxScore , analysis : item . rationale } ) ) : [ ] ,
improvements : Array . isArray ( report . improvements ) ? report . improvements : [ ] ,
} ;
}
< / script >
< style lang = "scss" scoped >
. task - review {
display : grid ;
grid - template - columns : minmax ( 440 px , 520 px ) minmax ( 0 , 1 fr ) ;
min - height : calc ( 100 vh - 142 px ) ;
overflow : hidden ;
background : # ffffff ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - card ) ;
/* ===== 左侧栏 ===== */
. task - review _ _sidebar {
min - width : 0 ;
padding : var ( -- sp - 5 ) ;
border - right : 1 px solid var ( -- border - color ) ;
overflow : auto ;
}
/* ===== 筛选(白卡)===== */
. task - review _ _filters {
display : grid ;
grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ;
gap : var ( -- sp - 3 ) ;
padding : var ( -- sp - 4 ) ;
background : # ffffff ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - card ) ;
: deep ( . el - form - item ) {
margin - bottom : 0 ;
}
: deep ( . el - select ) {
width : 100 % ;
}
}
. task - review _ _list - head {
display : flex ;
align - items : center ;
justify - content : space - between ;
margin : var ( -- sp - 4 ) 0 var ( -- sp - 1 ) ;
color : var ( -- text - strong ) ;
font - size : var ( -- fs - card ) ;
font - weight : 700 ;
}
. task - review _ _list - actions {
display : flex ;
gap : 8 px ;
}
. task - review _ _score - input {
width : 70 px ;
}
. task - review _ _teacher - score {
margin - right : 4 px ;
color : var ( -- edu - primary , # 2563 eb ) ;
font - weight : 700 ;
}
/* AI评分一栏:可点击的分数(悬浮展示评分结果) */
. task - review _ _ai - score - btn {
padding : 0 ;
color : var ( -- student - success , # 16 a34a ) ;
font - weight : 700 ;
background : transparent ;
border : 0 ;
cursor : pointer ;
}
. task - review _ _ai - score - btn : hover {
text - decoration : underline ;
}
/* AI评分完成小绿点 */
. task - review _ _ai - dot {
display : inline - block ;
width : 6 px ;
height : 6 px ;
margin - left : 4 px ;
vertical - align : middle ;
background : # 22 c55e ;
border - radius : 50 % ;
}
/* ===== 学生表格(纯白 + 灰线)===== */
. task - review _ _student - table {
width : 100 % ;
background : # ffffff ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - card ) ;
overflow : hidden ;
: deep ( . el - table _ _header - wrapper th ) {
background : # ffffff ;
color : var ( -- text - strong ) ;
font - weight : 600 ;
font - size : var ( -- fs - body ) ;
}
: deep ( . el - table _ _body tr : hover > td ) {
background : # f9fafb ! important ;
}
: deep ( . task - review _ _selected - row > td ) {
background : # f9fafb ! important ;
}
: deep ( . el - table _ _cell ) {
font - size : var ( -- fs - body ) ;
color : var ( -- text - strong ) ;
border - color : var ( -- border - color ) ;
}
: deep ( . cell ) {
padding : 0 10 px ;
}
: deep ( th . cell ) {
white - space : nowrap ;
}
}
. task - review _ _readonly - tip {
margin : var ( -- sp - 3 ) 0 0 ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - body ) ;
}
. task - review _ _pagination {
margin : 12 px 0 0 ;
display : flex ;
justify - content : flex - end ;
: deep ( . el - pagination ) {
font - size : var ( -- fs - body ) ;
}
}
/* ===== 右侧预览区 ===== */
. task - review _ _content {
position : relative ;
min - width : 0 ;
padding : var ( -- sp - 5 ) ;
}
. task - review _ _student - head {
display : flex ;
align - items : flex - start ;
justify - content : space - between ;
gap : var ( -- sp - 5 ) ;
padding : 0 0 var ( -- sp - 5 ) ;
border - bottom : 1 px solid var ( -- border - color ) ;
h2 {
margin : 0 ;
color : var ( -- text - strong ) ;
font - size : var ( -- fs - page ) ;
line - height : 1.35 ;
}
p {
margin : var ( -- sp - 2 ) 0 0 ;
color : var ( -- text - body ) ;
font - size : var ( -- fs - body ) ;
}
}
. task - review _ _head - actions {
display : flex ;
gap : 8 px ;
flex : 0 0 auto ;
}
. task - review _ _action - btn {
display : inline - flex ;
align - items : center ;
justify - content : center ;
gap : 6 px ;
height : 36 px ;
padding : 0 14 px ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - sm , 6 px ) ;
background : var ( -- surface - card , # ffffff ) ;
color : var ( -- text - body ) ;
font - size : var ( -- fs - body - sm , 13 px ) ;
font - weight : 600 ;
white - space : nowrap ;
cursor : pointer ;
transition : all 0.16 s ease ;
. el - icon {
font - size : 14 px ;
}
& : hover {
border - color : var ( -- primary - color , # 2563 eb ) ;
background : var ( -- primary - soft , # eff6ff ) ;
color : var ( -- primary - color , # 2563 eb ) ;
transform : translateY ( - 1 px ) ;
box - shadow : var ( -- shadow - sm , 0 2 px 6 px rgba ( 15 , 23 , 42 , 0.08 ) ) ;
}
& : active {
transform : translateY ( 0 ) ;
}
}
. task - review _ _action - btn -- primary {
border - color : var ( -- primary - color , # 2563 eb ) ;
background : var ( -- primary - color , # 2563 eb ) ;
color : var ( -- text - inverse , # ffffff ) ;
box - shadow : var ( -- shadow - primary , 0 3 px 10 px rgba ( 37 , 99 , 235 , 0.2 ) ) ;
& : hover {
border - color : var ( -- primary - deep , # 1 d4ed8 ) ;
background : var ( -- primary - deep , # 1 d4ed8 ) ;
color : # ffffff ;
box - shadow : var ( -- shadow - primary - hover , 0 5 px 14 px rgba ( 29 , 78 , 216 , 0.24 ) ) ;
transform : translateY ( - 1 px ) ;
}
}
. task - review _ _scores - section {
padding : var ( -- sp - 4 ) 0 0 ;
}
. task - review _ _scores {
display : flex ;
gap : var ( -- sp - 2 ) ;
color : var ( -- text - body ) ;
font - size : var ( -- fs - body ) ;
white - space : nowrap ;
. task - review _ _score - item {
display : flex ;
align - items : center ;
gap : 8 px ;
padding : var ( -- sp - 1 ) var ( -- sp - 2 ) ;
border : 1 px solid var ( -- border - color ) ;
border - radius : 999 px ;
background : # ffffff ;
cursor : default ;
transition : all 0.16 s ease ;
& : is ( button ) {
cursor : pointer ;
& : hover {
border - color : # 2563 eb ;
background : # eff6ff ;
transform : translateY ( - 1 px ) ;
box - shadow : 0 2 px 6 px rgba ( 37 , 99 , 235 , 0.12 ) ;
. task - review _ _score - label {
color : # 2563 eb ;
}
. task - review _ _score - value {
color : # 2563 eb ;
}
}
}
}
. task - review _ _score - label {
color : var ( -- text - body ) ;
font - size : var ( -- fs - body ) ;
transition : color 0.16 s ease ;
}
. task - review _ _score - value {
color : var ( -- edu - primary ) ;
font - size : var ( -- fs - num ) ;
font - weight : 700 ;
transition : color 0.16 s ease ;
}
}
. task - review _ _student - preview - scroll {
position : relative ;
height : calc ( 100 vh - 260 px ) ;
min - height : 580 px ;
margin - top : var ( -- sp - 5 ) ;
overflow : auto ;
scrollbar - gutter : stable ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - card ) ;
}
/* 预览加载遮罩:定位壳的兄弟层,盖住整个预览可视区,等内嵌页就绪后淡出 */
. task - review _ _student - preview - wrap {
position : relative ;
}
. task - review _ _preview - loading {
position : absolute ;
inset : 0 ;
z - index : 20 ;
display : flex ;
flex - direction : column ;
align - items : center ;
justify - content : center ;
gap : 14 px ;
background : # f6f8fb ;
user - select : none ;
}
. task - review _ _preview - loading - spinner {
width : 44 px ;
height : 44 px ;
border - radius : 50 % ;
border : 3 px solid # dbe4f0 ;
border - top - color : # 2563 eb ;
animation : task - review - preview - spin 0.85 s linear infinite ;
}
. task - review _ _preview - loading - text {
font - size : 15 px ;
font - weight : 600 ;
color : # 1 f2937 ;
letter - spacing : 0.5 px ;
}
. task - review _ _preview - loading - subtext {
font - size : 13 px ;
color : # 8 a94a6 ;
}
. task - review - preview - fade - leave - active {
transition : opacity 0.28 s ease ;
}
. task - review - preview - fade - leave - to {
opacity : 0 ;
}
@ keyframes task - review - preview - spin {
to { transform : rotate ( 360 deg ) ; }
}
. task - review _ _student - preview {
display : block ;
width : 100 % ;
min - height : 580 px ;
border : 0 ;
}
}
/* 批量打分弹窗( append-to-body, 取不到根类令牌时按令牌值兜底) */
. task - review _ _batch - copy {
margin : 0 0 var ( -- sp - 4 , 16 px ) ;
color : var ( -- text - body ) ;
}
. task - review _ _batch - input {
width : 100 % ;
}
. task - review _ _form - item - readonly {
: deep ( . el - form - item _ _content ) {
color : var ( -- text - strong ) ;
font - weight : 500 ;
}
}
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* 评阅对话框 - 教育蓝极简风格 ( append - to - body )
* === === === === === === === === === === === === === === === === === === === === * /
: deep ( . score - review - dialog ) {
border - radius : 16 px ;
overflow : hidden ;
. el - dialog _ _header {
margin : 0 ;
padding : 0 ;
border - bottom : 1 px solid # e5e7eb ;
}
. el - dialog _ _body {
padding : 24 px ;
}
. el - dialog _ _footer {
padding : 0 ;
}
}
. dialog - header {
display : flex ;
align - items : flex - start ;
justify - content : space - between ;
gap : 16 px ;
}
. dialog - header - main {
display : grid ;
gap : 8 px ;
min - width : 0 ;
flex : 1 ;
}
. dialog - badge {
display : inline - flex ;
align - items : center ;
gap : 6 px ;
padding : 4 px 12 px ;
border : 1 px solid rgba ( 37 , 99 , 235 , 0.2 ) ;
border - radius : 999 px ;
color : # 2563 eb ;
background : # eff6ff ;
font - size : 12 px ;
font - weight : 700 ;
width : fit - content ;
. el - icon {
font - size : 13 px ;
}
}
. dialog - title {
margin : 0 ;
color : # 1 f2937 ;
font - size : 17 px ;
font - weight : 700 ;
line - height : 1.35 ;
}
. dialog - close {
flex : 0 0 auto ;
display : flex ;
align - items : center ;
justify - content : center ;
width : 32 px ;
height : 32 px ;
padding : 0 ;
border : 1 px solid # e5e7eb ;
border - radius : 8 px ;
background : # ffffff ;
color : # 6 b7280 ;
cursor : pointer ;
transition : all 0.16 s ease ;
& : hover {
border - color : # 2563 eb ;
background : # eff6ff ;
color : # 2563 eb ;
}
. el - icon {
font - size : 16 px ;
}
}
. score - review - form {
. el - form - item {
margin - bottom : 20 px ;
& : last - child {
margin - bottom : 0 ;
}
}
: deep ( . el - form - item _ _label ) {
margin - bottom : 8 px ;
color : # 374151 ;
font - size : 13 px ;
font - weight : 600 ;
line - height : 1.5 ;
}
}
. score - review - form _ _score {
. score - input - wrapper {
display : flex ;
align - items : center ;
gap : 12 px ;
}
. score - number - input {
flex : 1 ;
width : auto ;
: deep ( . el - input _ _wrapper ) {
padding : 12 px 16 px ;
border - radius : 10 px ;
background : # fafbfc ;
border : 1 px solid # e5e7eb ;
box - shadow : none ;
transition : all 0.16 s ease ;
& : hover {
border - color : # 3 b82f6 ;
background : # ffffff ;
}
& . is - focus {
border - color : # 2563 eb ;
background : # ffffff ;
box - shadow : 0 0 0 3 px rgba ( 37 , 99 , 235 , 0.12 ) ;
}
}
: deep ( . el - input _ _inner ) {
color : # 1 f2937 ;
font - size : 20 px ;
font - weight : 700 ;
font - family : var ( -- el - font - family ) , ui - monospace , "SF Mono" , Consolas , monospace ;
text - align : left ;
& : : placeholder {
color : # 9 ca3af ;
font - weight : 600 ;
}
}
}
. score - unit {
flex : 0 0 auto ;
color : # 6 b7280 ;
font - size : 14 px ;
font - weight : 600 ;
}
}
. score - review - form _ _comment {
. score - comment - textarea {
: deep ( . el - textarea _ _inner ) {
padding : 12 px 14 px ;
border - radius : 10 px ;
border : 1 px solid # e5e7eb ;
background : # fafbfc ;
color : # 1 f2937 ;
font - size : 13 px ;
line - height : 1.6 ;
resize : vertical ;
min - height : 100 px ;
transition : all 0.16 s ease ;
& : hover {
border - color : # 3 b82f6 ;
background : # ffffff ;
}
& : focus {
border - color : # 2563 eb ;
background : # ffffff ;
box - shadow : 0 0 0 3 px rgba ( 37 , 99 , 235 , 0.12 ) ;
}
& : : placeholder {
color : # 9 ca3af ;
}
}
: deep ( . el - input _ _count ) {
color : # 9 ca3af ;
background : transparent ;
font - size : 11 px ;
line - height : 1 ;
}
}
}
. dialog - footer {
display : flex ;
align - items : center ;
justify - content : flex - end ;
gap : 10 px ;
padding : 16 px 24 px ;
border - top : 1 px solid # e5e7eb ;
background : # fafbfc ;
}
. dialog - btn {
display : inline - flex ;
align - items : center ;
justify - content : center ;
gap : 6 px ;
height : 40 px ;
padding : 0 20 px ;
border : 1 px solid transparent ;
border - radius : 10 px ;
font - size : 13 px ;
font - weight : 700 ;
line - height : 1 ;
cursor : pointer ;
transition : all 0.16 s ease ;
white - space : nowrap ;
. el - icon {
font - size : 14 px ;
}
& : disabled {
opacity : 0.5 ;
cursor : not - allowed ;
transform : none ! important ;
}
}
. dialog - btn -- cancel {
border - color : # e5e7eb ;
color : # 6 b7280 ;
background : # ffffff ;
& : hover : not ( : disabled ) {
border - color : # d1d5db ;
color : # 374151 ;
background : # f9fafb ;
}
}
. dialog - btn -- primary {
border - color : # 2563 eb ;
color : # ffffff ;
background : # 2563 eb ;
box - shadow : 0 3 px 10 px rgba ( 37 , 99 , 235 , 0.28 ) ;
& : hover : not ( : disabled ) {
border - color : # 1 d4ed8 ;
background : # 1 d4ed8 ;
box - shadow : 0 5 px 14 px rgba ( 29 , 78 , 216 , 0.32 ) ;
transform : translateY ( - 1 px ) ;
}
& : active : not ( : disabled ) {
transform : translateY ( 0 ) ;
}
}
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* AI评分详情弹窗 - 居中弹窗展示 , 不受列表行数影响
* === === === === === === === === === === === === === === === === === === === === * /
: deep ( . ai - score - detail - dialog ) {
border - radius : var ( -- r - card , 12 px ) ;
. el - dialog _ _header {
margin : 0 ;
padding : 18 px 24 px ;
border - bottom : 1 px solid var ( -- border - color ) ;
}
. el - dialog _ _body {
padding : 20 px 24 px 24 px ;
max - height : 64 vh ;
overflow - y : auto ;
}
}
. ai - score - detail {
display : flex ;
flex - direction : column ;
gap : 18 px ;
}
/* 综合评分:大分数 + 评语分层展示 */
. ai - score - summary {
padding : 16 px 20 px ;
border : 1 px solid rgba ( 37 , 99 , 235 , 0.18 ) ;
border - radius : 12 px ;
background : # eff6ff ;
}
. ai - score - summary _ _main {
display : flex ;
align - items : center ;
justify - content : space - between ;
gap : 16 px ;
}
. ai - score - summary _ _label {
color : var ( -- text - body , # 374151 ) ;
font - size : 14 px ;
font - weight : 600 ;
}
. ai - score - summary _ _score {
display : flex ;
align - items : baseline ;
gap : 6 px ;
}
. ai - score - summary _ _number {
color : var ( -- primary - color , # 2563 eb ) ;
font - size : 40 px ;
font - weight : 700 ;
line - height : 1 ;
font - family : ui - monospace , "SF Mono" , Consolas , monospace ;
}
. ai - score - summary _ _total {
color : var ( -- text - muted , # 6 b7280 ) ;
font - size : 14 px ;
font - weight : 600 ;
}
. ai - score - summary _ _comment {
margin : 12 px 0 0 ;
padding - top : 12 px ;
border - top : 1 px dashed rgba ( 37 , 99 , 235 , 0.25 ) ;
color : var ( -- text - body , # 374151 ) ;
font - size : 14 px ;
line - height : 1.8 ;
}
/* 逐项评分:独立卡片,标题+得分一行,评析另起 */
. ai - score - dimensions {
display : flex ;
flex - direction : column ;
gap : 12 px ;
}
. ai - score - dimension {
padding : 14 px 16 px ;
border : 1 px solid var ( -- border - color , # e5e7eb ) ;
border - radius : 10 px ;
background : # fafbfc ;
}
. ai - score - dimension _ _head {
display : flex ;
align - items : center ;
justify - content : space - between ;
gap : 12 px ;
}
. ai - score - dimension _ _title {
margin : 0 ;
color : var ( -- text - strong , # 111827 ) ;
font - size : 14 px ;
font - weight : 700 ;
flex : 1 ;
}
. ai - score - dimension _ _score {
display : flex ;
align - items : baseline ;
gap : 4 px ;
white - space : nowrap ;
strong {
color : var ( -- primary - color , # 2563 eb ) ;
font - size : 17 px ;
font - weight : 700 ;
font - family : ui - monospace , "SF Mono" , Consolas , monospace ;
}
span {
color : var ( -- text - muted , # 6 b7280 ) ;
font - size : 13 px ;
font - weight : 600 ;
}
}
. ai - score - dimension _ _analysis {
margin : 8 px 0 0 ;
color : var ( -- text - secondary , # 4 b5563 ) ;
font - size : 13 px ;
line - height : 1.75 ;
}
/* 优先改进 */
. ai - score - improvements {
padding : 14 px 16 px ;
border : 1 px solid rgba ( 239 , 68 , 68 , 0.18 ) ;
border - radius : 10 px ;
background : # fef2f2 ;
}
. ai - score - improvements _ _title {
margin : 0 0 8 px ;
color : # b91c1c ;
font - size : 14 px ;
font - weight : 700 ;
}
. ai - score - improvements _ _list {
margin : 0 ;
padding - left : 18 px ;
}
. ai - score - improvements _ _list li {
margin - bottom : 6 px ;
color : var ( -- text - body , # 374151 ) ;
font - size : 13 px ;
line - height : 1.8 ;
}
. ai - score - improvements _ _list li : last - child {
margin - bottom : 0 ;
}
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* 批量AI评分对话框
* === === === === === === === === === === === === === === === === === === === === * /
. batch - ai - score - content {
display : grid ;
gap : var ( -- sp - 5 ) ;
}
. batch - ai - info {
display : grid ;
gap : var ( -- sp - 3 ) ;
}
. batch - ai - info _ _title {
margin : 0 ;
color : var ( -- text - strong ) ;
font - size : var ( -- fs - card , 15 px ) ;
font - weight : 600 ;
}
. batch - ai - info _ _desc {
margin : 0 ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - body - sm , 13 px ) ;
line - height : 1.6 ;
}
. batch - ai - info _ _list {
margin : 4 px 0 0 ;
padding - left : 20 px ;
list - style : disc ;
li {
margin - bottom : 6 px ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - caption , 12 px ) ;
line - height : 1.5 ;
& : last - child {
margin - bottom : 0 ;
}
}
}
. batch - ai - progress {
display : grid ;
gap : var ( -- sp - 5 ) ;
}
. batch - ai - progress _ _stats {
display : grid ;
grid - template - columns : repeat ( 3 , 1 fr ) ;
gap : var ( -- sp - 3 ) ;
}
. batch - ai - progress _ _stat {
padding : var ( -- sp - 3 ) ;
border : 1 px solid var ( -- border - color ) ;
border - radius : var ( -- r - sm , 6 px ) ;
background : var ( -- surface - muted , # fafbfc ) ;
text - align : center ;
& . batch - ai - progress _ _stat -- success {
background : var ( -- success - soft , # f0fdf4 ) ;
border - color : var ( -- success - border , # dcfce7 ) ;
}
& . batch - ai - progress _ _stat -- fail {
background : var ( -- danger - soft , # fef2f2 ) ;
border - color : var ( -- danger - border , # fee2e2 ) ;
}
}
. batch - ai - progress _ _label {
display : block ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - caption , 12 px ) ;
font - weight : 600 ;
text - transform : uppercase ;
margin - bottom : 4 px ;
}
. batch - ai - progress _ _value {
display : block ;
color : var ( -- text - strong ) ;
font - size : 20 px ;
font - weight : 700 ;
font - family : ui - monospace , "SF Mono" , Consolas , monospace ;
. batch - ai - progress _ _stat -- success & {
color : var ( -- success - color , # 16 a34a ) ;
}
. batch - ai - progress _ _stat -- fail & {
color : var ( -- danger - color , # dc2626 ) ;
}
}
. batch - ai - progress _ _bar - wrapper {
position : relative ;
padding : 12 px 0 8 px ;
: deep ( . el - progress _ _bar ) {
border - radius : 6 px ;
}
}
. batch - ai - progress _ _text {
margin : 0 ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - caption , 12 px ) ;
text - align : center ;
font - weight : 500 ;
}
. batch - ai - progress _ _tip {
margin : 0 ;
padding : 12 px ;
border - radius : 8 px ;
background : var ( -- surface - muted , # f3f4f6 ) ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - caption , 12 px ) ;
display : flex ;
align - items : center ;
justify - content : center ;
gap : 8 px ;
border : 1 px solid var ( -- border - color ) ;
. el - icon {
font - size : 14 px ;
& . is - loading {
animation : rotating 2 s linear infinite ;
}
}
& . batch - ai - progress _ _tip -- success {
background : var ( -- success - soft , # f0fdf4 ) ;
border - color : var ( -- success - border , # dcfce7 ) ;
color : var ( -- success - color , # 16 a34a ) ;
}
& . batch - ai - progress _ _tip -- error {
background : var ( -- danger - soft , # fef2f2 ) ;
border - color : var ( -- danger - border , # fee2e2 ) ;
color : var ( -- danger - color , # dc2626 ) ;
}
}
@ keyframes rotating {
from {
transform : rotate ( 0 deg ) ;
}
to {
transform : rotate ( 360 deg ) ;
}
}
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* AI助评加载对话框
* === === === === === === === === === === === === === === === === === === === === * /
. ai - assist - eval - content {
min - height : 160 px ;
display : flex ;
align - items : center ;
justify - content : center ;
}
. ai - assist - eval - loading {
text - align : center ;
display : grid ;
gap : 12 px ;
}
. ai - assist - eval - loading _ _icon {
font - size : 48 px ;
color : var ( -- primary - light , # 3 b82f6 ) ;
animation : rotating 2 s linear infinite ;
margin : 0 auto ;
}
. ai - assist - eval - loading _ _text {
margin : 0 ;
color : var ( -- text - strong ) ;
font - size : var ( -- fs - body ) ;
font - weight : 600 ;
}
. ai - assist - eval - loading _ _desc {
margin : 0 ;
color : var ( -- text - muted ) ;
font - size : var ( -- fs - caption , 12 px ) ;
}
@ media ( max - width : 1180 px ) {
. task - review {
grid - template - columns : 1 fr ;
}
. task - review . task - review _ _sidebar {
border - right : 0 ;
border - bottom : 1 px solid var ( -- border - color ) ;
}
}
@ media ( max - width : 720 px ) {
. task - review . task - review _ _filters {
grid - template - columns : 1 fr ;
}
. task - review . task - review _ _content {
padding : var ( -- sp - 5 ) ;
}
. task - review . task - review _ _student - head {
flex - direction : column ;
}
. task - review . task - review _ _scores {
flex - wrap : wrap ;
white - space : normal ;
}
}
< / style >
<!-- Dialog is teleported to body ; scope these styles with its unique class . -- >
< style lang = "scss" >
. el - dialog . reference - answer - dialog {
display : flex ;
flex - direction : column ;
height : 80 vh ;
min - width : min ( 560 px , calc ( 100 vw - 32 px ) ) ;
min - height : min ( 320 px , calc ( 100 vh - 32 px ) ) ;
max - width : calc ( 100 vw - 32 px ) ;
max - height : calc ( 100 vh - 32 px ) ;
margin - bottom : 0 ;
overflow : hidden ;
resize : both ;
border - radius : var ( -- r - card , 12 px ) ;
. el - dialog _ _header {
flex - shrink : 0 ;
margin : 0 ;
padding : 12 px 16 px ;
user - select : none ;
border - bottom : 1 px solid var ( -- border - color , # e5e7eb ) ;
}
. el - dialog _ _body {
display : flex ;
flex : 1 ;
min - height : 0 ;
padding : 12 px ;
overflow : hidden ;
background : var ( -- surface - muted , # fafbfc ) ;
}
& . is - fullscreen {
width : 100 vw ! important ;
height : 100 vh ! important ;
max - width : none ;
max - height : none ;
margin : 0 ;
resize : none ;
border - radius : 0 ;
}
. reference - answer - heading {
display : flex ;
align - items : center ;
justify - content : space - between ;
gap : 16 px ;
}
. reference - answer - heading _ _title {
min - width : 0 ;
h2 { margin : 0 ; font - size : 18 px ; line - height : 1.5 ; }
}
. reference - answer - heading _ _hint {
color : var ( -- text - color - secondary , # 6 b7280 ) ;
font - size : 12 px ;
line - height : 1.5 ;
user - select : none ;
}
. reference - answer - heading _ _actions { display : flex ; gap : 6 px ; flex - shrink : 0 ; }
. reference - answer - window - button {
display : inline - flex ;
align - items : center ;
justify - content : center ;
width : 32 px ;
height : 32 px ;
padding : 0 ;
border : 0 ;
border - radius : 6 px ;
background : transparent ;
color : var ( -- text - color - secondary , # 606266 ) ;
font - size : 18 px ;
cursor : pointer ;
& : hover { color : var ( -- el - color - primary ) ; background : var ( -- el - color - primary - light - 9 ) ; }
& : focus - visible { outline : 2 px solid var ( -- el - color - primary ) ; outline - offset : 2 px ; }
}
. reference - answer - frame {
display : block ;
width : 100 % ;
height : 100 % ;
min - height : 0 ;
border : 1 px solid var ( -- border - color , # e5e7eb ) ;
border - radius : var ( -- r - sm , 6 px ) ;
background : var ( -- surface - card , # ffffff ) ;
}
@ media ( max - width : 600 px ) {
. reference - answer - heading _ _hint { display : none ; }
}
}
< / style >