Explorar o código

修改:学生端累计加减分标注答题卡跨页留痕先显示位置不对问题修复

dengshaobo hai 14 horas
pai
achega
39c277d01a
Modificáronse 2 ficheiros con 40 adicións e 36 borrados
  1. 39 35
      src/components/PaperImage.vue
  2. 1 1
      version.json

+ 39 - 35
src/components/PaperImage.vue

@@ -614,47 +614,51 @@ export default {
             }
             else
             {
-              if(this.displayQuesMark){
-                const fontSize = Math.max(12, 18 * scale); // 最小字体12px,基础字体18px
-                // ctx.font = '30px Arial';
-                ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
-                ctx.textAlign = 'left';
-                //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
-                const iconX=obj.x-20*zoomRate*scale;
-                const iconY=obj.y-20*zoomRate*scale;
-                const iconWidth = 40*zoomRate*scale; 
-                const iconHeight = 40*zoomRate*scale;
-                // console.log("打印item.score",item.score)
-                // displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
-                // displayName: res.data.displayName,//显示值
-                // correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
-                if(item.displayType === 2){
-                  ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
-                }else{
-                  if(item.correctType===0){
-                    //0 分全错
-                    ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
-                  }else if(item.correctType==2){
-                    //满分 全对
-                    ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-                  }else if(item.correctType==1){
-                    //半对
-                    ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+              //当前页的采分点位置才显示
+              if(this.currentPage==point.page)
+              {
+                if(this.displayQuesMark){
+                  const fontSize = Math.max(12, 18 * scale); // 最小字体12px,基础字体18px
+                  // ctx.font = '30px Arial';
+                  ctx.font = `${fontSize}px Arial`; // 让文字大小跟随缩放
+                  ctx.textAlign = 'left';
+                  //判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
+                  const iconX=obj.x-20*zoomRate*scale;
+                  const iconY=obj.y-20*zoomRate*scale;
+                  const iconWidth = 40*zoomRate*scale; 
+                  const iconHeight = 40*zoomRate*scale;
+                  // console.log("打印item.score",item.score)
+                  // displayType:res.data.displayType,//显示类型 0-分数 1-对错 2-等级
+                  // displayName: res.data.displayName,//显示值
+                  // correctType: res.data.correctType,//显示对错的时候 0-错 1-半对 2-全对
+                  if(item.displayType === 2){
+                    ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                   }else{
-                    const displayName = isNaN(item.displayName)?0:Number(item.displayName);
-                    if(displayName==0){
+                    if(item.correctType===0){
                       //0 分全错
                       ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
-                    }else if(displayName==item.fullScore){
-                      //满分全对
+                    }else if(item.correctType==2){
+                      //满分 全对
                       ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
-                    }else{
+                    }else if(item.correctType==1){
                       //半对
                       ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                    }else{
+                      const displayName = isNaN(item.displayName)?0:Number(item.displayName);
+                      if(displayName==0){
+                        //0 分全错
+                        ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
+                      }else if(displayName==item.fullScore){
+                        //满分全对
+                        ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
+                      }else{
+                        //半对
+                        ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
+                      }
+                    }
+                    if(item.displayType === 0){//0-分数 显示分数和对错
+                      ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                     }
-                  }
-                  if(item.displayType === 0){//0-分数 显示分数和对错
-                    ctx.fillText(item.displayName,obj.x+35*zoomRate*scale,obj.y);
                   }
                 }
               }
@@ -712,7 +716,7 @@ export default {
                             ctx.textBaseline = 'middle';
                             
                             const x = drawItem.x * zoomScale + offsetX;
-                            const y = drawItem.y * zoomScale + offsetY;
+                            const y =(drawItem.y -jh)* zoomScale + offsetY;
                             
                             if(drawItem.type==='reduce') {
                               ctx.fillText('-'+drawItem.score, x, y);  

+ 1 - 1
version.json

@@ -1,5 +1,5 @@
 {
-  "version": "0.1.3_2026_10_9_0",
+  "version": "0.1.3_2026_10_15_0",
   "content": [
     {
       "time": "2024-11-1",