dedsudiyu 7 月之前
父節點
當前提交
512cd3bfa4
共有 1 個文件被更改,包括 30 次插入18 次删除
  1. 30 18
      src/views/integratedManagement/laboratoryManagement/subject/index.vue

+ 30 - 18
src/views/integratedManagement/laboratoryManagement/subject/index.vue

@@ -485,9 +485,11 @@
       //下载电子信息牌
       async createImage() {
         try {
-          const canvas = await html2canvas(this.$refs.canvasImg) // 在这里,将需要转换成图片的部分作为参数传入html2canvas
+          const config = {
+            useCORS: true,
+          };
+          const canvas = await html2canvas(this.$refs.canvasImg,config) // 在这里,将需要转换成图片的部分作为参数传入html2canvas
           const image = canvas.toDataURL() // 将生成的canvas转换为DataURL格式
-          console.log(image) // 可以将image自行存储
           this.$nextTick(() => {
             this.downloadQrCode(image);
           })
@@ -536,6 +538,16 @@
         const blob = new Blob(byteArrays, { type: contentType })
         return blob
       },
+      getBase64Image(img) {
+        let canvas = document.createElement("canvas");
+        canvas.width = img.width;
+        canvas.height = img.height;
+        let ctx = canvas.getContext("2d");
+        ctx.drawImage(img, 0, 0, img.width, img.height);
+        let dataURL = canvas.toDataURL("image/png");
+        return dataURL
+        // return dataURL.replace("data:image/png;base64,", "");
+      },
       //获取实验室详情 type:1.详情 2.编辑
       getSubInfo(row,type){
         laboratorySubRelInfoGetDetailInfo({ infoId: row.infoId }).then(response => {
@@ -883,7 +895,7 @@
                   flex:1;
                   padding-top:9px;
                   p{
-                    color:#333;
+                    color:#000;
                     margin:7px 29px 11px 29px;
                     height:24px;
                     line-height:24px;
@@ -929,11 +941,11 @@
                   overflow: hidden;
                   border-bottom-left-radius: 10px;
                   border-bottom-right-radius: 10px;
-                  padding:12px 14px;
+                  padding:5px 14px;
                   p{
-                    font-size:12px;
-                    color:#3D3D3D;
-                    line-height:18px;
+                    font-size:14px;
+                    color:#000;
+                    line-height:24px;
                   }
                 }
                 .data-for-img{
@@ -947,7 +959,7 @@
                     display: inline-block;
                     height:80px;
                     width:80px;
-                    margin:10px 0 0 6px;
+                    margin:18px 0 0 6px;
                   }
                 }
               }
@@ -974,11 +986,11 @@
                   overflow: hidden;
                   border-bottom-left-radius: 10px;
                   border-bottom-right-radius: 10px;
-                  padding:12px 14px;
+                  padding:5px 14px;
                   p{
-                    font-size:12px;
-                    color:#3D3D3D;
-                    line-height:18px;
+                    font-size:14px;
+                    color:#000;
+                    line-height:24px;
                   }
                 }
                 .data-for-img{
@@ -992,7 +1004,7 @@
                     display: inline-block;
                     height:80px;
                     width:80px;
-                    margin:10px 0 0 6px;
+                    margin:18px 0 0 6px;
                   }
                 }
               }
@@ -1020,11 +1032,11 @@
               overflow: hidden;
               border-bottom-left-radius: 10px;
               border-bottom-right-radius: 10px;
-              padding:12px 14px;
+              padding:9px 14px;
               p{
-                font-size:12px;
-                color:#3D3D3D;
-                line-height:18px;
+                font-size:14px;
+                color:#000;
+                line-height:24px;
               }
             }
             .data-for-img{
@@ -1038,7 +1050,7 @@
                 display: inline-block;
                 height:80px;
                 width:80px;
-                margin:16px 0 0 16px;
+                margin:10px 0 0 16px;
               }
             }
           }