From c5b6f319a21021892a299036c22862b1a3b2ad53 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期四, 02 一月 2025 17:13:57 +0800 Subject: [PATCH] 111 --- packageCourse/components/studentManage/index.js | 87 +++++++++++++++++++++++++++++++++---------- 1 files changed, 66 insertions(+), 21 deletions(-) diff --git a/packageCourse/components/studentManage/index.js b/packageCourse/components/studentManage/index.js index 1aa437b..967308b 100644 --- a/packageCourse/components/studentManage/index.js +++ b/packageCourse/components/studentManage/index.js @@ -80,7 +80,8 @@ currentState: e.detail.value, userList: [], isAll: false, - isEnbled: false + isEnbled: false, + searchKey: '' }) this.getStudentList() }, @@ -125,7 +126,7 @@ // 鎵归噺閫氳繃 updateStateNormalDatas() { - const dataUser = this.data.userList.filter((item) => item.isCheck == true) + const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator') const data = { groupId: this.properties.classId, requests: dataUser.map((item) => { @@ -139,6 +140,11 @@ } app.MG.identity.updateAppUserGroupLink(data).then((res) => { if (res) { + wx.showToast({ + title: '宸查�氳繃', + duration: 1000, + icon: 'none', + }) this.setData({ userList: [] }) @@ -157,13 +163,18 @@ return } if (res.confirm) { - const dataUser = this.data.userList.filter((item) => item.isCheck == true) + const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator') const data = { groupId: this.properties.classId, appUserIds: dataUser.map((item) => item.appUser.id) } app.MG.identity.removeAppUserFromGroup(data).then((res) => { if (res) { + wx.showToast({ + title: '宸茬Щ闄�', + duration: 1000, + icon: 'none', + }) this.setData({ userList: [] }) @@ -177,7 +188,7 @@ // 鎵归噺鎷掔粷 updateStateRejectDatas() { - const dataUser = this.data.userList.filter((item) => item.isCheck == true) + const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator') const data = { groupId: this.properties.classId, requests: dataUser.map((item) => { @@ -191,6 +202,11 @@ } app.MG.identity.updateAppUserGroupLink(data).then((res) => { if (res) { + wx.showToast({ + title: '宸叉嫆缁�', + duration: 1000, + icon: 'none', + }) this.setData({ userList: [] }) @@ -215,6 +231,14 @@ } app.MG.identity.updateAppUserGroupLink(data).then((res) => { if (res) { + wx.showToast({ + title: '宸叉嫆缁�', + duration: 1000, + icon: 'none', + }) + this.setData({ + userList: [] + }) this.getStudentList() } }) @@ -284,6 +308,8 @@ this.setData({ userList: list, total: totalSize, + isAll: false, + isEnbled: false, skeletonLoding: false, bottomLoading: false }) @@ -359,22 +385,37 @@ // 绉婚櫎瀛︾敓 removeStudent(e) { - const { - item - } = e.currentTarget.dataset - const data = { - groupId: this.properties.classId, - appUserIds: [item.appUser.id] - } - app.MG.identity.removeAppUserFromGroup(data).then((res) => { - if (res) { - wx.showToast({ - title: '宸茬Щ闄�', - duration: 1000, - icon: 'none', - }) - this.getStudentList() - this.newNotice(item, 'remove') + wx.showModal({ + title: '鎻愮ず', + content: '鏄惁绉婚櫎褰撳墠鎴愬憳?', + complete: (res) => { + if (res.cancel) { + return + } + if (res.confirm) { + const { + item + } = e.currentTarget.dataset + const data = { + groupId: this.properties.classId, + appUserIds: [item.appUser.id] + } + app.MG.identity.removeAppUserFromGroup(data).then((res) => { + if (res) { + wx.showToast({ + title: '宸茬Щ闄�', + duration: 1000, + icon: 'none', + }) + this.setData({ + userList: [], + isAll: false, + isEnbled: false + }) + this.getStudentList() + } + }) + } } }) }, @@ -404,9 +445,13 @@ duration: 1000, icon: 'success', }) + this.setData({ + userList: [], + isAll: false, + isEnbled: false + }) this.cancle() this.getStudentList() - this.newNotice(this.data.currentIdentity, 'success') } }) }, -- Gitblit v1.9.1