zhangjie 5 år sedan
förälder
incheckning
9e1b26f67c

+ 10 - 8
src/assets/styles/card-preview.scss

@@ -472,15 +472,17 @@
       }
       .stdno-auto {
         &-barcode {
-          height: 80px;
-          padding: 10px 0;
+          height: 70px;
           text-align: center;
 
           > img {
-            height: 100%;
-            width: auto;
-            display: inline-block;
-            vertical-align: top;
+            display: block;
+            height: 50px;
+            width: 300px;
+            margin: 0 auto;
+          }
+          > p {
+            line-height: 20px;
           }
         }
       }
@@ -676,10 +678,10 @@
         .dynamic-aorb-barcode {
           img {
             display: block;
-            padding: 4px 0 4px;
             position: relative;
             margin: 0 auto;
-            height: 36px;
+            width: 210px;
+            height: 35px;
           }
         }
         .dynamic-aorb-rects {

+ 4 - 1
src/modules/card/components/elementEdit/cardHeadSpin/HeadStdno.vue

@@ -7,6 +7,7 @@
       <div class="stdno-auto-barcode">
         <img :src="examNumberBarcodeSrc" v-if="examNumberBarcodeSrc" />
         <img src="@/assets/images/barcode-sample.png" v-else />
+        <p>{{ examNumberBarcodeName }}</p>
       </div>
     </div>
     <div class="stdno-fill" v-if="data.examNumberStyle === 'fill'">
@@ -38,7 +39,9 @@ export default {
   data() {
     return {
       examNumberBarcodeSrc:
-        this.data["fieldInfos"] && this.data["fieldInfos"]["examNumber"]
+        this.data["fieldInfos"] && this.data["fieldInfos"]["examNumber"],
+      examNumberBarcodeName:
+        this.data["fieldInfos"] && this.data["fieldInfos"]["examNumberStr"]
     };
   },
   computed: {

+ 10 - 8
src/modules/card/previewTemp.js

@@ -532,15 +532,17 @@ const css =
     transform: scale(0.67, 0.67);\
   }\
   .card-head-body .head-stdno .stdno-auto-barcode {\
-    height: 80px;\
-    padding: 10px 0;\
+    height: 70px;\
     text-align: center;\
   }\
   .card-head-body .head-stdno .stdno-auto-barcode > img {\
-    height: 100%;\
-    width: auto;\
-    display: inline-block;\
-    vertical-align: top;\
+    display: block;\
+    height: 50px;\
+    width: 300px;\
+    margin: 0 auto;\
+  }\
+  .card-head-body .head-stdno .stdno-auto-barcode > p {\
+    line-height: 20px;\
   }\
   .card-head-body .head-notice > h4 {\
     font-weight: bold;\
@@ -707,10 +709,10 @@ const css =
   }\
   .card-head-body .head-dynamic-aorb .dynamic-aorb-barcode img {\
     display: block;\
-    padding: 4px 0 4px;\
     position: relative;\
     margin: 0 auto;\
-    height: 36px;\
+    width: 210px;\
+    height: 35px;\
   }\
   .card-head-body .head-dynamic-aorb .dynamic-aorb-rects {\
     padding: 16px 10px;\

+ 10 - 4
src/modules/card/views/CardPreview.vue

@@ -120,8 +120,10 @@ export default {
       cardConfig.businessParams.map(item => {
         fieldInfos[item.field] = "${" + item.field + "}";
       });
-      if (cardConfig.examNumberStyle === "auto")
+      if (cardConfig.examNumberStyle === "auto") {
         fieldInfos.examNumber = "data:image/png;base64,${examNumber}";
+        fieldInfos.examNumberStr = "${examNumberStr}";
+      }
 
       if (cardConfig.aOrB && cardConfig.aOrBType === "auto") {
         fieldInfos.paperType = "data:image/png;base64,${paperType}";
@@ -164,14 +166,18 @@ export default {
       cardConfig.businessParams.map(item => {
         fieldInfos[item.field] = stdInfo[item.field] || defContent;
       });
-      if (cardConfig.examNumberStyle === "auto")
+      if (cardConfig.examNumberStyle === "auto") {
         fieldInfos.examNumber = this.getBase64Barcode(
           stdInfo["examNumber"] || defNumber
         );
-      if (cardConfig.aOrB && cardConfig.aOrBType === "auto")
+        fieldInfos.examNumberStr = stdInfo["examNumber"] || defNumber;
+      }
+      if (cardConfig.aOrB && cardConfig.aOrBType === "auto") {
         fieldInfos.paperType = this.getBase64Barcode(
           stdInfo["paperType"] || defNumber
         );
+        fieldInfos.paperTypeName = stdInfo["paperTypeName"] || "A";
+      }
 
       return fieldInfos;
     },
@@ -179,7 +185,7 @@ export default {
       const canvas = document.createElement("CANVAS");
       JsBarcode(canvas, str, {
         width: 2,
-        height: 60,
+        height: 50,
         displayValue: false,
         margin: 0
       });