刘洋 2 ani în urmă
părinte
comite
52e57c8a5e
2 a modificat fișierele cu 9 adăugiri și 2 ștergeri
  1. 1 1
      src/features/ImageDownload/ImageDownload.vue
  2. 8 1
      src/lib/watermark.ts

+ 1 - 1
src/features/ImageDownload/ImageDownload.vue

@@ -127,7 +127,7 @@ onMounted(async () => {
         cacheImages(urls);
 
         for (const student of students) {
-          let allTags = Object.values(student.tags)
+          let allTags = Object.values(student.tags || {})
             .filter((x) => !!x)
             .flat();
           allTags.forEach((item: any) => {

+ 8 - 1
src/lib/watermark.ts

@@ -251,7 +251,14 @@ export async function addWatermark(
 
     for (let i = 0; i < tags.length; i++) {
       const tag = tags[i];
-      console.log("tag:", tag);
+      console.log(
+        `科目${student.subjectCode}:${
+          student.examNumber
+        }-${index}的tag的hide为${
+          tag.hide
+        } tag内容为=》${tag.content.toString()}`,
+        tag
+      );
       if (tag.content != undefined && !tag.hide) {
         let top = tag.top;
         imgData