Kaynağa Gözat

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

Your Name 3 ay önce
ebeveyn
işleme
8317c97874
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  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);
+                    }
                   })
                 })