Browse Source

题卡创建bug

zhangjie 1 year ago
parent
commit
c916edb864

+ 6 - 2
src/modules/card/components/CardBuildDialog.vue

@@ -78,7 +78,7 @@ import { getCardHeadModel } from "../../../../card/elementModel";
 import TopicElementPreview from "../../../../card/components/TopicElementPreview";
 import CardView from "../../../../card/components/CardView.vue";
 import CardHeadSample from "../../../../card/elements/card-head/CardHead";
-import { objTypeOf } from "@/plugins/utils";
+import { deepCopy, objTypeOf } from "@/plugins/utils";
 // ceshi
 // import paperData from "./paper.json";
 
@@ -102,6 +102,7 @@ export default {
       modalIsShow: false,
       paperInfo: {},
       answers: {},
+      cachePages: [],
     };
   },
   computed: {
@@ -184,6 +185,8 @@ export default {
 
       this.$nextTick(() => {
         this.rebuildPages();
+        this.cachePages = deepCopy(this.pages);
+        console.log(this.cachePages);
         this.updatePageField();
 
         this.$nextTick(() => {
@@ -339,7 +342,7 @@ export default {
     async buildData() {
       const model = this.$refs.CardView.getPageModel({
         cardConfig: this.cardConfig,
-        pages: this.pages,
+        pages: this.cachePages,
         answers: this.answers,
       });
       const htmlContent = this.$refs.CardView.getPreviewTemp(
@@ -367,6 +370,7 @@ export default {
     },
     emitResult(data) {
       // console.log(data);
+      this.initState();
       this.loading = false;
       this.$emit("confirm", data);
       this.cancel();

+ 1 - 1
src/modules/exam/components/ApplyContent.vue

@@ -1161,7 +1161,7 @@ export default {
         const aind = this.paperAttachments.findIndex(
           (item) => item.name === this.curAttachment.name
         );
-        this.paperAttachments[aind].cardTitle = card.title;
+        this.paperAttachments[aind].cardTitle = data.title;
         return;
       }
 

+ 1 - 1
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -724,7 +724,7 @@ export default {
         const aind = this.paperAttachments.findIndex(
           (item) => item.name === this.curAttachment.name
         );
-        this.paperAttachments[aind].cardTitle = card.title;
+        this.paperAttachments[aind].cardTitle = data.title;
         return;
       }