From 4f6ca271c0b8cb69a29aea532f7c6bf84ad19032 Mon Sep 17 00:00:00 2001 From: YuNan <3194726156@qq.com> Date: Sun, 23 Feb 2025 12:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=A6=E7=A7=91=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/h5/localTeacher.vue | 45 +++++++++++++++++++++++---- src/views/modules/h5/student.vue | 41 +++++++++++++++++++++--- src/views/modules/h5/waiTeacher.vue | 30 +++++++++++++++--- 3 files changed, 102 insertions(+), 14 deletions(-) diff --git a/src/views/modules/h5/localTeacher.vue b/src/views/modules/h5/localTeacher.vue index 0abb2cf..75ca54c 100644 --- a/src/views/modules/h5/localTeacher.vue +++ b/src/views/modules/h5/localTeacher.vue @@ -5,7 +5,7 @@ - 查询 + 查询 批量删除 @@ -17,7 +17,7 @@ - @@ -120,6 +120,7 @@ export default { dataListSelections: [], addOrUpdateVisible: false, groupIdes: [], + majorIds: 0, json_fields: { "序号": "index", "姓名": "userName", @@ -198,6 +199,19 @@ export default { } }, + filterChange(value) { + const majorFilter = value.majorId || [] + const majorIds = majorFilter.join(',') + this.majorIds = majorIds + console.log("11111",this.majorIds) + + // 重置页码到第一页 + this.pageIndex = 1 + // 恢复默认分页选项 + this.myPageSize = [5, 10, 20, 50, 100, 500] + + this.getDataList('', '', this.majorIds) + }, // Excel导出 async getExportExcel(){ let excelData=[] @@ -235,10 +249,18 @@ export default { // return "未分组" // } }, + async getData(){ + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) + }, // 获取数据列表 - getDataList(prop='', sort='', arr='') { + async getDataList(prop='', sort='', arr='') { this.dataListLoading = true - this.$http({ + await this.$http({ url: this.$http.adornUrl('/teach/list'), method: 'get', params: this.$http.adornParams({ @@ -258,18 +280,29 @@ export default { this.totalCount = 0 } this.dataListLoading = false + this.queryCount(0) }) }, // 每页数 sizeChangeHandle(val) { this.pageSize = val this.pageIndex = 1 - this.getDataList() + if(this.majorIds === 0){ + console.log(this.majorId); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 当前页 currentChangeHandle(val) { this.pageIndex = val - this.getDataList() + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 多选 selectionChangeHandle(val) { diff --git a/src/views/modules/h5/student.vue b/src/views/modules/h5/student.vue index 439ca32..1a85752 100644 --- a/src/views/modules/h5/student.vue +++ b/src/views/modules/h5/student.vue @@ -5,7 +5,7 @@ - 查询 + 查询 批量删除 @@ -15,7 +15,7 @@ 导出 - @@ -119,6 +119,7 @@ export default { dataListSelections: [], addOrUpdateVisible: false, groupIdes: [], + majorIds: 0, json_fields: { "序号":"index", "姓名": "userName", @@ -190,6 +191,19 @@ export default { } }, + filterChange(value) { + const majorFilter = value.majorId || [] + const majorIds = majorFilter.join(',') + this.majorIds = majorIds + console.log("11111",this.majorIds) + + // 重置页码到第一页 + this.pageIndex = 1 + // 恢复默认分页选项 + this.myPageSize = [5, 10, 20, 50, 100, 500] + + this.getDataList('', '', this.majorIds) + }, // Excel导出 async getExportExcel(){ let excelData=[] @@ -224,6 +238,14 @@ export default { // return "未分组" // } }, + async getData(){ + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) + }, // 获取数据列表 getDataList(prop='', sort='', arr='') { this.dataListLoading = true @@ -247,18 +269,29 @@ export default { this.totalCount = 0 } this.dataListLoading = false + this.queryCount(0) }) }, // 每页数 sizeChangeHandle(val) { this.pageSize = val this.pageIndex = 1 - this.getDataList() + if(this.majorIds === 0){ + console.log(this.majorId); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 当前页 currentChangeHandle(val) { this.pageIndex = val - this.getDataList() + if(this.majorIds === 0){ + console.log(this.majorId); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 多选 selectionChangeHandle(val) { diff --git a/src/views/modules/h5/waiTeacher.vue b/src/views/modules/h5/waiTeacher.vue index e7ec822..6c4cd74 100644 --- a/src/views/modules/h5/waiTeacher.vue +++ b/src/views/modules/h5/waiTeacher.vue @@ -5,8 +5,8 @@ - 查询 - 新增 + 查询 + 新增 批量删除 @@ -232,6 +232,7 @@ export default { dataListSelections: [], addOrUpdateVisible: false, groupIdes: [], + majorIds: 0, json_fields: { "序号": "index", "姓名": "userName", @@ -336,6 +337,8 @@ export default { filterChange(value) { const majorFilter = value.majorId || [] const majorIds = majorFilter.join(',') + this.majorIds = majorIds + //console.log(this.majorIds) // 重置页码到第一页 this.pageIndex = 1 @@ -507,6 +510,14 @@ export default { // return "未分组" // } }, + async getData(){ + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) + }, // 获取数据列表 async getDataList(prop = '', sort = '', arr = '') { this.dataListLoading = true @@ -537,12 +548,23 @@ export default { sizeChangeHandle(val) { this.pageSize = val this.pageIndex = 1 // 切换分页大小时重置到第一页 - this.getDataList() + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 当前页 currentChangeHandle(val) { this.pageIndex = val - this.getDataList() + console.log("1111",val) + if(this.majorIds === 0){ + console.log(this.majorIds); + this.getDataList() + return; + } + this.getDataList('','',this.majorIds) }, // 多选 selectionChangeHandle(val) {