|
@@ -20,7 +20,7 @@ import { onMounted, onUnmounted, ref } from "vue";
|
|
|
import { Modal } from "ant-design-vue";
|
|
|
import { useRouter } from "vue-router";
|
|
|
const router = useRouter();
|
|
|
-import { countStudents, getPackages, getStudentsWithSlice } from "@/api/api";
|
|
|
+import { countStudents, getPackages, getStudents } from "@/api/api";
|
|
|
import { httpApp } from "@/plugins/axiosApp";
|
|
|
import mustache from "mustache";
|
|
|
const path = require("path");
|
|
@@ -97,19 +97,18 @@ onMounted(async () => {
|
|
|
});
|
|
|
totalCount.value = res.data;
|
|
|
let totalImageDownloadTime = 0;
|
|
|
- let curFileIndex = 0;
|
|
|
for (
|
|
|
let pageNumber = 0;
|
|
|
pageNumber * 10 < totalCount.value;
|
|
|
pageNumber++
|
|
|
) {
|
|
|
- const resStudents = await getStudentsWithSlice(
|
|
|
+ const resStudents = await getStudents(
|
|
|
store.env.examId,
|
|
|
pageNumber + 1,
|
|
|
10,
|
|
|
{
|
|
|
upload: true,
|
|
|
- withSliceUrl: true,
|
|
|
+ withSheetUrl: true,
|
|
|
withScoreDetail: config.watermark,
|
|
|
withMarkTrack: config.watermark,
|
|
|
withGroupScoreTrack: config.watermark && config.trackMode === "1",
|
|
@@ -120,16 +119,16 @@ onMounted(async () => {
|
|
|
students = resStudents.data;
|
|
|
|
|
|
const urls = students.reduce(
|
|
|
- (accumulator, stu) => accumulator.concat(stu.sliceUrls),
|
|
|
+ (accumulator, stu) => accumulator.concat(stu.sheetUrls),
|
|
|
[]
|
|
|
);
|
|
|
cacheImages(urls);
|
|
|
|
|
|
for (const student of students) {
|
|
|
- for (const sheetUrl of student.sliceUrls) {
|
|
|
+ for (const sheetUrl of student.sheetUrls) {
|
|
|
if (stopSignal) return;
|
|
|
try {
|
|
|
- const index = student.sliceUrls.indexOf(sheetUrl);
|
|
|
+ const index = student.sheetUrls.indexOf(sheetUrl);
|
|
|
student.index = index + 1;
|
|
|
student.examId = store.env.examId;
|
|
|
// const filePath = window.electron.join(
|
|
@@ -147,7 +146,6 @@ onMounted(async () => {
|
|
|
// console.log(urls);
|
|
|
continue;
|
|
|
}
|
|
|
- // console.log("filePath3:", filePath);
|
|
|
console.debug("start ", sheetUrl);
|
|
|
const imageDownloadStartTime = Date.now();
|
|
|
const imageRes = await httpApp.get(sheetUrl, {
|
|
@@ -164,20 +162,6 @@ onMounted(async () => {
|
|
|
// console.log(imageRes.data);
|
|
|
// console.log(await imageRes.data.arrayBuffer());
|
|
|
// console.log(new Uint8Array(await imageRes.data.arrayBuffer()));
|
|
|
- console.log("curFileIndex:", curFileIndex);
|
|
|
- let folderName = "";
|
|
|
- if (config.fileNumberSplit) {
|
|
|
- folderName = `/${
|
|
|
- Math.floor(curFileIndex / config.fileNumberLimits) *
|
|
|
- config.fileNumberLimits +
|
|
|
- 1
|
|
|
- }~${
|
|
|
- Math.floor(curFileIndex / config.fileNumberLimits) *
|
|
|
- config.fileNumberLimits +
|
|
|
- config.fileNumberLimits
|
|
|
- }`;
|
|
|
- console.log("folderName:", folderName);
|
|
|
- }
|
|
|
await window.electron.addWatermark(
|
|
|
storePassedToNodeJs,
|
|
|
arrayBuffer,
|
|
@@ -188,10 +172,8 @@ onMounted(async () => {
|
|
|
index + 1,
|
|
|
config.trackMode,
|
|
|
config.x,
|
|
|
- config.y,
|
|
|
- folderName
|
|
|
+ config.y
|
|
|
);
|
|
|
- curFileIndex++;
|
|
|
} catch (error) {
|
|
|
errorCount.value += 1;
|
|
|
if (config.failover) {
|