Selaa lähdekoodia

优化学生筛选功能

liqk 4 vuotta sitten
vanhempi
commit
3d817cd414

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/ImportStudent.vue

@@ -396,7 +396,7 @@ export default {
                     delete item.classroom
                     return item
                 })
-                console.log('汇入数据',temp)
+                this.$Message.warning('API待调整')
                 // this.$api.stuAccount.ImportStudent(this.schoolCode, temp).then(
                 //     (res) => {
                 //         if (res.error == null) {

+ 13 - 8
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -674,6 +674,7 @@ export default {
         /**根据学段、年级、班级搜索 */
         filterData: function () {
             let data = this.students
+            // 优先判断班级筛选条件
             // 筛选没有关联班级的学生
             if (this.searchClassroom == 'noclass') {
                 if (this.searchClassroom) {
@@ -683,11 +684,21 @@ export default {
                     })
                 }
 
+                this.tableFilterData = data
+                this.pointNum = this.basicCount
+                this.tableShowData = data.slice(0, this.basicCount)
+                return
+            } else if (this.searchClassroom) {
+                let id = this.searchClassroom
+                data = data.filter(function (item) {
+                    return item.classId == id
+                })
                 this.tableFilterData = data
                 this.pointNum = this.basicCount
                 this.tableShowData = data.slice(0, this.basicCount)
                 return
             }
+            
 
             // 帳號資訊搜尋
             if (this.searchText) {
@@ -713,13 +724,7 @@ export default {
                 })
             }
 
-            // 教室篩選
-            if (this.searchClassroom) {
-                let id = this.searchClassroom
-                data = data.filter(function (item) {
-                    return item.classId == id
-                })
-            }
+
 
             this.tableFilterData = data
             this.pointNum = this.basicCount
@@ -750,7 +755,7 @@ export default {
                     }
                     this.academicYear = curYear
                 }
-                
+
             }
         )
         this.initData()