فهرست منبع

成绩统计排序Bug修复

lideyin 6 سال پیش
والد
کامیت
ade1f614a7
1فایلهای تغییر یافته به همراه59 افزوده شده و 45 حذف شده
  1. 59 45
      src/modules/oe/views/scoreStatistics.vue

+ 59 - 45
src/modules/oe/views/scoreStatistics.vue

@@ -24,11 +24,11 @@
             size="small"
             size="small"
             type="primary"
             type="primary"
             icon="el-icon-search"
             icon="el-icon-search"
-            >查询
-          </el-button>
-          <el-button size="small" icon="el-icon-refresh" @click="resetForm">
-            重置
-          </el-button>
+            >查询</el-button
+          >
+          <el-button size="small" icon="el-icon-refresh" @click="resetForm"
+            >重置</el-button
+          >
         </el-col>
         </el-col>
       </el-row>
       </el-row>
 
 
@@ -42,16 +42,15 @@
             icon="el-icon-download"
             icon="el-icon-download"
             @click="openExportDialog"
             @click="openExportDialog"
             v-show="!exportLoading"
             v-show="!exportLoading"
+            >导出</el-button
           >
           >
-            导出
-          </el-button>
           <el-button
           <el-button
             size="small"
             size="small"
             icon="el-icon-download"
             icon="el-icon-download"
             :loading="true"
             :loading="true"
             v-show="exportLoading"
             v-show="exportLoading"
-            >导出数据中...
-          </el-button>
+            >导出数据中...</el-button
+          >
         </el-col>
         </el-col>
       </el-row>
       </el-row>
 
 
@@ -70,101 +69,93 @@
               label="学习中心"
               label="学习中心"
               prop="orgName"
               prop="orgName"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="姓名"
               label="姓名"
               prop="studentName"
               prop="studentName"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="身份证号"
               label="身份证号"
               prop="identityNumber"
               prop="identityNumber"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="学号"
               label="学号"
               prop="studentCode"
               prop="studentCode"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="课程"
               label="课程"
               prop="courseNameAndCode"
               prop="courseNameAndCode"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="课程层次"
               label="课程层次"
               prop="courseLevel"
               prop="courseLevel"
               width="120"
               width="120"
-            >
-            </el-table-column>
-            <el-table-column sortable label="年级" prop="grade" width="120">
-            </el-table-column>
+            ></el-table-column>
+            <el-table-column
+              sortable
+              label="年级"
+              prop="grade"
+              width="120"
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="采集人"
               label="采集人"
               prop="infoCollector"
               prop="infoCollector"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="专业"
               label="专业"
               prop="specialtyName"
               prop="specialtyName"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
+              :sort-method="sortByDisciplineCount"
               label="违纪次数"
               label="违纪次数"
               prop="disciplineCount"
               prop="disciplineCount"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
+              :sort-method="sortBySubmitCount"
               label="正常交卷次数"
               label="正常交卷次数"
               prop="submitCount"
               prop="submitCount"
               width="150"
               width="150"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="剩余考试次数"
               label="剩余考试次数"
               prop="leftExamTimes"
               prop="leftExamTimes"
               width="150"
               width="150"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="是否缺考"
               label="是否缺考"
               prop="isAbsent"
               prop="isAbsent"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="最终成绩"
               label="最终成绩"
               prop="finalExamScore"
               prop="finalExamScore"
               width="120"
               width="120"
-            >
-            </el-table-column>
+            ></el-table-column>
             <el-table-column
             <el-table-column
               sortable
               sortable
               label="成绩统计时间"
               label="成绩统计时间"
               prop="startTime"
               prop="startTime"
               width="155"
               width="155"
-            >
-            </el-table-column>
+            ></el-table-column>
           </el-table>
           </el-table>
           <div class="block pull-right">
           <div class="block pull-right">
             <el-pagination
             <el-pagination
@@ -175,9 +166,10 @@
               :page-size="form.pageSize"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
               :total="total"
-            >
-            </el-pagination></div></el-col
-      ></el-row>
+            ></el-pagination>
+          </div>
+        </el-col>
+      </el-row>
       <el-dialog title="导出方式选择" :visible.sync="dialogExportTypeVisible">
       <el-dialog title="导出方式选择" :visible.sync="dialogExportTypeVisible">
         <el-row>
         <el-row>
           <el-col :span="24">
           <el-col :span="24">
@@ -206,9 +198,9 @@
         <el-row class="margin-top-20">
         <el-row class="margin-top-20">
           <el-col :span="24">
           <el-col :span="24">
             <el-button type="primary" plain @click="exportData">确定</el-button>
             <el-button type="primary" plain @click="exportData">确定</el-button>
-            <el-button plain @click="dialogExportTypeVisible = false">
-              取消
-            </el-button>
+            <el-button plain @click="dialogExportTypeVisible = false"
+              >取消</el-button
+            >
           </el-col>
           </el-col>
         </el-row>
         </el-row>
       </el-dialog>
       </el-dialog>
@@ -400,6 +392,28 @@ export default {
           }
           }
           this.exportLoading = false;
           this.exportLoading = false;
         });
         });
+    },
+    sortByDisciplineCount(obj1, obj2) {
+      let p1 = Number(obj1.disciplineCount);
+      let p2 = Number(obj2.disciplineCount);
+      if (isNaN(p1)) {
+        p1 = 0;
+      }
+      if (isNaN(p2)) {
+        p2 = 0;
+      }
+      return p1 - p2;
+    },
+    sortBySubmitCount(obj1, obj2) {
+      let p1 = Number(obj1.submitCount);
+      let p2 = Number(obj2.submitCount);
+      if (isNaN(p1)) {
+        p1 = 0;
+      }
+      if (isNaN(p2)) {
+        p2 = 0;
+      }
+      return p1 - p2;
     }
     }
   },
   },
   created() {}
   created() {}