From 94fe6e0fceace211ed2f8e176aba0c9a057907b7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 25 Dec 2019 17:00:58 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/shixuns/shared/_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb index b0a0c715d..f34db3fa3 100644 --- a/app/views/admins/shixuns/shared/_list.html.erb +++ b/app/views/admins/shixuns/shared/_list.html.erb @@ -32,7 +32,7 @@ <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%> <% end%> - <%= overflow_hidden_span(shixun&.fork_reason) %> + <%= overflow_hidden_span(shixun&.fork_reason, width: 150) %> <%= shixun.challenges.where(:st => 0).size %> <%= shixun.challenges.where(:st => 1).size %> <%= shixun_authentication_status shixun %> From cbb064b9e872cf8e95b7c762c244bb2fd8c21bcf Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 17:06:53 +0800 Subject: [PATCH 02/13] 1 --- app/controllers/shixuns_controller.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 859dce6f6..36a9e03ac 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -909,16 +909,20 @@ class ShixunsController < ApplicationController # 搜索成员 if request.get? @collaborators = @shixun.shixun_members.where("user_id != #{@shixun.user_id}") - else - if params[:user_id] - man_member = ShixunMember.where(:shixun_id => @shixun.id, :user_id => @shixun.user_id).first - cha_member = ShixunMember.where(:user_id => params[:user_id], :shixun_id => @shixun.id).first - if man_member && cha_member - man_member.update_attribute(:role, 2) - cha_member.update_attribute(:role, 1) - @shixun.update_attribute(:user_id, cha_member.user_id) - end - end + else + begin + raise("必须选择一个用户才能更换管理员") if params[:user_id].blank? + man_member = ShixunMember.where(:shixun_id => @shixun.id, :user_id => @shixun.user_id).first + cha_member = ShixunMember.where(:user_id => params[:user_id], :shixun_id => @shixun.id).first + if man_member && cha_member + man_member.update_attribute(:role, 2) + cha_member.update_attribute(:role, 1) + @shixun.update_attribute(:user_id, cha_member.user_id) + end + rescue => e + logger.error("######change_manager_error: #{e.message}") + render_error(e.message) + end end end From 3b8bd6d454904dc05d13258f121ce4022955c2c1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 17:07:23 +0800 Subject: [PATCH 03/13] 1 --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 36a9e03ac..992bd87f8 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -911,7 +911,7 @@ class ShixunsController < ApplicationController @collaborators = @shixun.shixun_members.where("user_id != #{@shixun.user_id}") else begin - raise("必须选择一个用户才能更换管理员") if params[:user_id].blank? + raise("请先选择成员") if params[:user_id].blank? man_member = ShixunMember.where(:shixun_id => @shixun.id, :user_id => @shixun.user_id).first cha_member = ShixunMember.where(:user_id => params[:user_id], :shixun_id => @shixun.id).first if man_member && cha_member From fed9f6e912cd4d96472d0038c04910d0b25b1d19 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 17:11:26 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/shixun_settings_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index 6dbbc077a..547e31fd9 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -115,10 +115,13 @@ class Admins::ShixunSettingsController < Admins::BaseController sheet1[count_row, 5] = shixun.user.show_real_name sheet1[count_row, 6] = shixun.user.school_name sheet1[count_row, 7] = shixun.user.identity - shixun.challenges.each do |challenge| + challenge_count = shixun.challenges.count + shixun.challenges.each_with_index do |challenge, index| sheet1[count_row, 8] = "第#{challenge.position}关" sheet1[count_row, 9] = challenge.subject - count_row += 1 + if index + 1 != challenge_count + count_row += 1 + end end count_row += 1 end From b57f3a83059b9c086c1b3aec59e050d7c302c8eb Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Wed, 25 Dec 2019 17:13:23 +0800 Subject: [PATCH 05/13] sync comment count --- .../src/common/components/comment/index.scss | 2 +- .../developer/studentStudy/leftpane/index.js | 4 ++-- public/react/src/redux/actions/actionTypes.js | 1 + public/react/src/redux/actions/comment.js | 17 ++++++++++++++++- .../src/redux/reducers/ojForUserReducer.js | 9 ++++++++- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/public/react/src/common/components/comment/index.scss b/public/react/src/common/components/comment/index.scss index 067fc7e9a..41371e8cc 100644 --- a/public/react/src/common/components/comment/index.scss +++ b/public/react/src/common/components/comment/index.scss @@ -180,7 +180,7 @@ $ml: 20px; background: #fff; left: 0px; right: 0px; - top: -220px; + top: -250px; padding: 0 20px; } } \ No newline at end of file diff --git a/public/react/src/modules/developer/studentStudy/leftpane/index.js b/public/react/src/modules/developer/studentStudy/leftpane/index.js index d9527a13e..30eedea18 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-23 11:33:41 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 11:07:42 + * @LastEditTime : 2019-12-25 17:10:30 // */ import './index.scss'; import React, { useState, useEffect, useMemo } from 'react'; @@ -129,7 +129,7 @@ const LeftPane = (props) => { />
- + { if (res.status === 200) { // 重新加载评论列表 dispatch(getCommentLists(identifier)); + // 成功后,评论加一条 + dispatch({ + type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT, + payload: 'add' // + }); } }); } @@ -57,6 +62,11 @@ export const replayChildComment = (identifier, comment) => { if (res.status === 200) { // 重新加载评论列表 dispatch(getCommentLists(identifier)); + // 成功后,评论加一条 + dispatch({ + type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT, + payload: 'add' // + }); } }); } @@ -69,6 +79,11 @@ export const deleteComment = (identifier, delId) => { if (res.status === 200) { // 重新加载评论列表 dispatch(getCommentLists(identifier)); + // 成功后,评论加一条 + dispatch({ + type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT, + payload: 'minus' // + }); } }); } diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js index 8d82b8307..18ffd30c8 100644 --- a/public/react/src/redux/reducers/ojForUserReducer.js +++ b/public/react/src/redux/reducers/ojForUserReducer.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:41:48 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 14:45:47 + * @LastEditTime : 2019-12-25 17:09:53 */ import types from "../actions/actionTypes"; import { Base64 } from 'js-base64'; @@ -211,6 +211,13 @@ const ojForUserReducer = (state = initialState, action) => { ...state, pages: Object.assign({}, state.pages, { page: action.payload}) } + case types.UPDATE_OJ_FOR_USER_COMMENT_COUNT: + const {comments_count} = state.hack; + const _comments_count = action.payload === 'add' ? comments_count + 1 : comments_count - 1; + return { + ...state, + hack: Object.assign({}, state.hack, { comments_count: _comments_count }) + } default: return state; } From 45a6dc1f3c1c7541d99cff23911b4a4425fac726 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 17:14:37 +0800 Subject: [PATCH 06/13] 1 --- app/controllers/admins/shixun_settings_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index 547e31fd9..1fcac9362 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -83,9 +83,9 @@ class Admins::ShixunSettingsController < Admins::BaseController sheet1[count_row, 6] = shixun.myshixuns_count sheet1[count_row, 7] = shixun.myshixuns.select{|m| m.status == 1}.size sheet1[count_row, 8] = shixun.shixun_status - sheet1[count_row, 9] = shixun.user.show_real_name - sheet1[count_row, 10] = shixun.user.school_name - sheet1[count_row, 11] = shixun.user.identity + sheet1[count_row, 9] = shixun.user&.show_real_name + sheet1[count_row, 10] = shixun.user&.school_name + sheet1[count_row, 11] = shixun.user&.identity shixun.challenges.each do |challenge| sheet1[count_row, 12] = "第#{challenge.position}关" sheet1[count_row, 13] = challenge.subject From e9bc18e455f5b5934de6db9021eec9868e6e629c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 25 Dec 2019 17:19:50 +0800 Subject: [PATCH 07/13] 1 --- app/controllers/admins/shixun_settings_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb index 1fcac9362..fd06fddb3 100644 --- a/app/controllers/admins/shixun_settings_controller.rb +++ b/app/controllers/admins/shixun_settings_controller.rb @@ -112,9 +112,9 @@ class Admins::ShixunSettingsController < Admins::BaseController sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name sheet1[count_row, 3] = shixun.fork_from sheet1[count_row, 4] = shixun.shixun_status - sheet1[count_row, 5] = shixun.user.show_real_name - sheet1[count_row, 6] = shixun.user.school_name - sheet1[count_row, 7] = shixun.user.identity + sheet1[count_row, 5] = shixun.user&.show_real_name + sheet1[count_row, 6] = shixun.user&.school_name + sheet1[count_row, 7] = shixun.user&.identity challenge_count = shixun.challenges.count shixun.challenges.each_with_index do |challenge, index| sheet1[count_row, 8] = "第#{challenge.position}关" From 67ba77f06700e1471d83a809c72db34b119c703a Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Wed, 25 Dec 2019 17:22:01 +0800 Subject: [PATCH 08/13] update comment style --- public/react/src/common/components/comment/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/common/components/comment/index.scss b/public/react/src/common/components/comment/index.scss index 41371e8cc..e45ae4e5d 100644 --- a/public/react/src/common/components/comment/index.scss +++ b/public/react/src/common/components/comment/index.scss @@ -180,7 +180,7 @@ $ml: 20px; background: #fff; left: 0px; right: 0px; - top: -250px; + top: -230px; padding: 0 20px; } } \ No newline at end of file From 58c64d6a3ad15eeac89826b5ed22e20912892634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 25 Dec 2019 18:15:43 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndex.js | 257 +++++++++--------- .../modules/tpm/component/TPMRightSection.js | 79 +++--- .../Collaborators/Collaborators.js | 19 +- .../src/modules/user/usersInfo/InfosShixun.js | 21 +- 4 files changed, 195 insertions(+), 181 deletions(-) diff --git a/public/react/src/modules/tpm/TPMIndex.js b/public/react/src/modules/tpm/TPMIndex.js index 83f3b143e..712b7909c 100644 --- a/public/react/src/modules/tpm/TPMIndex.js +++ b/public/react/src/modules/tpm/TPMIndex.js @@ -163,142 +163,136 @@ class TPMIndex extends Component { componentDidUpdate(prevProps, prevState) { - if (prevProps != this.props) { - if (prevProps.user != this.props.user) { - let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; - let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) - if(this.state.identity <4){ - if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ - this.setState({ - openknows:true - }) - }else{ - this.setState({ - openknows:false - }) - } - } + if (prevProps!=this.props) { + + let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; + let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) + if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ + this.setState({ + openknows:true + }) + }else{ + this.setState({ + openknows:false + }) + } + } } - } - - componentDidMount = () => { - - let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; - let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) - let id = this.props.match.params.shixunId; - // console.log('props', this.props); - // let collaborators = `/shixuns/` + id + `/propaedeutics.json`; - // - // axios.get(collaborators).then((response) => { - // if (response.status === 200) { - // if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - // - // }else{ - // this.setState({ - // PropaedeuticsList: response.data, - // shixunId: id - // }); - // } - // - // } - // }).catch((error) => { - // console.log(error) - // }); - - let Url = `/shixuns/` + id + `.json`; - axios.get(Url).then((response) => { - if (response.status === 200) { - document.title=response.data.name; - let newstar_info = []; - // let start1= - for (var i = 0; i < response.data.score_info.length; i++) { - - if (i === 0) { - newstar_info.push(response.data.score_info[i]) - } else { - newstar_info.push((response.data.score_info[i] / 100) * 5) - } - } - let newstar_infos = response.data.score_info; - this.setState({ - shixunsDetails: response.data, - shixunId: id, - star_info: newstar_info, - star_infos: newstar_infos, - power: response.data.power, - identity: response.data.identity, - propaedeutics:response.data.propaedeutics, - status: response.data.shixun_status, - secret_repository: response.data.secret_repository, - public:response.data.public, - is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter, - }); - - - if(response.data.identity <4){ - - if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ - this.setState({ - openknows:true - }) - }else{ - this.setState({ - openknows:false - }) - } - } - + getcomponentdidmount=()=>{ + let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; + let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) + let id = this.props.match.params.shixunId; + // console.log('props', this.props); + // let collaborators = `/shixuns/` + id + `/propaedeutics.json`; + // + // axios.get(collaborators).then((response) => { + // if (response.status === 200) { + // if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + // + // }else{ + // this.setState({ + // PropaedeuticsList: response.data, + // shixunId: id + // }); + // } + // + // } + // }).catch((error) => { + // console.log(error) + // }); + + let Url = `/shixuns/` + id + `.json`; + axios.get(Url).then((response) => { + if (response.status === 200) { + document.title=response.data.name; + let newstar_info = []; + // let start1= + for (var i = 0; i < response.data.score_info.length; i++) { + + if (i === 0) { + newstar_info.push(response.data.score_info[i]) + } else { + newstar_info.push((response.data.score_info[i] / 100) * 5) } - }).catch((error) => { - this.setState({ - shixunsDetails: undefined, - shixunId: undefined, - star_info: undefined, - star_infos: undefined, - power: undefined, - identity: undefined, - status: undefined, - propaedeutics:undefined, - is_jupyter:false, - }); - }); - - this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => { - let url = config.url; - // console.log('tpmContentRequestInterceptor:', url) - for ( let i = 0; i < interceptorUrlArray.length; i++ ) { - if (url.indexOf(interceptorUrlArray[i]) != -1) { - url = url.split('?')[0] - console.log('loadingContent, url:', url) - - this.setState({ loadingContent: true }) - - cacheInterceptorUrlMap[url] = true - } + } + let newstar_infos = response.data.score_info; + this.setState({ + shixunsDetails: response.data, + shixunId: id, + star_info: newstar_info, + star_infos: newstar_infos, + power: response.data.power, + identity: response.data.identity, + propaedeutics:response.data.propaedeutics, + status: response.data.shixun_status, + secret_repository: response.data.secret_repository, + public:response.data.public, + is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter, + }); + + + if(response.data.identity <4){ + if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ + this.setState({ + openknows:true + }) + }else{ + this.setState({ + openknows:false + }) } - return config; - }, function (error) { - return Promise.reject(error); + } + } + }).catch((error) => { + this.setState({ + shixunsDetails: undefined, + shixunId: undefined, + star_info: undefined, + star_infos: undefined, + power: undefined, + identity: undefined, + status: undefined, + propaedeutics:undefined, + is_jupyter:false, }); + }); - // Add a response interceptor - this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => { - // console.log('loadingContent finished, url:', response.config.url) - // TODO 依赖了api这个前缀 - let url = response.config.url.split('api')[1]; + this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => { + let url = config.url; + // console.log('tpmContentRequestInterceptor:', url) + for ( let i = 0; i < interceptorUrlArray.length; i++ ) { + if (url.indexOf(interceptorUrlArray[i]) != -1) { url = url.split('?')[0] - if (cacheInterceptorUrlMap[url]) { + console.log('loadingContent, url:', url) - this.setState({ loadingContent: false }) - delete cacheInterceptorUrlMap[response.url] - } - return response; - }, function (error) { - // Do something with response error - return Promise.reject(error); - }); + this.setState({ loadingContent: true }) + + cacheInterceptorUrlMap[url] = true + } + } + return config; + }, function (error) { + return Promise.reject(error); + }); + + // Add a response interceptor + this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => { + // console.log('loadingContent finished, url:', response.config.url) + // TODO 依赖了api这个前缀 + let url = response.config.url.split('api')[1]; + url = url.split('?')[0] + if (cacheInterceptorUrlMap[url]) { + + this.setState({ loadingContent: false }) + delete cacheInterceptorUrlMap[response.url] + } + return response; + }, function (error) { + // Do something with response error + return Promise.reject(error); + }); //右侧数据 let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; axios.get(shixunsDetailsURL).then((response)=> { @@ -311,6 +305,10 @@ class TPMIndex extends Component { }) this.getnavdatas() } + componentDidMount = () => { + this.getcomponentdidmount() + + } componentWillUnmount = () => { axios.interceptors.request.eject(this.tpmContentRequestInterceptor); @@ -382,7 +380,6 @@ class TPMIndex extends Component { let url = window.location.href; let flag = url.indexOf("add_file")>-1; - return (
{/*头部*/} @@ -447,7 +444,7 @@ class TPMIndex extends Component { { this.state.is_jupyter===false? 排行榜 :""} - + {this.state.identity >4||this.state.identity===undefined ? "": @@ -460,7 +457,7 @@ class TPMIndex extends Component { visible={this.state.openknows} > - + } {this.state.identity >4||this.state.identity===undefined ? "": diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index 545032e56..70bec797a 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -172,40 +172,44 @@ class TPMRightSection extends Component {
{ TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => { + if(k>2){ - return ( + }else{ + return ( -
+
- - 实训 - + + 实训 + -
- {i.name} -

+

+ {i.name} +

- + {i.stages_count} - + - {/**/} - {/*{i.score_count}*/} - {/**/} + {/**/} + {/*{i.score_count}*/} + {/**/} - + {i.members_count} - + + +

+
-

-
+ ) + } - ) }) }
@@ -222,23 +226,28 @@ class TPMRightSection extends Component {
{ TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => { - return ( -
- - 69?1526971094 - -
- - {item.name} - -

- {item.stu_num} 人学习 -

-

{item.level}

+ if(key>2){ + + }else{ + return ( +
+ + 69?1526971094 + +
+ + {item.name} + +

+ {item.stu_num} 人学习 +

+

{item.level}

+
-
- ) + ) + } + }) }
diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 33440bbe1..eceb6c5db 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -88,17 +88,20 @@ class Collaborators extends Component { this.setState({ Collaboratorsvisibleadmin: false, Collaboratorslist: [], - Searchadmin: [] + Searchadmin: [], + addadminrediovalue:undefined }); } else if (type === "admin") { this.setState({ Collaboratorsvisible: false, Collaboratorslist: [], - Searchadmin: [] + Searchadmin: [], + addadminrediovalue:undefined }); } else if (type === "collaborators_deletetype") { this.setState({ collaborators_deletetype: false, + addadminrediovalue:undefined }); } } @@ -312,12 +315,13 @@ class Collaborators extends Component { let url = "/shixuns/" + id + "/change_manager.json"; if (addadminrediovalue === undefined) { this.setState({ - Collaboratorsvisible: false, - Collaboratorslist: [], - Searchadmin: [] + // Collaboratorsvisible: false, + // Collaboratorslist: [], + // Searchadmin: [], + addadminrediovalue:undefined }); this.props.showNotification("所选人员为空,没有更换成功"); - this.CollaboratorsshowModal("admin") + // this.CollaboratorsshowModal("admin") return } @@ -328,7 +332,8 @@ class Collaborators extends Component { this.setState({ Collaboratorsvisible: false, Collaboratorslist: [], - Searchadmin: [] + Searchadmin: [], + addadminrediovalue:undefined }); this.updatacomponentDiddata(); this.props.showNotification(response.data.message); diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index 8cb3caf36..b5811e44f 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -214,12 +214,15 @@ class InfosShixun extends Component{