Bladeren bron

题库bug,提交

weiwenhai 6 jaren geleden
bovenliggende
commit
402362a0b0

+ 1 - 1
src/modules/questions/views/EditOtherQuestion.vue

@@ -345,7 +345,7 @@ export default {
     },
     backToQuesList() {
       this.$router.push({
-        path: "/questions/question_list/0"
+        path: "/questions/question_list/1"
       });
     },
     //查询所有课程属性名

+ 1 - 1
src/modules/questions/views/EditSelectQuestion.vue

@@ -441,7 +441,7 @@ export default {
     },
     backToQuesList() {
       this.$router.push({
-        path: "/questions/question_list/0"
+        path: "/questions/question_list/1"
       });
     },
     //查询所有课程属性名

+ 19 - 1
src/modules/questions/views/ExportStructure.vue

@@ -18,6 +18,7 @@
                 clearable
                 placeholder="请选择"
                 size="small"
+                @change="searchExams"
               >
                 <el-option
                   v-for="item in EXAM_TYPES"
@@ -438,6 +439,9 @@ export default {
       this.search();
     },
     search() {
+      if (this.formSearch.examType === "") {
+        this.formSearch.examType = null;
+      }
       this.tableData = [];
       this.loading = true;
       var url =
@@ -727,11 +731,25 @@ export default {
     //查询考试
     getExams(query) {
       query = query.trim();
+      var examType = this.formSearch.examType;
+      if (this.formSearch.examType == null) {
+        examType = "";
+      }
       this.$http
-        .get(EXAM_WORK_API + "/exam/queryByNameLike?name=" + query)
+        .get(
+          EXAM_WORK_API +
+            "/exam/queryByNameLike?name=" +
+            query +
+            "&examTypes=" +
+            examType
+        )
         .then(response => {
           this.examList = response.data;
         });
+    },
+    searchExams() {
+      this.formSearch.examId = null;
+      this.getExams("");
     }
   },
   computed: {

+ 26 - 11
src/modules/questions/views/GenPaper.vue

@@ -94,8 +94,16 @@
               size="small"
               type="primary"
               @click="openBatchExportPaperDialog"
+              :disabled="noBatchSelected"
               ><i class="el-icon-download"></i> 下载成卷</el-button
             >
+            <el-button
+              size="small"
+              type="primary"
+              @click="openPrints"
+              :disabled="noBatchSelected"
+              ><i class="el-icon-share"></i> 发送成卷</el-button
+            >
           </el-form-item>
         </el-row>
       </el-form>
@@ -370,7 +378,7 @@ export default {
       examList: [],
       Org: {},
       dialogModel: false,
-      rowId: "",
+      rowIds: [],
       isShowPrintExamPackage: false,
       isShowPrintExamPackagePassword: false,
       printExamPackagePassword: "",
@@ -632,7 +640,11 @@ export default {
     },
     openPrint(row) {
       this.dialogModel = true;
-      this.rowId = row.id;
+      this.rowIds.push(row.id);
+    },
+    openPrints() {
+      this.dialogModel = true;
+      this.rowIds = this.selectedPaperIds;
     },
     cancel(formData) {
       this.resetForm2(formData);
@@ -653,21 +665,24 @@ export default {
             }
           }
           if (orgId != "") {
-            this.$http.get(
-              QUESTION_API +
-                "/sendPrint/" +
-                this.rowId +
-                "/" +
-                this.printFrom.examId +
-                "/" +
-                orgId
-            );
+            for (let printPid of this.rowIds) {
+              this.$http.get(
+                QUESTION_API +
+                  "/sendPrint/" +
+                  printPid +
+                  "/" +
+                  this.printFrom.examId +
+                  "/" +
+                  orgId
+              );
+            }
             this.$notify({
               message: "已推送",
               type: "success"
             });
             this.resetForm2(formData);
             this.dialogModel = false;
+            this.rowIds = [];
           }
         } else {
           return false;

+ 11 - 0
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -241,6 +241,7 @@ export default {
         name: "",
         totalScore: 0, //结构总分
         courseNo: "", //课程
+        courseName: "",
         coursePropertyId: "", //课程属性
         coursePropertyName: "", //课程属性名称
         paperDetailStructs: [],
@@ -287,6 +288,7 @@ export default {
       var blueStructStorge = sessionStorage.getItem("blueStruct");
       if (typeof blueStructStorge == "string") {
         var blueStruct = JSON.parse(blueStructStorge);
+        this.getCourses(blueStruct.courseName);
         this.blueStruct = blueStruct;
         this.$http
           .get(
@@ -542,6 +544,13 @@ export default {
         }
       }
     },
+    getCourseName(courseNo) {
+      for (let course of this.courseList) {
+        if (course.code == courseNo) {
+          this.blueStruct.courseName = course.name;
+        }
+      }
+    },
     //大题详情
     detailInfo(row) {
       if (!this.blueStruct.coursePropertyId) {
@@ -551,6 +560,7 @@ export default {
         });
         return false;
       }
+      this.getCourseName(this.blueStruct.courseNo);
       sessionStorage.setItem("blueStruct", JSON.stringify(this.blueStruct));
       this.$router.push({
         path:
@@ -600,6 +610,7 @@ export default {
     clearCourseProperty() {
       this.blueStruct.coursePropertyId = "";
       this.coursePropertyList = [];
+      this.getCoursePropertyList();
     },
     resetForm(formData) {
       this.paperDetailStructForm.name = "";

+ 9 - 0
src/modules/questions/views/InsertPaperStructure.vue

@@ -228,6 +228,7 @@ export default {
         totalScore: "",
         paperDetailStructs: [],
         courseNo: "ALL",
+        courseName: "",
         type: "EXACT", //试卷结构类型
         genPaperType: "COMMON", //组卷类型
         examRemark: ""
@@ -459,10 +460,18 @@ export default {
       }
       this.paperDetailStructDialog = true;
     },
+    getCourseName(courseNo) {
+      for (let course of this.courseList) {
+        if (course.code == courseNo) {
+          this.paperStruct.courseName = course.name;
+        }
+      }
+    },
     //添加小题
     insertTopicStruct(row) {
       let courseNo =
         this.paperStruct.courseNo === "" ? "all" : this.paperStruct.courseNo;
+      this.getCourseName(this.paperStruct.courseNo);
       sessionStorage.setItem("paperStruct", JSON.stringify(this.paperStruct));
       this.$router.push({
         path:

+ 41 - 13
src/modules/questions/views/Question.vue

@@ -342,6 +342,7 @@ export default {
         questionType: "",
         courseNo: "",
         courseLevel: "",
+        courseName: "",
         publicity: "",
         coursePropertyName: "",
         firstPropertyId: "",
@@ -378,6 +379,7 @@ export default {
         questionType: "",
         courseNo: "",
         courseLevel: "",
+        courseName: "",
         publicity: "",
         coursePropertyName: "",
         firstPropertyId: "",
@@ -418,8 +420,16 @@ export default {
       this.currentPage = val;
       this.searchQues();
     },
+    getCourseName(courseNo) {
+      for (let course of this.courseList) {
+        if (course.code == courseNo) {
+          this.formSearch.courseName = course.name;
+        }
+      }
+    },
     //修改
     updateRow(row) {
+      this.getCourseName(this.formSearch.courseNo);
       //选择题:单选、多选
       if (
         row.questionType === "SINGLE_ANSWER_QUESTION" ||
@@ -661,6 +671,33 @@ export default {
             this.secondPropertyList = response.data;
           });
       }
+    },
+    initVue() {
+      this.isClear = this.$route.params.isClear;
+      if (this.isClear == 0 || !this.isClear) {
+        sessionStorage.removeItem("question");
+        sessionStorage.removeItem("question_currentPage");
+        this.formSearch = {
+          questionType: "",
+          courseNo: "",
+          courseLevel: "",
+          courseName: "",
+          publicity: "",
+          coursePropertyName: "",
+          firstPropertyId: "",
+          secondPropertyId: ""
+        };
+        this.currentPage = 1;
+      } else {
+        this.formSearch = JSON.parse(sessionStorage.getItem("question"));
+        this.currentPage = parseInt(
+          sessionStorage.getItem("question_currentPage")
+        );
+      }
+      if (this.formSearch.courseName) {
+        this.getCourses(this.formSearch.courseName);
+      }
+      this.searchQues();
     }
   },
   computed: {
@@ -702,21 +739,12 @@ export default {
       return true;
     }
   },
+  watch: {
+    $route: "initVue"
+  },
   //钩子函数
   created() {
-    this.isClear = this.$route.params.isClear;
-    if (this.isClear == 0 || !this.isClear) {
-      sessionStorage.removeItem("question");
-      sessionStorage.removeItem("question_currentPage");
-    } else {
-      this.formSearch = JSON.parse(sessionStorage.getItem("question"));
-      //this.formSearch.firstPropertyId = parseInt(formSearch.firstPropertyId);
-      //this.formSearch.secondPropertyId = parseInt(formSearch.secondPropertyId);
-      this.currentPage = parseInt(
-        sessionStorage.getItem("question_currentPage")
-      );
-    }
-    this.searchQues();
+    this.initVue();
   }
 };
 </script>