|
|
|
@ -6,6 +6,8 @@ import Createsignmodel from '../model/Createsignmodel';
|
|
|
|
|
import Studentssignmodels from "../model/Studentssignmodel";
|
|
|
|
|
import Qrcodesignin from "../model/Qrcodesignin";
|
|
|
|
|
import Signinstatistics from "../Signinstatistics/Signinstatistics";
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
const { TabPane } = Tabs;
|
|
|
|
|
//在线学习
|
|
|
|
|
class Students_signin extends Component{
|
|
|
|
@ -15,14 +17,21 @@ class Students_signin extends Component{
|
|
|
|
|
this.state={
|
|
|
|
|
visible:false,
|
|
|
|
|
page:1,
|
|
|
|
|
per_page:20,
|
|
|
|
|
limit:5,
|
|
|
|
|
count:50,
|
|
|
|
|
defaultActiveKey:"1",
|
|
|
|
|
attendances_count:0,
|
|
|
|
|
datas:[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
let data={
|
|
|
|
|
key:"1",
|
|
|
|
|
page:1,
|
|
|
|
|
limit:5
|
|
|
|
|
}
|
|
|
|
|
this.gogetdatas(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
@ -34,6 +43,47 @@ class Students_signin extends Component{
|
|
|
|
|
console.log(key);
|
|
|
|
|
this.setState({
|
|
|
|
|
defaultActiveKey: key,
|
|
|
|
|
page:1,
|
|
|
|
|
limit:5
|
|
|
|
|
})
|
|
|
|
|
let data={
|
|
|
|
|
key:key,
|
|
|
|
|
page:1,
|
|
|
|
|
limit:5
|
|
|
|
|
}
|
|
|
|
|
if(key==="1" || key ==="2"){
|
|
|
|
|
this.gogetdatas(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gogetdatas =(mydata)=>{
|
|
|
|
|
const coureid=this.props.match.params.coursesId;
|
|
|
|
|
let urls = `/courses/${coureid}/attendances.json`;
|
|
|
|
|
let arry={}
|
|
|
|
|
if(mydata.key==="1" || mydata.key ===1){
|
|
|
|
|
arry={
|
|
|
|
|
page:mydata.page,
|
|
|
|
|
limit:mydata.limit,
|
|
|
|
|
};
|
|
|
|
|
}else if(mydata.key==="2" || mydata.key ===2){
|
|
|
|
|
arry={
|
|
|
|
|
history:true,
|
|
|
|
|
page:mydata.page,
|
|
|
|
|
limit:mydata.limit,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
axios.get(urls, {
|
|
|
|
|
params: arry
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.data){
|
|
|
|
|
this.setState({
|
|
|
|
|
attendances_count:response.data.attendances_count,
|
|
|
|
|
datas:response.data.attendances
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -61,12 +111,22 @@ class Students_signin extends Component{
|
|
|
|
|
this.setState({
|
|
|
|
|
page: pageNumber,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let data={
|
|
|
|
|
key:this.state.defaultActiveKey,
|
|
|
|
|
page:pageNumber,
|
|
|
|
|
limit:5
|
|
|
|
|
}
|
|
|
|
|
this.gogetdatas(data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
|
|
|
|
|
let {page,per_page,count,defaultActiveKey} =this.state
|
|
|
|
|
let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas} =this.state;
|
|
|
|
|
const isAdmin =this.props.isAdmin();
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
|
@ -94,21 +154,41 @@ class Students_signin extends Component{
|
|
|
|
|
<Tabs defaultActiveKey="1" onChange={this.callback}>
|
|
|
|
|
<TabPane tab="正在签到" key="1">
|
|
|
|
|
<p className="mt20 mysligtes">共3个签到正在进行</p>
|
|
|
|
|
<Teaccomponent defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent>
|
|
|
|
|
<Teaccomponent datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb30 clearfix educontent mt40 intermediatecenter">
|
|
|
|
|
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
|
|
|
|
|
pageSize={per_page}
|
|
|
|
|
total={count}></Pagination>
|
|
|
|
|
pageSize={limit}
|
|
|
|
|
total={attendances_count}></Pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="历史签到" key="2">
|
|
|
|
|
<p className="mt20 mysligtes">共3个签到正在进行</p>
|
|
|
|
|
<Teaccomponent defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent>
|
|
|
|
|
<div className="ws100s mt20 sortinxdirection">
|
|
|
|
|
<p className=" ws50s mysligtes sortinxdirection">共3个签到正在进行</p>
|
|
|
|
|
{
|
|
|
|
|
isAdmin===false?
|
|
|
|
|
<div className="ws50s xaxisreverseorder">
|
|
|
|
|
<p className="kkp pr32 " style={{color:"#FF835C"}}>旷课:2</p>
|
|
|
|
|
<p className="kkp mr20r" style={{color:"#EAAE4E"}}>请假:2</p>
|
|
|
|
|
<p className="kkp mr20r" style={{color:"#26C7C9"}}>正常签到:10</p>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Teaccomponent datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb30 clearfix educontent mt40 intermediatecenter">
|
|
|
|
|
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
|
|
|
|
|
pageSize={per_page}
|
|
|
|
|
total={count}></Pagination>
|
|
|
|
|
pageSize={limit}
|
|
|
|
|
total={attendances_count}></Pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="签到统计" key="3">
|
|
|
|
@ -117,11 +197,28 @@ class Students_signin extends Component{
|
|
|
|
|
{...this.state}
|
|
|
|
|
/>
|
|
|
|
|
</TabPane>
|
|
|
|
|
{
|
|
|
|
|
isAdmin===true?
|
|
|
|
|
<TabPane tab="签到统计" key="3">
|
|
|
|
|
Content of Tab Pane 3
|
|
|
|
|
</TabPane>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</Tabs>
|
|
|
|
|
<div className="positiondivs sortinxdirection xiaoshou">
|
|
|
|
|
<i className="iconfont icon-bianji5 posiivsicon"></i>
|
|
|
|
|
<p className="posiivs xiaoshou" onClick={()=>this.Qrcodesignintypefun()}>创建签到</p>
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
isAdmin?
|
|
|
|
|
<div className="positiondivs sortinxdirection xiaoshou">
|
|
|
|
|
<i className="iconfont icon-bianji5 posiivsicon"></i>
|
|
|
|
|
<p className="posiivs xiaoshou" onClick={()=>this.Createsign()}>创建签到</p>
|
|
|
|
|
</div>
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|