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

PCqiandao
杨树明 5 years ago
commit c6dd523b4c

@ -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(
<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{
background-image: url(${getImageUrl(`/images/qiandao/lishi.png`)});
}
@ -113,108 +137,112 @@ class Signinstatistics extends Component {
background-image: url(${getImageUrl(`/images/qiandao/qingjia.png`)});
}
`
}
</style>
<Col span={6}>
<Card style={{ width: 209 }} className={"gutterrowbox lishiqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas&&datas.all_history_count}</div>
</Card>
</Col>
<Col span={6}>
<Card style={{ width: 209 }} className={"ml8 gutterrowbox daokeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
<Col span={6}>
<Card style={{ width: 209 }} className={"ml14 gutterrowbox kuangkeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
<Col span={6} >
<Card style={{ width: 209 }} className={"ml20 gutterrowbox qingjiaqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
</Row>
<div className={"SigninstatisticsChart mt20"}>
<div className={"pd30"}>
<Row>
<Col span={14}>
<Row type="flex" justify="start">
<Col span={5}>
<Row>
<Col span={12} className={"mindaoke mr5"}></Col>
<Col>到课率</Col>
</Row>
</Col>
<Col span={5}>
<Row>
<Col span={12} className={"minkuangke mr5"}></Col>
<Col>旷课率</Col>
</Row>
</Col>
<Col span={5}>
<Row>
<Col span={12} className={"minqingjia mr5"}></Col>
<Col>请假率</Col>
</Row>
</Col>
</Row>
</Col>
<Col span={10}><Row type="flex" justify="end">
<Col span={8} className={"Signinstatisticsfont"}>显示最近十次签到</Col>
<Col span={10}>
<Select defaultValue={"全部"} onChange={(e)=>this.handleChange(e)} style={{width:"130px"}}>
{course_groups&&course_groups.map((item,key)=>{
return(
<Option value={item.id} title={item.name} >{item.name}</Option>
)
})}
</Select>
</Col>
</Row></Col>
</Row>
</div>
<div className={"padding03000"}>
<Chart height={400} data={newlist} scale={cols} forceFit>
{/*<Legend />*/}
<Axis name="month" />
<Axis
name="temperature"
label={{
formatter: val => `${val}%`
}}
/>
<Tooltip
crosshairs={{
type: "y"
}}
/>
<Geom
type="line"
position="month*temperature"
size={2}
// color={"city"}
shape={"smooth"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
/>
<Geom
type="point"
position="month*temperature"
size={4}
shape={"circle"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
style={{
stroke: "#fff",
lineWidth: 1
}}
/>
</Chart>
</div>
</div>
}
</style>
<Col span={6}>
<Card style={{ width: 209 }} className={"gutterrowbox lishiqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas&&datas.all_history_count}</div>
</Card>
</Col>
<Col span={6}>
<Card style={{ width: 209 }} className={"ml8 gutterrowbox daokeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_normal_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
<Col span={6}>
<Card style={{ width: 209 }} className={"ml14 gutterrowbox kuangkeqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_absence_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
<Col span={6} >
<Card style={{ width: 209 }} className={"ml20 gutterrowbox qingjiaqiandao"}>
<div className={"gutterrowboxcontent ml5"}>{datas?(datas&&datas.avg_leave_rate*100).toFixed(0)+"%":""}</div>
</Card>
</Col>
</Row>
<div className={"SigninstatisticsChart mt20"}>
<div className={"pd30"}>
<Row>
<Col span={14}>
<Row type="flex" justify="start">
<Col span={5}>
<Row>
<Col span={12} className={"mindaoke mr5"}></Col>
<Col>到课率</Col>
</Row>
</Col>
<Col span={5}>
<Row>
<Col span={12} className={"minkuangke mr5"}></Col>
<Col>旷课率</Col>
</Row>
</Col>
<Col span={5}>
<Row>
<Col span={12} className={"minqingjia mr5"}></Col>
<Col>请假率</Col>
</Row>
</Col>
</Row>
</Col>
<Col span={10}><Row type="flex" justify="end">
<Col span={8} className={"Signinstatisticsfont"}>显示最近十次签到</Col>
<Col span={10}>
<Select defaultValue={"全部"} onChange={(e)=>this.handleChange(e)} style={{width:"130px"}}>
{course_groups&&course_groups.map((item,key)=>{
return(
<Option value={item.id} title={item.name} >{item.name}</Option>
)
})}
</Select>
</Col>
</Row></Col>
</Row>
</div>
<div className={"padding03000"}>
<Chart height={400} data={newlist} scale={cols} forceFit>
{/*<Legend />*/}
<Axis name="month" />
<Axis
name="temperature"
label={{
formatter: val => `${val}%`
}}
/>
<Tooltip
crosshairs={{
type: "y"
}}
/>
<Geom
type="line"
position="month*temperature"
size={2}
// color={"city"}
shape={"smooth"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
/>
<Geom
type="point"
position="month*temperature"
size={4}
shape={"circle"}
color={["city", ["#26C7C9", "#FF835C","#EDBA6F"]]}
style={{
stroke: "#fff",
lineWidth: 1
}}
/>
</Chart>
</div>
</div>
</div>
}
</div>
</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" ?
<div className="ws25s" style={{
position: "relative",
overflow: 'hidden',
}}>
{
item && item.mode === "NUMBER" ?
@ -140,6 +141,15 @@ class Detailss extends Component {
<p className="h40s font-16" style={{
color: "#909399"
}}>签到码</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>
:
item && item.mode === "QRCODE" ?
@ -174,14 +184,7 @@ class Detailss extends Component {
</div>
</div>
{
defaultActiveKey === "1" ?
item && item.mode === "NUMBER" ?
<input id={"file_path" + 1} className="file_path_input" value={item&&item.code}/>
:""
:
""
}
</div>
</React.Fragment>

@ -112,10 +112,24 @@ class Teacherentry extends Component {
(
this.props.defaultActiveKey === "1" ?
<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 className="ws100s xaxisreverseorder">

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

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

@ -2,6 +2,8 @@ import "../css/Signinstatistics.css"
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 {
@ -79,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
@ -293,13 +298,39 @@ class Signedinlist extends Component {
</Col>
</Row>
<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 className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={this.state.page} onChange={this.paginationonChange}
pageSize={this.state.limit}
total={this.state.members_count}></Pagination>
{
member_attendances&&member_attendances.length>0?
<Pagination showQuickJumper current={this.state.page} onChange={this.paginationonChange}
pageSize={this.state.limit}
total={this.state.members_count}></Pagination>
:""
}
</div>
</React.Fragment>

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

@ -111,6 +111,18 @@ class Students_signin extends Component{
leave_count:response.data.leave_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({
@ -198,11 +210,9 @@ class Students_signin extends Component{
switchs:bool,
switattendance_id:id,
})
// if(bool){
// var currenturl = window.location.href;
// var newUrl = (currenturl.split("?"))[0];
// window.history.pushState('','',newUrl+'?type='+2);
// }
if(bool===false){
this.getsetdatas();
}
}

Loading…
Cancel
Save