From 5f072638e55ae573f04ad1d32b46230054f8fe32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 21 Nov 2019 16:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/statistics/Statistics.js | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js index bb1ed9a09..412c7acbe 100644 --- a/public/react/src/modules/courses/statistics/Statistics.js +++ b/public/react/src/modules/courses/statistics/Statistics.js @@ -73,27 +73,30 @@ class Statistics extends Component{ } getDynamiclistdatas=(group_ids)=>{ - - let courseId=this.props.match.params.coursesId; - let url=`/courses/${courseId}/act_score.json`; - let data={ - group_ids:group_ids, - } - axios.get(url,{params: - data - }).then((result) => { - if (result) { + let {activeKey}=this.state; + if(activeKey==='2') { + let courseId = this.props.match.params.coursesId; + let url = `/courses/${courseId}/act_score.json`; + let data = { + group_ids: group_ids, + } + axios.get(url, { + params: + data + }).then((result) => { + if (result) { + this.setState({ + course_members: result.data.course_members, + bomisSpin: false + }) + } + }).catch((error) => { + console.log(error); this.setState({ - course_members:result.data.course_members, - bomisSpin:false + bomisSpin: false, }) - } - }).catch((error) => { - console.log(error); - this.setState({ - bomisSpin:false, }) - }) + } } getwork_scoredata=(page,group_ids,sort)=>{