From c0dfb67264ec490f693b8579ef511b2c00ec81d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Mon, 16 Dec 2019 10:22:47 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=8F=AD=E5=AD=A6=E4=B9=A0=E6=88=90?=
=?UTF-8?q?=E7=BB=A9=E5=A2=9E=E5=8A=A0=E6=88=90=E7=BB=A9=E6=9F=A5=E8=AF=A2?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/courses/statistics/Statistics.js | 64 +++++++++++++++++--
1 file changed, 57 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js
index 00a47a81d..21041a59c 100644
--- a/public/react/src/modules/courses/statistics/Statistics.js
+++ b/public/react/src/modules/courses/statistics/Statistics.js
@@ -99,7 +99,6 @@ class Statistics extends Component{
}
getwork_scoredata=(page,group_ids,sort,key)=>{
-
this.setState({
page:page,
sort:sort,
@@ -189,8 +188,45 @@ class Statistics extends Component{
}
+ //计算成绩
+ setComputeTimet = (homeworkid) => {
+ let url = `/courses/${homeworkid}/calculate_all_shixun_scores.json`;
+ try {
+ this.props.yslslowCheckresults();
+ } catch (e) {
+
+ }
+ axios.get(url).then((response) => {
+ if (response) {
+ if (response.data.status === 0) {
+ let{page,group_ids,sort}=this.state;
+ setTimeout(() => {
+ try {
+ this.props.showNotification(`${response.data.message}`);
+ } catch (e) {
+
+ }
+ try {
+ this.props.yslslowCheckresultsNo();
+ } catch (e) {
+
+ }
+ this.getwork_scoredata(page,group_ids,sort);
+ }, 2500);
+ }
+ }
+ }).catch((error) => {
+ try {
+ this.props.yslslowCheckresultsNo();
+ } catch (e) {
+
+ }
+ console.log(error)
+ });
+ };
+
render(){
- let {nd1,nd2,nd3,data,bomdata,course_members}=this.state;
+ let {nd1,nd2,nd3,data,bomdata,course_members,activeKey}=this.state;
const columns = [
{
@@ -360,12 +396,26 @@ class Statistics extends Component{
const operations =
- {course_grouptype===false||this.state.course_groups.length===0?"":this.getwork_scoredata(1,group_idss,'desc')}
- />}
+ {course_grouptype===false||this.state.course_groups.length===0?"":
+ this.state.activeKey==="1"?
+ this.getwork_scoredata(1,group_idss,'desc')
+ }
+ />
+ :""
+ }
+ {
+ this.state.activeKey==="1"?
+ this.setComputeTimet(this.props.match.params.coursesId)}>获取最新成绩
+ :""
+ }
+ {
+ this.state.activeKey==="1"?
this.derivefun(this.state.activeKey==="1"?`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出
+ :""
+ }
;
return(