|
@@ -139,7 +139,19 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="tw-flex tw-justify-between tw-bg-white tw-p-4">
|
|
|
+ <a-tooltip v-if="!allViewed" placement="top">
|
|
|
+ <template #title>请先浏览完该学生的所有试卷</template>
|
|
|
+ <a-button
|
|
|
+ :disabled="!allViewed"
|
|
|
+ type="primary"
|
|
|
+ shape="round"
|
|
|
+ @click="saveStudentAnswer"
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </a-button>
|
|
|
+ </a-tooltip>
|
|
|
<a-button
|
|
|
+ v-else
|
|
|
:disabled="!student?.upload"
|
|
|
type="primary"
|
|
|
shape="round"
|
|
@@ -207,7 +219,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { httpApp } from "@/plugins/axiosApp";
|
|
|
import { message } from "ant-design-vue";
|
|
|
-import { onMounted, reactive } from "vue";
|
|
|
+import { onMounted, reactive, watch } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { CheckSetting, StudentInfo } from "./check";
|
|
|
import "viewerjs/dist/viewer.css";
|
|
@@ -323,7 +335,7 @@ async function getStudent(studentId: number) {
|
|
|
stu?.sheetUrls.forEach((v, i, a) => (a[i] = setting.fileServer + v));
|
|
|
currentStudentId = stu.id;
|
|
|
currentImage = 0;
|
|
|
-
|
|
|
+ browsedImageIndexes = [0];
|
|
|
if (!stu.success) {
|
|
|
void message.error(stu.message, 24 * 60 * 60);
|
|
|
dataError = true;
|
|
@@ -419,6 +431,18 @@ async function saveStudentAnswer() {
|
|
|
|
|
|
//#region : 显示大图,供查看和翻转
|
|
|
let currentImage = $ref(0);
|
|
|
+let browsedImageIndexes = $ref([0]);
|
|
|
+let allViewed = $computed(() => {
|
|
|
+ let indexes = Array.from(new Set(browsedImageIndexes));
|
|
|
+ return indexes.length == (student?.sheetUrls || []).length;
|
|
|
+});
|
|
|
+watch(
|
|
|
+ () => currentImage,
|
|
|
+ () => {
|
|
|
+ browsedImageIndexes.push(currentImage);
|
|
|
+ console.log(browsedImageIndexes);
|
|
|
+ }
|
|
|
+);
|
|
|
function switchImageArrow({
|
|
|
left = false,
|
|
|
right = false,
|