nikang 6 年之前
父節點
當前提交
d8695acb2c

+ 1 - 1
src/modules/marking/routes/routes.js

@@ -38,7 +38,7 @@ export default [
         component: Marker
       },
       {
-        path: "marker_detail/:workId/:examId/:name/:markerId/:userName", //评卷员详情
+        path: "marker_detail/:workId/:markerId/:userName", //评卷员详情
         component: MarkerDetail
       },
       {

+ 14 - 1
src/modules/marking/views/MarkWorkOverview.vue

@@ -70,7 +70,7 @@
                     size="small"
                     type="primary"
                     icon="el-icon-search"
-                    @click="searchSetting"
+                    @click="searchBtnFn"
                     >查询</el-button
                   >
                 </el-form-item>
@@ -135,6 +135,7 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
+              v-if="paginationShow"
               @current-change="handleSettingCurrentChange"
               @size-change="handleSizeChange"
               :current-page="currentPage"
@@ -161,6 +162,7 @@ export default {
   },
   data() {
     return {
+      paginationShow: false,
       formSearch: {
         courseCode: ""
       },
@@ -373,6 +375,9 @@ export default {
         )
         .then(response => {
           this.courseList = response.data;
+          if (this.$route.query && this.$route.query.courseCode) {
+            this.formSearch.courseCode = this.$route.query.courseCode;
+          }
         });
     },
     handleSettingCurrentChange(val) {
@@ -383,6 +388,10 @@ export default {
       this.pageSize = val;
       this.searchSetting();
     },
+    searchBtnFn() {
+      this.currentPage = 1;
+      this.searchSetting();
+    },
     searchSetting() {
       if (!this.markWorkSearchForm.markId) {
         this.$notify({
@@ -419,6 +428,9 @@ export default {
               "/marking/mark_work_overview?" +
               new URLSearchParams(JSON.parse(JSON.stringify(this.quertTemp)))
           });
+          this.$nextTick(function() {
+            this.paginationShow = true;
+          });
         });
     },
     courseDetail(row) {
@@ -588,6 +600,7 @@ export default {
         this.pageSize = parseInt(formData.pageSize);
         this.examId = parseInt(formData.examId);
         this.markWorkName = formData.markWorkName;
+        this.doPie();
         this.searchSetting();
         this.getCourses();
       }

+ 6 - 30
src/modules/marking/views/Marker.vue

@@ -120,7 +120,7 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
-              background
+              v-if="paginationShow"
               @current-change="handleSettingCurrentChange"
               @size-change="handleSizeChange"
               :current-page="currentPage"
@@ -153,9 +153,8 @@ export default {
       total: 10,
       loading: false,
       workId: "",
-      examId: "",
-      markWorkName: "",
-      markWorkList: []
+      markWorkList: [],
+      paginationShow: false
     };
   },
   methods: {
@@ -167,19 +166,6 @@ export default {
       this.pageSize = val;
       this.searchSetting();
     },
-    pagingSetting() {
-      var start = (this.currentPage - 1) * this.pageSize;
-      var end =
-        this.currentPage * this.pageSize < this.total
-          ? this.currentPage * this.pageSize
-          : this.total;
-      var tempData = [];
-      console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
-      for (let i = start; i < end; i++) {
-        tempData.push(this.tableData[i]);
-      }
-      this.tableData = tempData;
-    },
     searchSetting() {
       if (!this.formSearch.markId) {
         this.$notify({
@@ -189,15 +175,6 @@ export default {
         });
         return false;
       }
-      let obj = {};
-      for (let item of this.markWorkList) {
-        if (item.id === this.formSearch.markId) {
-          obj = item;
-          break;
-        }
-      }
-      this.examId = obj.examId;
-      this.markWorkName = obj.name;
       this.workId = this.formSearch.markId;
       this.loading = true;
       this.$http
@@ -221,6 +198,9 @@ export default {
               "/marking/marker?" +
               new URLSearchParams(JSON.parse(JSON.stringify(this.formSearch)))
           });
+          this.$nextTick(function() {
+            this.paginationShow = true;
+          });
         });
     },
     markerDetail(row) {
@@ -228,10 +208,6 @@ export default {
         "/marking/marker_detail/" +
         this.workId +
         "/" +
-        this.examId +
-        "/" +
-        this.markWorkName +
-        "/" +
         row.userId +
         "/" +
         row.userName;

+ 1 - 5
src/modules/marking/views/MarkerDetail.vue

@@ -114,9 +114,7 @@ export default {
       total: 10,
       loading: true,
       workId: "",
-      examId: "",
-      courseCode: "",
-      examName: ""
+      courseCode: ""
     };
   },
   components: {
@@ -194,8 +192,6 @@ export default {
   },
   created() {
     this.workId = this.$route.params.workId;
-    this.examId = this.$route.params.examId;
-    this.examName = this.$route.params.name;
     this.userName = this.$route.params.userName;
     this.userId = this.$route.params.markerId;
     this.initSetting();