Prechádzať zdrojové kódy

题卡试卷类型展示bug修复

zhangjie 4 rokov pred
rodič
commit
c0780c08f0

+ 4 - 3
src/assets/styles/card-preview.scss

@@ -691,8 +691,9 @@
             display: block;
             position: relative;
             margin: 0 auto;
-            width: 204px;
-            height: 34px;
+            width: 200px;
+            height: 26px;
+            padding: 7px 0;
           }
         }
         .dynamic-aorb-rects {
@@ -897,7 +898,7 @@
 .elem-fill-question {
   white-space: normal;
   .elem-body {
-    padding: 10px 0 10px 16px;
+    padding: 18px 0 18px 16px;
   }
 
   .group-item {

+ 1 - 1
src/modules/card/elementModel.js

@@ -155,7 +155,7 @@ const FILL_QUESTION_PROP = {
   x: 0,
   y: 0,
   w: 0,
-  h: 122,
+  h: 138,
   sign: "objective",
   topicName: "",
   topicNo: null,

+ 4 - 3
src/modules/card/previewTemp.js

@@ -722,8 +722,9 @@ const css =
     display: block;\
     position: relative;\
     margin: 0 auto;\
-    width: 204px;\
-    height: 34px;\
+    width: 200px;\
+    height: 26px;\
+    padding: 7px 0;\
   }\
   .card-head-body .head-dynamic-aorb .dynamic-aorb-rects {\
     padding: 16px 10px;\
@@ -902,7 +903,7 @@ const css =
     white-space: normal;\
   }\
   .elem-fill-question .elem-body {\
-    padding: 10px 0 10px 16px;\
+    padding: 18px 0 18px 16px;\
   }\
   .elem-fill-question .group-item {\
     font-family: "Times New Roman", Arial, sans-serif;\

+ 27 - 0
src/modules/card/views/CardPreview.vue

@@ -87,6 +87,7 @@ export default {
     return {
       isPrint: this.$route.params.viewType !== "view",
       isFrame: this.$route.params.viewType === "frame",
+      isFrameView: this.$route.params.viewType === "frame-view",
       studentNo: this.$route.params.studentNo,
       cardId: this.$route.params.cardId,
       cardConfig: {},
@@ -106,6 +107,8 @@ export default {
   mounted() {
     if (this.isFrame) {
       this.initFrame();
+    } else if (this.isFrameView) {
+      this.initFrameView();
     } else {
       this.init();
     }
@@ -140,6 +143,30 @@ export default {
           window.parent.submitCardTemp(cardContentTemp);
       });
     },
+    async initFrameView() {
+      const tempData = await cardTempDetail(this.cardId);
+      if (!tempData) {
+        this.$message.error("很抱歉,当前题卡还没开始制作!");
+        return;
+      }
+      const { cardConfig, pages } = JSON.parse(tempData.content);
+      let fieldInfos = {};
+      cardConfig.businessParams.map(item => {
+        fieldInfos[item.field] = "${" + item.field + "}";
+      });
+      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}";
+        fieldInfos.paperTypeName = "${paperTypeName}";
+      }
+
+      this.cardConfig = cardConfig;
+      this.pages = this.appendFieldInfo(pages, fieldInfos);
+    },
     async init() {
       const tempData = await cardTempDetail(this.cardId);
       if (!tempData) {