Explorar o código

精确结构增加 anyInfo字段列

刘洋 hai 1 ano
pai
achega
09b3e6f09d

+ 34 - 20
src/modules/questions/views/AddPaperSelect.vue

@@ -72,7 +72,9 @@
               <template slot-scope="scope">
                 <span
                   v-if="
-                    !['hardInfo', 'mediumInfo', 'easyInfo'].includes(item.prop)
+                    !['hardInfo', 'mediumInfo', 'easyInfo', 'anyInfo'].includes(
+                      item.prop
+                    )
                   "
                   >{{ scope.row[item.prop] }}</span
                 >
@@ -188,9 +190,12 @@
                   <template slot-scope="scope">
                     <div
                       v-if="
-                        ['hardInfo', 'mediumInfo', 'easyInfo'].includes(
-                          item.prop
-                        )
+                        [
+                          'hardInfo',
+                          'mediumInfo',
+                          'easyInfo',
+                          'anyInfo',
+                        ].includes(item.prop)
                       "
                     >
                       <el-tooltip
@@ -253,14 +258,6 @@ export default {
       options1: [],
       tableData1: [],
       difficultyDegree: "",
-      tableColumns1: [
-        { label: "题型", prop: "detailName", minWidth: "100" },
-        { label: "总分", prop: "totalScore", minWidth: "80" },
-        { label: "数量", prop: "totalCount", minWidth: "80" },
-        { label: "难", prop: "hardInfo", minWidth: "80" },
-        { label: "中", prop: "mediumInfo", minWidth: "80" },
-        { label: "易", prop: "easyInfo", minWidth: "80" },
-      ],
       tableData2: [],
       tableColumns2: [
         { label: "名称", prop: "name" },
@@ -268,13 +265,6 @@ export default {
       ],
       multipleSelection: [],
       tableData3: [],
-      tableColumns3: [
-        { label: "题型", prop: "detailName", minWidth: "100" },
-        { label: "数量", prop: "totalCount", minWidth: "80" },
-        { label: "难", prop: "hardInfo", minWidth: "80" },
-        { label: "中", prop: "mediumInfo", minWidth: "80" },
-        { label: "易", prop: "easyInfo", minWidth: "80" },
-      ],
       lastRequestKey: "",
       tableLoading3: false,
       tableLoading1: false,
@@ -305,6 +295,29 @@ export default {
         },
       };
     },
+    tableColumns1() {
+      let end = this.form.paperStructType === "EXACT" ? 7 : 6;
+      return [
+        { label: "题型", prop: "detailName", minWidth: "100" },
+        { label: "总分", prop: "totalScore", minWidth: "80" },
+        { label: "数量", prop: "totalCount", minWidth: "80" },
+        { label: "难", prop: "hardInfo", minWidth: "80" },
+        { label: "中", prop: "mediumInfo", minWidth: "80" },
+        { label: "易", prop: "easyInfo", minWidth: "80" },
+        { label: "不限难度", prop: "anyInfo", minWidth: "80" },
+      ].slice(0, end);
+    },
+    tableColumns3() {
+      let end = this.form.paperStructType === "EXACT" ? 6 : 5;
+      return [
+        { label: "题型", prop: "detailName", minWidth: "100" },
+        { label: "数量", prop: "totalCount", minWidth: "80" },
+        { label: "难", prop: "hardInfo", minWidth: "80" },
+        { label: "中", prop: "mediumInfo", minWidth: "80" },
+        { label: "易", prop: "easyInfo", minWidth: "80" },
+        { label: "不限难度", prop: "anyInfo", minWidth: "80" },
+      ].slice(0, end);
+    },
   },
   watch: {
     "form.paperStructId"() {
@@ -575,7 +588,8 @@ export default {
       return (
         row.easyInfo?.valid == false ||
         row.hardInfo?.valid == false ||
-        row.mediumInfo?.valid == false
+        row.mediumInfo?.valid == false ||
+        row.anyInfo?.valid == false
       );
       // if (prop === "detailName") {
       //   return false;

+ 27 - 12
src/modules/questions/views/ExtractPaperInfo.vue

@@ -310,7 +310,7 @@
                 style="margin-top: 8px; width: 700px"
               >
                 <el-table-column
-                  v-for="(item, index) in randomTplInfo.tableColumns"
+                  v-for="(item, index) in tableColumns"
                   :key="index"
                   :label="item.label"
                   :prop="item.prop"
@@ -318,9 +318,12 @@
                   <template slot-scope="scope">
                     <span
                       v-if="
-                        !['hardInfo', 'mediumInfo', 'easyInfo'].includes(
-                          item.prop
-                        )
+                        ![
+                          'hardInfo',
+                          'mediumInfo',
+                          'easyInfo',
+                          'anyInfo',
+                        ].includes(item.prop)
                       "
                       >{{ scope.row[item.prop] }}</span
                     >
@@ -390,14 +393,14 @@ export default {
         paperStructType: "",
         paperIds: [],
         tableData: [],
-        tableColumns: [
-          { label: "题型", prop: "detailName", minWidth: "100" },
-          { label: "总分", prop: "totalScore", minWidth: "80" },
-          { label: "数量", prop: "totalCount", minWidth: "80" },
-          { label: "难", prop: "hardInfo", minWidth: "80" },
-          { label: "中", prop: "mediumInfo", minWidth: "80" },
-          { label: "易", prop: "easyInfo", minWidth: "80" },
-        ],
+        // tableColumns: [
+        //   { label: "题型", prop: "detailName", minWidth: "100" },
+        //   { label: "总分", prop: "totalScore", minWidth: "80" },
+        //   { label: "数量", prop: "totalCount", minWidth: "80" },
+        //   { label: "难", prop: "hardInfo", minWidth: "80" },
+        //   { label: "中", prop: "mediumInfo", minWidth: "80" },
+        //   { label: "易", prop: "easyInfo", minWidth: "80" },
+        // ],
         difficultyDegree: "",
       },
       curStructInfo: {
@@ -443,6 +446,18 @@ export default {
       }
       return courseList;
     },
+    tableColumns() {
+      let end = this.randomTplInfo.paperStructType === "EXACT" ? 7 : 6;
+      return [
+        { label: "题型", prop: "detailName", minWidth: "100" },
+        { label: "总分", prop: "totalScore", minWidth: "80" },
+        { label: "数量", prop: "totalCount", minWidth: "80" },
+        { label: "难", prop: "hardInfo", minWidth: "80" },
+        { label: "中", prop: "mediumInfo", minWidth: "80" },
+        { label: "易", prop: "easyInfo", minWidth: "80" },
+        { label: "不限难度", prop: "anyInfo", minWidth: "80" },
+      ].slice(0, end);
+    },
   },
   watch: {
     "extractConfig.examId"(val) {