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

# Conflicts:
#	public/react/src/modules/courses/signin/teacher/Teachers_signin.js
PCqiandao
杨树明 5 years ago
commit 4ee068ff78

@ -1097,7 +1097,8 @@ class Coursesleftnav extends Component{
item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>: item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>:
item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>: item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>:
item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>: item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>:"" item.type==="attendance"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-qiandao-1 mr10 fl":"iconfont icon-qiandao-1 mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>:""
} }
{/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/} {/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/}
@ -1238,7 +1239,7 @@ class Coursesleftnav extends Component{
item.type==="attachment"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-ziyuan mr10 fl":"iconfont icon-ziyuan mr10 fl"} ></i>: item.type==="attachment"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-ziyuan mr10 fl":"iconfont icon-ziyuan mr10 fl"} ></i>:
item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>: item.type==="board"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-taolun mr10 fl":"iconfont icon-taolun mr10 fl"} ></i>:
item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>: item.type==="course_group"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenban mr10 fl":"iconfont icon-fenban mr10 fl"} ></i>:
item.type==="attendance"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-qiandao-1 mr10 fl":"iconfont icon-qiandao-1 mr10 fl"} ></i>:
item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>: item.type==="video"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-bofang2 mr10 fl":"iconfont icon-bofang2 mr10 fl"} ></i>:
item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:"" item.type==="statistics"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-tongji mr10 fl":"iconfont icon-tongji mr10 fl"} ></i>:""
} }

@ -0,0 +1,36 @@
import React, { Component } from 'react';
import { getImageUrl , getUrl } from 'educoder';
class NoneDatas extends Component{
constructor(props) {
super(props)
}
render(){
const { style } = this.props;
return(
<div className="edu-tab-con-box clearfix edu-txt-center intermediatecenter" style={ style || { width:"100%",height:"100%"}}>
<style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
.zenwuxgsj{
font-size:17px;
font-family:MicrosoftYaHei;
color:rgba(136,136,136,1);
}
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb10 zenwuxgsj">暂无相关数据</p>
</div>
)
}
}
export default NoneDatas;

