Merge remote-tracking branch 'origin/PCqiandao' into PCqiandao

PCqiandao
杨树明 5 years ago
commit c6dd523b4c

@ -9,6 +9,7 @@ import {
Axis, Axis,
Tooltip, Tooltip,
} from "bizcharts"; } from "bizcharts";
import LoadingSpin from "../../../../common/LoadingSpin";
const { Option } = Select; const { Option } = Select;
class Signinstatistics extends Component { class Signinstatistics extends Component {
@ -17,10 +18,14 @@ class Signinstatistics extends Component {
this.state={ this.state={
datas:null, datas:null,
newlist:[], newlist:[],
course_groups:[{id:"全部",name:"全部"}] course_groups:[{id:"全部",name:"全部"}],
spal:false,
} }
} }
getdata=(group_id)=>{ getdata=(group_id)=>{
this.setState({
spal:true
})
const coursesId=this.props.match.params.coursesId; const coursesId=this.props.match.params.coursesId;
let url=`/weapps/courses/${coursesId}/attendances.json` let url=`/weapps/courses/${coursesId}/attendances.json`
axios.get(url,{params:{ axios.get(url,{params:{
@ -60,7 +65,15 @@ class Signinstatistics extends Component {
} }
} }
}) this.setState({
spal:false
})
}).catch((error) => {
this.setState({
spal:false
})
})
} }
componentDidMount() { componentDidMount() {
@ -84,7 +97,7 @@ class Signinstatistics extends Component {
} }
render() { render() {
let {datas,newlist,course_groups}=this.state; let {datas,newlist,course_groups,spal}=this.state;
const cols = { const cols = {
month: { month: {
@ -95,11 +108,22 @@ class Signinstatistics extends Component {
return( return(
<React.Fragment > <React.Fragment >
<div>
{
spal===true?
<div style={{
minHeight:"500px",
}}>
<LoadingSpin></LoadingSpin>
</div>
<Row type="flex" justify="space-between" className={"mt20"}> :
<style> <div>
{
` <Row type="flex" justify="space-between" className={"mt20"}>
<style>
{
`
.lishiqiandao{ .lishiqiandao{
background-image: url(${getImageUrl(`/images/qiandao/lishi.png`)}); background-image: url(${getImageUrl(`/images/qiandao/lishi.png`)});
} }
@ -113,108 +137,112 @@ class Signinstatistics extends Component {
background-image: url(${getImageUrl(`/images/qiandao/qingjia.png`)}); background-image: url(${getImageUrl(`/images/qiandao/qingjia.png`)});
} }
` `
} }
</style> </style>
<Col span={6}> <Col span={6}>
<Card style={{ width: 209 }} className={"gutterrowbox lishiqiandao"}> <Card style={{ width: 209 }} className={"gutterrowbox lishiqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas&&datas.all_history_count}</div> <div className={"gutterrowboxcontent ml5"}>{datas&&datas.all_history_count}</div>
</Card> </Card>
</Col> </Col>
<Col span={6}> <Col span={6}>
<Card style={{ width: 209 }} className={"ml8 gutterrowbox daokeqiandao"}> <Card style={{ width: 209 }} className={"ml8 gutterrowbox daokeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}</div> <div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}</div>
</Card> </Card>
</Col> </Col>
<Col span={6}> <Col span={6}>
<Card style={{ width: 209 }} className={"ml14 gutterrowbox kuangkeqiandao"}> <Card style={{ width: 209 }} className={"ml14 gutterrowbox kuangkeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}</div> <div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}</div>
</Card> </Card>
</Col> </Col>
<Col span={6} > <Col span={6} >
<Card style={{ width: 209 }} className={"ml20 gutterrowbox qingjiaqiandao"}> <Card style={{ width: 209 }} className={"ml20 gutterrowbox qingjiaqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}</div> <div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}</div>
</Card> </Card>
</Col> </Col>
</Row> </Row>
<div className={"SigninstatisticsChart mt20"}> <div className={"SigninstatisticsChart mt20"}>
<div className={"pd30"}> <div className={"pd30"}>
<Row> <Row>
<Col span={14}> <Col span={14}>
<Row type="flex" justify="start"> <Row type="flex" justify="start">
<Col span={5}> <Col span={5}>
<Row> <Row>
<Col span={12} className={"mindaoke mr5"}></Col> <Col span={12} className={"mindaoke mr5"}></Col>
<Col>到课率</Col> <Col>到课率</Col>
</Row> </Row>
</Col> </Col>
<Col span={5}> <Col span={5}>
<Row> <Row>
<Col span={12} className={"minkuangke mr5"}></Col> <Col span={12} className={"minkuangke mr5"}></Col>
<Col>旷课率</Col> <Col>旷课率</Col>
</Row> </Row>
</Col> </Col>
<Col span={5}> <Col span={5}>
<Row> <Row>
<Col span={12} className={"minqingjia mr5"}></Col> <Col span={12} className={"minqingjia mr5"}></Col>
<Col>请假率</Col> <Col>请假率</Col>
</Row> </Row>
</Col> </Col>
</Row> </Row>
</Col> </Col>
<Col span={10}><Row type="flex" justify="end"> <Col span={10}><Row type="flex" justify="end">
<Col span={8} className={"Signinstatisticsfont"}>显示最近十次签到</Col> <Col span={8} className={"Signinstatisticsfont"}>显示最近十次签到</Col>
<Col span={10}> <Col span={10}>
<Select defaultValue={"全部"} onChange={(e)=>this.handleChange(e)} style={{width:"130px"}}> <Select defaultValue={"全部"} onChange={(e)=>this.handleChange(e)} style={{width:"130px"}}>
{course_groups&&course_groups.map((item,key)=>{ {course_groups&&course_groups.map((item,key)=>{
return( return(
<Option value={item.id} title={item.name} >{item.name}</Option> <Option value={item.id} title={item.name} >{item.name}</Option>
) )
})} })}
</Select> </Select>
</Col> </Col>
</Row></Col> </Row></Col>
</Row> </Row>
</div> </div>
<div className={"padding03000"}> <div className={"padding03000"}>
<Chart height={400} data={newlist} scale={cols} forceFit> <Chart height={400} data={newlist} scale={cols} forceFit>
{/*<Legend />*/} {/*<Legend />*/}
<Axis name="month" /> <Axis name="month" />
<Axis <Axis
name="temperature" name="temperature"
label={{ label={{
formatter: val => `${val}%` formatter: val => `${val}%`
}} }}
/> />
<Tooltip <Tooltip
crosshairs={{ crosshairs={{
type: "y" type: "y"
}} }}
/> />
<Geom <Geom
type="line" type="line"
position="month*temperature" position="month*temperature"
size={2} size={2}
// color={"city"} // color={"city"}
shape={"smooth"} shape={"smooth"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]} color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
/> />
<Geom <Geom
type="point" type="point"
position="month*temperature" position="month*temperature"
size={4} size={4}
shape={"circle"} shape={"circle"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]} color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
style={{ style={{
stroke: "#fff", stroke: "#fff",
lineWidth: 1 lineWidth: 1
}} }}
/> />
</Chart> </Chart>
</div> </div>
</div> </div>
</div>
}
</div>
</React.Fragment> </React.Fragment>
) )
@ -227,4 +255,4 @@ class Signinstatistics extends Component {
export default Signinstatistics; export default Signinstatistics;

@ -120,6 +120,7 @@ class Detailss extends Component {
defaultActiveKey === "1" ? defaultActiveKey === "1" ?
<div className="ws25s" style={{ <div className="ws25s" style={{
position: "relative", position: "relative",
overflow: 'hidden',
}}> }}>
{ {
item && item.mode === "NUMBER" ? item && item.mode === "NUMBER" ?
@ -140,6 +141,15 @@ class Detailss extends Component {
<p className="h40s font-16" style={{ <p className="h40s font-16" style={{
color: "#909399" color: "#909399"
}}>签到码</p> }}>签到码</p>
<div style={{
overflow: 'hidden',
height: "1px",
width: "1px",
position: "absolute",
right: "-200px",
}}>
<input id={"file_path" + 1} className="file_path_input" value={item&&item.code}/>
</div>
</div> </div>
: :
item && item.mode === "QRCODE" ? item && item.mode === "QRCODE" ?
@ -174,14 +184,7 @@ class Detailss extends Component {
</div> </div>
</div> </div>
{
defaultActiveKey === "1" ?
item && item.mode === "NUMBER" ?
<input id={"file_path" + 1} className="file_path_input" value={item&&item.code}/>
:""
:
""
}
</div> </div>
</React.Fragment> </React.Fragment>

@ -112,10 +112,24 @@ class Teacherentry extends Component {
( (
this.props.defaultActiveKey === "1" ? this.props.defaultActiveKey === "1" ?
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">
{
item.attendance_status?
(
item.attendance_status==="ABSENCE"?
<div className="qiandaobutton xiaoshou" onClick={()=>this.props.Signin(item.mode,item.id,item.attendance_code)}>
签到
</div>
:
item.attendance_status==="NORMAL"?
<div className="qiandaobutton" >
正常签到
</div>
:""
)
:
""
}
<div className="qiandaobutton xiaoshou" onClick={()=>this.props.Signin(item.mode,item.id,item.attendance_code)}>
签到
</div>
</div> </div>
: :
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">

@ -4,8 +4,9 @@ import axios from 'axios';
import Teacherentry from "../Teacherentry"; import Teacherentry from "../Teacherentry";
import NoneDatas from '../NoneDatas'; import NoneDatas from '../NoneDatas';
import LoadingSpin from '../../../../../common/LoadingSpin'; import LoadingSpin from '../../../../../common/LoadingSpin';
import { Modal, Button } from 'antd';
import Listjihe from "../../../../question/component/Listjihe"; const { confirm } = Modal;
//在线学习 //在线学习
class Teaccomponent extends Component{ class Teaccomponent extends Component{
@ -34,55 +35,78 @@ class Teaccomponent extends Component{
} }
//截止 //截止
thisEnd=(attendance_id)=>{ thisEnd=(attendance_id)=>{
const url = `/weapps/attendances/${attendance_id}/end.json`; let thiss=this
var data={
} confirm({
axios.post(url, data) title: '提示',
.then((result) => { content: '确认截止此签到吗?',
if (result.data.status === 0) { onOk() {
// try { const url = `/weapps/attendances/${attendance_id}/end.json`;
// this.props.showNotification(`截止成功`); var data={
// }catch (e) {
//
// }
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
} }
}).catch((error) => { axios.post(url, data)
//console.log(error); .then((result) => {
}) if (result.data.status === 0) {
// try {
// this.props.showNotification(`截止成功`);
// }catch (e) {
//
// }
thiss.props.getsetdatas();
}else{
thiss.props.showNotification(result.data.message);
}
}).catch((error) => {
//console.log(error);
})
},
onCancel() {
},
});
} }
//删除 //删除
thisdelete=(attendance_id)=>{ thisdelete=(attendance_id)=>{
const url = `/weapps/attendances/${attendance_id}.json`; let thiss=this
var data={ confirm({
title: '提示',
} content: '确认删除此签到吗?',
axios.delete(url, data) onOk () {
.then((result) => { const url = `/weapps/attendances/${attendance_id}.json`;
if (result.data.status === 0) { var data={
// try {
// this.props.showNotification(`删除成功`);
// }catch (e) {
//
// }
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
} }
}).catch((error) => { axios.delete(url, data)
//console.log(error); .then((result) => {
}) if (result.data.status === 0) {
// try {
// thiss.props.showNotification(`删除成功`);
// }catch (e) {
//
// }
thiss.props.getsetdatas();
}else{
thiss.props.showNotification(result.data.message);
}
}).catch((error) => {
//console.log(error);
})
},
onCancel() {
},
});
} }
//学生签到 //学生签到
Signin=(attendance_mode,attendance_id,code)=>{ Signin=(attendance_mode,attendance_id,code)=>{
debugger
const url = `/weapps/course_member_attendances.json`; const url = `/weapps/course_member_attendances.json`;
var data={ var data={

@ -208,6 +208,7 @@
font-family:Microsoft YaHei; font-family:Microsoft YaHei;
font-weight:400; font-weight:400;
color:#333333; color:#333333;
} }
.progressivps{ .progressivps{
width:200px; width:200px;

@ -2,6 +2,8 @@ import "../css/Signinstatistics.css"
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Row, Col,Select,Table,Pagination } from 'antd'; import { Row, Col,Select,Table,Pagination } from 'antd';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../component/NoneDatas";
const { Option } = Select; const { Option } = Select;
class Signedinlist extends Component { class Signedinlist extends Component {
@ -79,10 +81,13 @@ class Signedinlist extends Component {
this.setState({ this.setState({
member_attendances:response.data.member_attendances, member_attendances:response.data.member_attendances,
members_count:response.data.members_count, members_count:response.data.members_count,
loading:false
}) })
} }
this.setState({
loading:false
})
}).catch((error) => { }).catch((error) => {
that.setState({ that.setState({
loading:false loading:false
@ -293,13 +298,39 @@ class Signedinlist extends Component {
</Col> </Col>
</Row> </Row>
<div className={"backfff mt10"}> <div className={"backfff mt10"}>
<Table columns={columns} dataSource={member_attendances} pagination={false} loading={this.state.loading}/> {
this.state.loading===true?
<div style={{
minHeight:"400px",
}}>
<LoadingSpin></LoadingSpin>
</div>
:
member_attendances&&member_attendances.length===0?
<div style={{
minHeight:"400px",
}}>
{/*<LoadingSpin></LoadingSpin>*/}
<NoneDatas></NoneDatas>
</div>
:
// loading={this.state.loading}
<Table columns={columns} dataSource={member_attendances} pagination={false} />
}
</div> </div>
<div className="mb30 clearfix educontent mt40 intermediatecenter"> <div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={this.state.page} onChange={this.paginationonChange} {
pageSize={this.state.limit} member_attendances&&member_attendances.length>0?
total={this.state.members_count}></Pagination> <Pagination showQuickJumper current={this.state.page} onChange={this.paginationonChange}
pageSize={this.state.limit}
total={this.state.members_count}></Pagination>
:""
}
</div> </div>
</React.Fragment> </React.Fragment>

@ -72,6 +72,7 @@ class Signindetails extends Component{
{/* 列表+筛选 */} {/* 列表+筛选 */}
<div> <div>
<Signedinlist <Signedinlist
mygetdatas={()=>this.mygetdatas()}
defaultActiveKey={this.props.defaultActiveKey} defaultActiveKey={this.props.defaultActiveKey}
switattendance_id={this.props.switattendance_id} switattendance_id={this.props.switattendance_id}
headdata={headdata} headdata={headdata}

@ -111,6 +111,18 @@ class Students_signin extends Component{
leave_count:response.data.leave_count, leave_count:response.data.leave_count,
absence_count:response.data.absence_count, absence_count:response.data.absence_count,
}) })
if(response.data.attendances.length===0&&mydata.page!==1){
this.setState({
page:mydata.page-1,
limit:5
})
let data={
key: mydata.key,
page:mydata.page-1,
limit:5
}
this.gogetdatas(data);
}
} }
} }
this.setState({ this.setState({
@ -198,11 +210,9 @@ class Students_signin extends Component{
switchs:bool, switchs:bool,
switattendance_id:id, switattendance_id:id,
}) })
// if(bool){ if(bool===false){
// var currenturl = window.location.href; this.getsetdatas();
// var newUrl = (currenturl.split("?"))[0]; }
// window.history.pushState('','',newUrl+'?type='+2);
// }
} }

Loading…
Cancel
Save