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

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

@ -91,6 +91,9 @@
.ws80s{
width: 80%;
}
.ws50s{
width: 50%;
}
.hs30s{
height: 30%;
}
@ -239,3 +242,80 @@
color:rgba(245,108,108,1);
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 Teachers_signin from '../teacher/Teachers_signin';
import Students_signin from '../student/Students_signin';
import axios from 'axios';
const { TabPane } = Tabs;
// 主签到目录 主签到目录
class Signinmain extends Component{
@ -30,13 +32,10 @@ class Signinmain extends Component{
return(
<React.Fragment>
<div >
<div>
<Teachers_signin {...this.state} {...this.props}>
</Teachers_signin>
</div>
</React.Fragment>
)

@ -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>

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

Loading…
Cancel
Save