Ver código fonte

考号和客观题异常处理基本完成

Your Name 4 meses atrás
pai
commit
8317c97874
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      src/views/tasks/uploadPaper.vue

+ 3 - 2
src/views/tasks/uploadPaper.vue

@@ -573,13 +573,14 @@
                 that.canvasImgScale = 680/image.width;
                 that.ctx.drawImage(image, 0, 0, that.srcImgWidth, that.srcImgHeight, 0, 0, that.srcImgWidth*that.canvasImgScale, that
                       .srcImgHeight*that.canvasImgScale)
-                console.log(objective_result,111111)
                 objective_result.forEach(item=>{
                   item.forEach(iitem=>{
                     that.drawRect(iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale,iitem.w*that.canvasImgScale,iitem.h*that.canvasImgScale);
                     that.ctx.font = '12px Arial';
                     that.ctx.fillStyle = 'red';
-                    that.ctx.fillText(iitem.ans, iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale);
+                    if(iitem.ans){
+                      that.ctx.fillText(iitem.ans, iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale);
+                    }
                   })
                 })