Browse Source

feat: 题卡规则新增默认选项个数

zhangjie 11 tháng trước cách đây
mục cha
commit
9c81b7a248

+ 6 - 0
card/components/CardDesign.vue

@@ -395,6 +395,12 @@ export default {
       let element = getElementModel(item.type);
       element.w = document.getElementById("topic-column").offsetWidth;
 
+      if (
+        ["FILL_QUESTION_SIMPLE", "FILL_QUESTION_MULTIPLY"].includes(item.type)
+      ) {
+        element.optionCount = this.cardConfig.defaultOptionNumber;
+      }
+
       if (item.type === "FORBID_AREA") {
         const lastTopicElement = this.topics.findLast(
           (item) => !OTHER_ELEMENT.includes(item.type)

+ 23 - 0
src/modules/base/components/ModifyCardRule.vue

@@ -113,6 +113,21 @@
             >编辑</el-button
           >
         </el-form-item>
+        <el-form-item
+          prop="defaultOptionNumber"
+          label="单选题/多选题选项默认个数:"
+          label-width="220px"
+        >
+          <el-input-number
+            style="width: 125px"
+            v-model="modalForm.defaultOptionNumber"
+            :min="2"
+            :max="22"
+            :step="1"
+            step-strictly
+            :controls="false"
+          ></el-input-number>
+        </el-form-item>
         <div class="part-box part-box-pad part-box-border">
           <h4 class="part-box-tips">题卡版头变量印刷字段配置:</h4>
           <el-form-item label="必选字段:" label-width="115px" required>
@@ -230,6 +245,7 @@ const initModalForm = {
   remark: "",
   examNumberStyle: "",
   examNumberDigit: 10,
+  defaultOptionNumber: 4,
   paperType: "PRINT",
   examAbsent: true,
   discipline: true,
@@ -323,6 +339,13 @@ export default {
             trigger: "change",
           },
         ],
+        defaultOptionNumber: [
+          {
+            required: true,
+            message: "请输入默认选项个数",
+            trigger: "change",
+          },
+        ],
         titleRule: [
           {
             required: true,

+ 1 - 0
src/modules/print/components/ModifyPlanPaper.vue

@@ -224,6 +224,7 @@ export default {
     async getPapers() {
       this.papers = await linkPaperNumberList({
         examTaskId: this.instance.id,
+        examId: this.instance.examId,
         printPlanId: this.instance.printPlanId,
         courseId: this.instance.courseId,
       });