@ -1,6 +1,8 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import '../css/signincdi.css'; import '../css/signincdi.css';
import { Progress } from 'antd'; import { Progress } from 'antd';
import axios from 'axios';
//条目 //条目
class Teacherentry extends Component{ class Teacherentry extends Component{
//条目组件 //条目组件
@ -41,33 +43,33 @@ class Teacherentry extends Component{
<Progress percent={30} /> <Progress percent={30} />
</div> </div>
<div className="progressivpss"> <div className="progressivpss">
已签到22 /应签到55 已签到22 / 应签到55
</div> </div>
</div> </div>
<div className="ws100s sortinxdirection mt17"> <div className="ws100s sortinxdirection mt5">
<div className="ws80s sortinxdirection"> <div className="ws80s sortinxdirection">
<div className="teachedivps "> <div className="teachedivps h40s">
签到发起人 签到发起人
</div> </div>
<div className="teachedivpsy ymaxnamewidth60"> <div className="teachedivpsy ymaxnamewidth60 h40s">
胡一菲 胡一菲
</div> </div>
<div className="teachedivps ml20"> <div className="teachedivps ml20 h40s">
签到方式 签到方式
</div> </div>
<div className="teachedivpsy ymaxnamewidth80"> <div className="teachedivpsy ymaxnamewidth80 h40s">
二维码签到 二维码签到
</div> </div>
<div className="teachedivps ml20"> <div className="teachedivps ml20 h40s">
开始结束时间 开始结束时间
</div> </div>
<div className="teachedivpsy"> <div className="teachedivpsy h40s">
2010-03-10 10:00-11:00 2010-03-10 10:00-11:00
</div> </div>
</div> </div>
@ -75,23 +77,34 @@ class Teacherentry extends Component{
<div className="ws20s sortinxdirection"> <div className="ws20s sortinxdirection">
{ {
isAdmin===true? isAdmin===true?
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s">截止</div>
<div className="shanchu h40s">删除</div>
</div>
:
( (
this.props.defaultActiveKey==="0"? this.props.defaultActiveKey==="1"?
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">
<div className="jiezhis">截止</div>
<div className="shanchu">删除</div> <div className="qiandaobutton xiaoshou">
签到
</div>
</div> </div>
: :
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">
<div className="jiezhis">截止</div> {/*<div className="zcqiandao xiaoshou">*/}
<div className="shanchu">删除</div> {/* 正常签到*/}
</div> {/*</div>*/}
)
:
<div className="ws100s xaxisreverseorder">
{/*<div className="qjqiandao xiaoshou">*/}
{/* 请假*/}
{/*</div>*/}
</div> <div className="kkqiandao xiaoshou">
旷课
</div>
</div>
)
} }
</div> </div>

@ -1,6 +1,10 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import '../../css/signincdi.css'; import '../../css/signincdi.css';
import axios from 'axios';
import Teacherentry from "../Teacherentry"; import Teacherentry from "../Teacherentry";
import NoneDatas from '../NoneDatas';
import Listjihe from "../../../../question/component/Listjihe";
//在线学习 //在线学习
class Teaccomponent extends Component{ class Teaccomponent extends Component{
//教师正在签到 //教师正在签到
@ -8,14 +12,20 @@ class Teaccomponent extends Component{
super(props); super(props);
this.state={ this.state={
mydatas:[]
} }
} }
componentDidMount() { componentDidMount() {
this.setState({
mydatas:this.props.datas
})
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
@ -24,11 +34,21 @@ class Teaccomponent extends Component{
render(){ render(){
let mydatas=this.props.datas?this.props.datas:[];
return( return(
<React.Fragment> <React.Fragment>
<div className="ws100s mt20 h500">
<Teacherentry defaultActiveKey={this.props.defaultActiveKey}{...this.props} {...this.state}></Teacherentry> {
mydatas.length>0?
mydatas.map((object, index) => {
return (
<Teacherentry item={object} defaultActiveKey={this.props.defaultActiveKey}{...this.props} {...this.state}></Teacherentry>
)
})
:
<NoneDatas></NoneDatas>
}
</div>
</React.Fragment> </React.Fragment>
) )
} }

@ -91,6 +91,9 @@
.ws80s{ .ws80s{
width: 80%; width: 80%;
} }
.ws50s{
width: 50%;
}
.hs30s{ .hs30s{
height: 30%; height: 30%;
} }
@ -239,3 +242,80 @@
color:rgba(245,108,108,1); color:rgba(245,108,108,1);
margin-right: 30px; margin-right: 30px;
} }
.qiandaobutton{
font-size:16px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(255,255,255,1);
text-align: center;
line-height: 40px;
width:100px;
height:40px;
background:rgba(64,158,255,1);
border-radius:4px;
}
.zcqiandao{
width:100px;
height:40px;
border:1px solid rgba(38,199,201,1);
border-radius:4px;
font-size:16px;
font-family:Microsoft YaHei;
font-weight:400;
color:rgba(38,199,201,1);
text-align: center;
line-height: 40px;
}
.qjqiandao{
width:100px;
height:40px;
border:1px solid #EAAE4E;
border-radius:4px;
font-size:16px;
font-family:Microsoft YaHei;
font-weight:400;
color:#EAAE4E;
text-align: center;
line-height: 40px;
}
.kkqiandao{
width:100px;
height:40px;
border:1px solid #FF835C;
border-radius:4px;
font-size:16px;
font-family:Microsoft YaHei;
font-weight:400;
color:#FF835C;
text-align: center;
line-height: 40px;
}
.h40s{
line-height: 40px ;
}
.mt40{
margin-top: 40px !important;
}
.h500{
min-height: 500px;
}
.kkp{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
}
.pr32{
padding-right: 32px;
}
.mr20r{
margin-right: 20px;
}

@ -3,6 +3,8 @@ import '../css/signincdi.css';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import Teachers_signin from '../teacher/Teachers_signin'; import Teachers_signin from '../teacher/Teachers_signin';
import Students_signin from '../student/Students_signin'; import Students_signin from '../student/Students_signin';
import axios from 'axios';
const { TabPane } = Tabs; const { TabPane } = Tabs;
// 主签到目录 主签到目录 // 主签到目录 主签到目录
class Signinmain extends Component{ class Signinmain extends Component{
@ -30,13 +32,10 @@ class Signinmain extends Component{
return( return(
<React.Fragment> <React.Fragment>
<div > <div>
<Teachers_signin {...this.state} {...this.props}> <Teachers_signin {...this.state} {...this.props}>
</Teachers_signin> </Teachers_signin>
</div> </div>
</React.Fragment> </React.Fragment>
) )

@ -6,6 +6,8 @@ import Createsignmodel from '../model/Createsignmodel';
import Studentssignmodels from "../model/Studentssignmodel"; import Studentssignmodels from "../model/Studentssignmodel";
import Qrcodesignin from "../model/Qrcodesignin"; import Qrcodesignin from "../model/Qrcodesignin";
import Signinstatistics from "../Signinstatistics/Signinstatistics"; import Signinstatistics from "../Signinstatistics/Signinstatistics";
import axios from 'axios';
const { TabPane } = Tabs; const { TabPane } = Tabs;
//在线学习 //在线学习
class Students_signin extends Component{ class Students_signin extends Component{
@ -15,14 +17,21 @@ class Students_signin extends Component{
this.state={ this.state={
visible:false, visible:false,
page:1, page:1,
per_page:20, limit:5,
count:50, count:50,
defaultActiveKey:"1", defaultActiveKey:"1",
attendances_count:0,
datas:[]
} }
} }
componentDidMount() { componentDidMount() {
let data={
key:"1",
page:1,
limit:5
}
this.gogetdatas(data);
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
@ -34,6 +43,47 @@ class Students_signin extends Component{
console.log(key); console.log(key);
this.setState({ this.setState({
defaultActiveKey: key, 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({ this.setState({
page: pageNumber, page: pageNumber,
}) })
let data={
key:this.state.defaultActiveKey,
page:pageNumber,
limit:5
}
this.gogetdatas(data);
} }
render(){ 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( return(
<React.Fragment> <React.Fragment>
@ -94,21 +154,41 @@ class Students_signin extends Component{
<Tabs defaultActiveKey="1" onChange={this.callback}> <Tabs defaultActiveKey="1" onChange={this.callback}>
<TabPane tab="正在签到" key="1"> <TabPane tab="正在签到" key="1">
<p className="mt20 mysligtes">共3个签到正在进行</p> <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"> <div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange} <Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page} pageSize={limit}
total={count}></Pagination> total={attendances_count}></Pagination>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="历史签到" key="2"> <TabPane tab="历史签到" key="2">
<p className="mt20 mysligtes">共3个签到正在进行</p> <div className="ws100s mt20 sortinxdirection">
<Teaccomponent defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent> <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"> <div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange} <Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page} pageSize={limit}
total={count}></Pagination> total={attendances_count}></Pagination>
</div> </div>
</TabPane> </TabPane>
<TabPane tab="签到统计" key="3"> <TabPane tab="签到统计" key="3">
@ -117,11 +197,28 @@ class Students_signin extends Component{
{...this.state} {...this.state}
/> />
</TabPane> </TabPane>
{
isAdmin===true?
<TabPane tab="签到统计" key="3">
Content of Tab Pane 3
</TabPane>
:
""
}
</Tabs> </Tabs>
<div className="positiondivs sortinxdirection xiaoshou"> <div className="positiondivs sortinxdirection xiaoshou">
<i className="iconfont icon-bianji5 posiivsicon"></i> <i className="iconfont icon-bianji5 posiivsicon"></i>
<p className="posiivs xiaoshou" onClick={()=>this.Qrcodesignintypefun()}>创建签到</p> <p className="posiivs xiaoshou" onClick={()=>this.Qrcodesignintypefun()}>创建签到</p>
</div> </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>
</div> </div>

@ -429,7 +429,8 @@ class Contentpart extends Component {
</Listjihe> </Listjihe>
) )
})} })
}

Loading…
Cancel
Save