|
|
|
|
@ -80,6 +80,7 @@
|
|
|
|
|
:key="studentPreviewSrc"
|
|
|
|
|
class="task-review__student-preview"
|
|
|
|
|
:src="studentPreviewSrc"
|
|
|
|
|
:style="{ height: `${previewFrameHeight}px` }"
|
|
|
|
|
scrolling="yes"
|
|
|
|
|
title="学生任务页面只读预览"
|
|
|
|
|
/>
|
|
|
|
|
@ -129,7 +130,9 @@ const studentTableRef = ref();
|
|
|
|
|
const previewKey = ref("");
|
|
|
|
|
const studentPreviewSrc = ref("");
|
|
|
|
|
const studentPreviewError = ref("");
|
|
|
|
|
const previewFrameHeight = ref(580);
|
|
|
|
|
let previewRequestVersion = 0;
|
|
|
|
|
const PREVIEW_HEIGHT_MESSAGE = "teacher-task-review-preview-height";
|
|
|
|
|
|
|
|
|
|
const canManageClass = computed(() => {
|
|
|
|
|
const currentClass = teachingClasses.value.find((item) => item.schoolClassId === filters.value.classId);
|
|
|
|
|
@ -159,6 +162,7 @@ async function refreshStudentPreview() {
|
|
|
|
|
const teachingClassId = filters.value.classId;
|
|
|
|
|
const student = selectedStudent.value;
|
|
|
|
|
studentPreviewError.value = "";
|
|
|
|
|
previewFrameHeight.value = 580;
|
|
|
|
|
if (!student || !taskKey || !teachingClassId) {
|
|
|
|
|
previewKey.value = "";
|
|
|
|
|
studentPreviewSrc.value = "";
|
|
|
|
|
@ -235,6 +239,13 @@ function selectStudent(row) {
|
|
|
|
|
function studentRowClass({ row }) {
|
|
|
|
|
return row.studentUserId === selectedStudentId.value ? "task-review__selected-row" : "";
|
|
|
|
|
}
|
|
|
|
|
function onPreviewMessage(event) {
|
|
|
|
|
if (event.origin !== window.location.origin) return;
|
|
|
|
|
const data = event.data || {};
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
async function saveSingleScore(row) {
|
|
|
|
|
const score = row.teacherScoreDraft;
|
|
|
|
|
if (!Number.isInteger(score) || score < 0 || score > 100) {
|
|
|
|
|
@ -270,8 +281,14 @@ async function saveBatchScore() {
|
|
|
|
|
savingBatch.value = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onMounted(loadTeachingClasses);
|
|
|
|
|
onBeforeUnmount(() => clearTrainingReviewPreview(previewKey.value));
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
window.addEventListener("message", onPreviewMessage);
|
|
|
|
|
loadTeachingClasses();
|
|
|
|
|
});
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener("message", onPreviewMessage);
|
|
|
|
|
clearTrainingReviewPreview(previewKey.value);
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@ -293,8 +310,11 @@ onBeforeUnmount(() => clearTrainingReviewPreview(previewKey.value));
|
|
|
|
|
.task-review__scores { display: flex; gap: 10px; color: #b9d9eb; font-size: 13px; white-space: nowrap; }
|
|
|
|
|
.task-review__scores span { padding: 7px 10px; border: 1px solid rgba(50, 166, 223, 0.28); border-radius: 999px; background: rgba(2, 26, 43, 0.68); }
|
|
|
|
|
.task-review__scores strong { margin-left: 5px; color: #77d9ff; font-size: 17px; }
|
|
|
|
|
.task-review__student-preview-scroll { height: calc(100vh - 260px); min-height: 580px; margin-top: 22px; overflow: auto; border: 1px solid rgba(54, 159, 212, 0.32); border-radius: 10px; }
|
|
|
|
|
.task-review__student-preview { display: block; width: 100%; min-width: 1280px; height: 100%; min-height: 580px; border: 0; }
|
|
|
|
|
.task-review__student-preview-scroll { height: calc(100vh - 260px); min-height: 580px; margin-top: 22px; overflow: scroll; scrollbar-gutter: stable; scrollbar-color: #238db8 #061724; border: 1px solid rgba(54, 159, 212, 0.32); border-radius: 10px; }
|
|
|
|
|
.task-review__student-preview-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
|
|
|
|
|
.task-review__student-preview-scroll::-webkit-scrollbar-track { background: #061724; }
|
|
|
|
|
.task-review__student-preview-scroll::-webkit-scrollbar-thumb { border: 2px solid #061724; border-radius: 8px; background: #238db8; }
|
|
|
|
|
.task-review__student-preview { display: block; width: 100%; min-width: 1280px; min-height: 580px; border: 0; }
|
|
|
|
|
.task-review__batch-copy { margin: 0 0 18px; color: #dff6ff; }
|
|
|
|
|
.task-review__batch-input { width: 100%; }
|
|
|
|
|
:deep(.task-review__selected-row > td) { background: rgba(0, 111, 177, 0.26) !important; }
|
|
|
|
|
|