From ed3ba7a1747c4a030df39d0e972fdc85730267af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 00:04:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Signinstatistics/Signinstatistics.js | 248 ++++++++++-------- 1 file changed, 138 insertions(+), 110 deletions(-) diff --git a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js index 0f84980bc..d8ff88694 100644 --- a/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js +++ b/public/react/src/modules/courses/signin/Signinstatistics/Signinstatistics.js @@ -9,6 +9,7 @@ import { Axis, Tooltip, } from "bizcharts"; +import LoadingSpin from "../../../../common/LoadingSpin"; const { Option } = Select; class Signinstatistics extends Component { @@ -17,10 +18,14 @@ class Signinstatistics extends Component { this.state={ datas:null, newlist:[], - course_groups:[{id:"全部",name:"全部"}] + course_groups:[{id:"全部",name:"全部"}], + spal:false, } } getdata=(group_id)=>{ + this.setState({ + spal:true + }) const coursesId=this.props.match.params.coursesId; let url=`/weapps/courses/${coursesId}/attendances.json` axios.get(url,{params:{ @@ -60,7 +65,15 @@ class Signinstatistics extends Component { } } - }) + this.setState({ + spal:false + }) + }).catch((error) => { + this.setState({ + spal:false + }) + + }) } componentDidMount() { @@ -84,7 +97,7 @@ class Signinstatistics extends Component { } render() { - let {datas,newlist,course_groups}=this.state; + let {datas,newlist,course_groups,spal}=this.state; const cols = { month: { @@ -95,11 +108,22 @@ class Signinstatistics extends Component { return( +
+ { + spal===true? +
+ +
- - - - -
{datas&&datas.all_history_count}
-
- - - -
{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}
-
- - - -
{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}
-
- - - -
{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}
-
- -
- -
-
- - - - - - - 到课率 - - - - - - 旷课率 - - - - - - 请假率 - - - - - - 显示最近十次签到 - - - - - -
- -
- - {/**/} - - `${val}%` - }} - /> - - - - -
- -
+ } + + + +
{datas&&datas.all_history_count}
+
+ + + +
{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}
+
+ + + +
{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}
+
+ + + +
{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}
+
+ + + +
+
+ + + + + + + 到课率 + + + + + + 旷课率 + + + + + + 请假率 + + + + + + 显示最近十次签到 + + + + + +
+ +
+ + {/**/} + + `${val}%` + }} + /> + + + + +
+ +
+
+ } + +
) @@ -227,4 +255,4 @@ class Signinstatistics extends Component { -export default Signinstatistics; \ No newline at end of file +export default Signinstatistics; From 2f0ea73e66cc721cd5436263011d977829302a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 00:11:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/signin/student/Signedinlist.js | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 02cd231fc..1f1074b49 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -3,6 +3,7 @@ import React,{ Component } from "react"; import { Row, Col,Select,Table,Pagination } from 'antd'; import axios from 'axios'; import LoadingSpin from "../../../../common/LoadingSpin"; +import NoneDatas from "../component/NoneDatas"; const { Option } = Select; class Signedinlist extends Component { @@ -80,10 +81,13 @@ class Signedinlist extends Component { this.setState({ member_attendances:response.data.member_attendances, members_count:response.data.members_count, - loading:false + }) } + this.setState({ + loading:false + }) }).catch((error) => { that.setState({ loading:false @@ -295,12 +299,21 @@ class Signedinlist extends Component {
{ + this.state.loading===true? +
+ +
+ : member_attendances&&member_attendances.length===0?
- + {/**/} +
+ : // loading={this.state.loading} @@ -310,9 +323,14 @@ class Signedinlist extends Component {
- + { + member_attendances&&member_attendances.length>0? + + :"" + } +