zengyicheng 1 년 전
부모
커밋
33a305789a
2개의 변경된 파일56개의 추가작업 그리고 7개의 파일을 삭제
  1. 30 5
      src/components/pages/test/add/edit/edit/index.vue
  2. 26 2
      src/components/pages/test/add/setInfo/manualCreated.vue

+ 30 - 5
src/components/pages/test/add/edit/edit/index.vue

@@ -164,7 +164,7 @@ export default {
           ttype: 1,
           type: topicType,
         };
-        if (this.topicType == 1) {
+        if (topicType == 1) {
           json.json = {
             title: "标题",
             type: 1,
@@ -174,13 +174,13 @@ export default {
             ],
             answer: "",
           };
-        } else if (this.topicType == 3) {
+        } else if (topicType == 3) {
           json.json = {
             title: "标题",
             type: 1,
             answer: "",
           };
-        } else if (this.topicType == 5) {
+        } else if (topicType == 5) {
           json.json = {
             title: "标题",
             type: 1,
@@ -227,10 +227,35 @@ export default {
         }
       } else {
         if (type == 1) {
-          this.manualJson.push({
+          let json1 = {
             ttype: 1,
             type: topicType,
-          });
+          };
+
+          if (topicType == 1) {
+            json1.json = {
+              title: "标题",
+              type: 1,
+              array: [
+                { option: "选项1", img: "" },
+                { option: "选项2", img: "" },
+              ],
+              answer: "",
+            };
+          } else if (topicType == 3) {
+            json1.json = {
+              title: "标题",
+              type: 1,
+              answer: "",
+            };
+          } else if (topicType == 5) {
+            json1.json = {
+              title: "标题",
+              type: 1,
+              detail: "",
+            };
+          }
+          this.manualJson.push(json1);
         } else if (type == 3 || type == 2) {
           this.$message.error("请选中分页或者分组添加题目");
           return;

+ 26 - 2
src/components/pages/test/add/setInfo/manualCreated.vue

@@ -229,10 +229,34 @@ export default {
       } else {
         if (type == 1) {
           for (var i = 0; i < this.number; i++) {
-            this.checkJson.push({
+            let json1 = {
               ttype: 1,
               type: this.topicType,
-            });
+            };
+            if (this.topicType == 1) {
+              json1.json = {
+                title: "标题",
+                type: 1,
+                array: [
+                  { option: "选项1", img: "" },
+                  { option: "选项2", img: "" },
+                ],
+                answer: "",
+              };
+            } else if (this.topicType == 3) {
+              json1.json = {
+                title: "标题",
+                type: 1,
+                answer: "",
+              };
+            } else if (this.topicType == 5) {
+              json1.json = {
+                title: "标题",
+                type: 1,
+                detail: "",
+              };
+            }
+            this.checkJson.push(json1);
           }
         } else if (type == 3 || type == 2) {
           this.$message.error("请选中分页或者分组添加题目");