Преглед на файлове

Merge branch 'master' of http://git.qmth.com.cn/ExamCloud-3/examcloud-web-admin

chenken преди 6 години
родител
ревизия
287899b10c

+ 1 - 0
src/modules/marking/views/MarkPaperCheck.vue

@@ -18,6 +18,7 @@
                 placeholder="请选择"
                 style="width:150px;"
                 @change="changeMarkWork"
+                @clear="resetForm"
               >
                 <el-option
                   v-for="item in markWorkSelect"

+ 34 - 25
src/modules/marking/views/Marker.vue

@@ -14,15 +14,16 @@
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.markId"
+                v-model="formSearch.workId"
                 placeholder="请选择"
+                @clear="clearData"
               >
                 <el-option value>请选择</el-option>
                 <el-option
                   v-for="item in markWorkSelect"
                   :label="item.markName"
-                  :value="item.markId"
-                  :key="item.markId"
+                  :value="item.workId"
+                  :key="item.workId"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -43,7 +44,7 @@
                 size="small"
                 type="primary"
                 icon="el-icon-search"
-                @click="searchSetting"
+                @click="searchBtnFn"
                 >查询</el-button
               >
             </el-form-item>
@@ -144,7 +145,8 @@ export default {
     return {
       formSearch: {
         userLoginName: "",
-        userName: ""
+        userName: "",
+        workId: ""
       },
       tableData: [],
       oldData: [],
@@ -152,12 +154,27 @@ export default {
       pageSize: 10,
       total: 10,
       loading: false,
-      workId: "",
       markWorkList: [],
       paginationShow: false
     };
   },
   methods: {
+    clearData() {
+      this.formSearch = Object.assign(this.formSearch, {
+        workId: "",
+        userLoginName: "",
+        userName: ""
+      });
+      this.tableData = [];
+      this.total = 0;
+      this.$router.push({
+        path: "/marking/marker"
+      });
+    },
+    searchBtnFn() {
+      this.currentPage = 1;
+      this.searchSetting();
+    },
     handleSettingCurrentChange(val) {
       this.currentPage = val;
       this.searchSetting();
@@ -167,7 +184,7 @@ export default {
       this.searchSetting();
     },
     searchSetting() {
-      if (!this.formSearch.markId) {
+      if (!this.formSearch.workId) {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
@@ -175,7 +192,6 @@ export default {
         });
         return false;
       }
-      this.workId = this.formSearch.markId;
       this.loading = true;
       this.$http
         .get(
@@ -185,7 +201,7 @@ export default {
             "/" +
             this.pageSize +
             "?workId=" +
-            this.workId,
+            this.formSearch.workId,
           { params: this.formSearch }
         )
         .then(response => {
@@ -206,7 +222,7 @@ export default {
     markerDetail(row) {
       var url =
         "/marking/marker_detail/" +
-        this.workId +
+        this.formSearch.workId +
         "/" +
         row.userId +
         "/" +
@@ -221,24 +237,17 @@ export default {
         .get(DATA_PROCESS_API + "/markWorks?status=1")
         .then(response => {
           this.markWorkList = response.data;
+          if (this.$route.query && this.$route.query.workId) {
+            this.formSearch.workId = parseInt(this.$route.query.workId);
+          }
         });
     },
     backFill() {
       var formData = this.$route.query;
-      if (formData && formData.markId) {
-        for (var attr in formData) {
-          var value = formData[attr];
-          if (value && value != "null") {
-            if (!isNaN(value)) {
-              if (~~value == value) {
-                value = parseInt(value);
-              } else {
-                value = parseFloat(value);
-              }
-            }
-            this.formSearch[attr] = value;
-          }
-        }
+      if (formData && formData.workId) {
+        this.formSearch.workId = parseInt(formData.workId);
+        this.formSearch.userLoginName = formData.userLoginName;
+        this.formSearch.userName = formData.userName;
         this.searchSetting();
       }
     }
@@ -249,7 +258,7 @@ export default {
       let markWorkNames = [];
       for (let markWork of this.markWorkList) {
         markWorkNames.push({
-          markId: markWork.id,
+          workId: markWork.id,
           markName: markWork.name,
           examId: markWork.examId
         });

+ 2 - 0
src/modules/questions/views/BluePaperStructure.vue

@@ -199,12 +199,14 @@ export default {
     },
     //查询所有
     searchAll() {
+      var pageNo = Number(this.currentPage);
       this.loading = true;
       var url =
         QUESTION_API + "/paperStruct/" + this.currentPage + "/" + this.pageSize;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
+        this.currentPage = pageNo;
       });
       this.loading = false;
     },

+ 0 - 1
src/modules/questions/views/CourseProperty.vue

@@ -265,7 +265,6 @@ export default {
       this.searchCourProperty();
     },
     searchCourProperty() {
-      console.log("page:", this.currentPage);
       var pageNo = Number(this.currentPage);
       this.loading = true;
       var url =

+ 2 - 0
src/modules/questions/views/ExtractPaperRule.vue

@@ -338,6 +338,7 @@ export default {
       }
       this.loading = true;
       let currentPage = this.currentPage;
+      this.currentPage = 1;
       this.$http
         .get(
           QUESTION_API +
@@ -353,6 +354,7 @@ export default {
         .then(response => {
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
+          this.currentPage = Number(currentPage);
           this.loading = false;
         })
         .catch(error => {

+ 4 - 2
src/modules/questions/views/GenPaper.vue

@@ -415,12 +415,14 @@ export default {
       this.searchGenPaper();
     },
     searchGenPaper() {
+      var pageNo = this.currentPage;
+      this.currentPage = 1;
       this.loading = true;
-      var url =
-        QUESTION_API + "/genPaper/" + this.currentPage + "/" + this.pageSize;
+      var url = QUESTION_API + "/genPaper/" + pageNo + "/" + this.pageSize;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
+        this.currentPage = Number(pageNo);
       });
       this.loading = false;
     },

+ 6 - 3
src/modules/questions/views/ImportPaper.vue

@@ -419,12 +419,14 @@ export default {
       this.searchImportPaper();
     },
     searchImportPaper() {
+      var pageNo = Number(this.currentPage);
+      this.currentPage = 1;
       this.loading = true;
-      var url =
-        QUESTION_API + "/importPaper/" + this.currentPage + "/" + this.pageSize;
+      var url = QUESTION_API + "/importPaper/" + pageNo + "/" + this.pageSize;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
+        this.currentPage = pageNo;
         this.loading = false;
       });
     },
@@ -774,6 +776,7 @@ export default {
           level: "",
           name: ""
         };
+        this.currentPage = 1;
       } else {
         this.formSearch = JSON.parse(sessionStorage.getItem("import_paper"));
         this.currentPage =
@@ -784,7 +787,7 @@ export default {
       if (this.formSearch.courseName) {
         this.getCourses(this.formSearch.courseName);
       }
-      this.searchImportPaper();
+      this.handleCurrentChange(this.currentPage);
     }
   },
   computed: {

+ 2 - 0
src/modules/questions/views/PaperStructure.vue

@@ -209,12 +209,14 @@ export default {
       this.searchPaperStructs();
     },
     searchPaperStructs() {
+      var pageNo = Number(this.currentPage);
       this.loading = true;
       var url =
         QUESTION_API + "/paperStruct/" + this.currentPage + "/" + this.pageSize;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
+        this.currentPage = pageNo;
       });
       this.loading = false;
     },

+ 5 - 3
src/modules/questions/views/Question.vue

@@ -409,13 +409,16 @@ export default {
       this.searchQues();
     },
     searchQues() {
+      var pageNo = Number(this.currentPage);
+      console.log("pageNo:", pageNo);
+      this.currentPage = 1;
       this.tableData = [];
-      var url =
-        QUESTION_API + "/question/" + this.currentPage + "/" + this.pageSize;
+      var url = QUESTION_API + "/question/" + pageNo + "/" + this.pageSize;
       this.loading = true;
       this.$http.get(url, { params: this.formSearch }).then(response => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
+        this.currentPage = Number(pageNo);
         this.loading = false;
       });
     },
@@ -716,7 +719,6 @@ export default {
           firstPropertyId: "",
           secondPropertyId: ""
         };
-        this.currentPage = 1;
       }
       this.searchQues();
     }