From b2f406aa2f75577b57cf717116235b9260609034 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 11 Oct 2019 16:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=93=E5=89=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/members/ChangeRolePop.js | 9 +++++++-- public/react/src/modules/courses/members/studentsList.js | 2 ++ public/react/src/modules/courses/members/teacherList.js | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/members/ChangeRolePop.js b/public/react/src/modules/courses/members/ChangeRolePop.js index 896360a40..7f55910bf 100644 --- a/public/react/src/modules/courses/members/ChangeRolePop.js +++ b/public/react/src/modules/courses/members/ChangeRolePop.js @@ -6,7 +6,7 @@ import axios from 'axios' /** 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 */ -function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification }) { +function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser }) { const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles) useEffect(() => { setCheckBoxRoles(member_roles) @@ -43,7 +43,12 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces if (response.data.status == 0) { showNotification('保存成功') onChangeRoleSuccess() - trigger('updatabanner') + + if (fetchUser && record.user_id == getUserId) { + fetchUser() + trigger('updatabanner') + } + } console.log(response) } diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index e3859345a..626a76baf 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -155,6 +155,8 @@ const buildColumns = (that,isParent) => { member_roles={record.member_roles} onChangeRoleSuccess={that.onChangeRoleSuccess} showNotification={that.props.showNotification} + getUserId={that.props.isUserid} + fetchUser={that.props.fetchUser} > ) diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 72b667300..74271ea5a 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -165,6 +165,9 @@ function buildColumns(that) { member_roles={record.member_roles} onChangeRoleSuccess={that.onChangeRoleSuccess} showNotification={that.props.showNotification} + getUserId={that.props.isUserid} + fetchUser={that.props.fetchUser} + > {/*