Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

PCqiandao
cxt 5 years ago
commit 27766f66f8

@ -8,7 +8,7 @@ class Weapps::SubjectQuery < ApplicationQuery
end
def call
subjects = @current_laboratory.subjects.unhidden.publiced
subjects = @current_laboratory.subjects.unhidden.publiced.show_moblied
# 课程体系的过滤
if params[:sub_discipline_id].present?

@ -36,7 +36,7 @@ class Teacherentry extends Component {
<React.Fragment>
<div className={index===0?"ws100s edu-back-white ": "ws100s edu-back-white mt20"}>
<div className="ws100s teacherentrydiv ">
<p className="ws100s teachedivp ymaxnamewidthdivp xiaoshou" onClick={()=>this.props.qiandaoxiangq(true,item.id)}>
<p className={isAdmin?"ws100s teachedivp ymaxnamewidthdivp xiaoshou":"ws100s teachedivp ymaxnamewidthdivp"} onClick={isAdmin?()=>this.props.qiandaoxiangq(true,item.id):""}>
{
item.name
}
@ -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={

@ -162,3 +162,27 @@
.textcenter{
text-align: center !important;
}
.sginboxcolor26C7C9 .ant-select-selection--single{
border:1px solid #26C7C9 !important;
}
.sginboxcolor26C7C9 .ant-select-arrow{
color: #26C7C9 !important;
}
.sginboxcolorEAAE4E .ant-select-selection--single{
border:1px solid #EAAE4E !important;
}
.sginboxcolorEAAE4E .ant-select-arrow{
color: #EAAE4E !important;
}
.sginboxcolorFF835C .ant-select-selection--single{
border:1px solid #FF835C !important;
}
.sginboxcolorFF835C .ant-select-arrow{
color: #FF835C !important;
}

@ -21,14 +21,14 @@ class Signedinlist extends Component {
attendance_status:undefined,
state:[
{id:undefined,name:"全部状态"},
{id:"NORMAL",name:"正常出勤"},
{id:"LEAVE",name:"请假"},
{id:"ABSENCE",name:"旷课"},
{id:"NORMAL",name:"正常签到"},
{id:"LEAVE",name:"请 假"},
{id:"ABSENCE",name:"旷 课"},
],
newstate:[
{id:"NORMAL",name:"正常出勤"},
{id:"LEAVE",name:"请假"},
{id:"ABSENCE",name:"旷课"},
{id:"NORMAL",name:"正常签到"},
{id:"LEAVE",name:"请 假"},
{id:"ABSENCE",name:"旷 课"},
],
course_members_count:'--',
attendance_count:'--',
@ -43,7 +43,7 @@ class Signedinlist extends Component {
}
componentDidUpdate(prevProps, prevState) {
if(prevProps.headdata!=this.props.headdata){
console.log(this.props.headdata)
let {attendanceslist}=this.state;
if(this.props.headdata){
let listattendanceslist=attendanceslist;
@ -58,8 +58,8 @@ class Signedinlist extends Component {
this.setState({
listattendanceslist:listattendanceslist,
data:this.props.headdata,
course_members_count:this.props.headdata.all_count,
attendance_count:this.props.headdata.normal_count
course_members_count:this.props.headdata.normal_count,
attendance_count:this.props.headdata.all_count
})
}
@ -124,8 +124,7 @@ class Signedinlist extends Component {
}
getpath=(id)=>{
let {attendanceslist}=this.state;
let listattendanceslist=attendanceslist
let listattendanceslist=[]
let url=`/weapps/attendances/${this.props&&this.props.switattendance_id}.json`;
axios.get(url).then((response) => {
if(response.data){
@ -147,12 +146,12 @@ class Signedinlist extends Component {
})
}else{
this.setState({
course_members_count:response.data.all_count,
attendance_count: response.data.normal_count
course_members_count:response.data.normal_count,
attendance_count: response.data.all_count
})
}
this.setState({
listattendanceslist:attendanceslist,
listattendanceslist:listattendanceslist,
data:response.data
})
@ -190,6 +189,17 @@ class Signedinlist extends Component {
}
handleChange=(attendance_status,value)=>{
let {member_attendances}=this.state;
let newmember_attendances=member_attendances;
newmember_attendances.map((item,key)=>{
if(item.user_id===value){
item.attendance_status=attendance_status
}
})
let url=`/weapps/course_member_attendances/update_status.json`;
axios.post(url, {
@ -201,7 +211,9 @@ class Signedinlist extends Component {
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(`修改状态成功`);
this.setState({
member_attendances:newmember_attendances
})
}
})
.catch(function (error) {
@ -212,38 +224,54 @@ class Signedinlist extends Component {
}
render() {
let {attendanceslist,state,data,member_attendances,newstate}=this.state;
let {attendanceslist,state,data,member_attendances,newstate,attendance_status}=this.state;
const columns = [
{
title: '序号',
dataIndex: 'index',
key: 'index',
width:300,
className: "textcenter",
},
{
title: '姓名',
dataIndex: 'user_name',
key: 'user_name',
width:300,
className: "textcenter",
render: (text, record) => (
<span>{record.user_name===null?"--":record.user_name}</span>
)
},
{
title: '学号',
dataIndex: 'student_id',
key: 'student_id',
width:300,
className: "textcenter",
render: (text, record) => (
<span>{record.student_id===null?"--":record.student_id}</span>
)
},
{
title: '状态',
key: 'attendance_status',
width:300,
dataIndex: 'attendance_status',
className: "textcenter",
render: (text, record) => (
<span>
<Select key={record.index} defaultValue={record.attendance_status} className={"Signedinlistbox"} style={{ width: 167 }} onChange={(e)=>this.handleChange(e,record.user_id)}>
<Select key={record.index} defaultValue={record.attendance_status}
// className={"Signedinlistbox"}
className={record.attendance_status==="NORMAL"?"color26C7C9 Signedinlistbox sginboxcolor26C7C9":record.attendance_status==="LEAVE"?"colorEAAE4E Signedinlistbox sginboxcolorEAAE4E":record.attendance_status==="ABSENCE"?"colorFF835C Signedinlistbox sginboxcolorFF835C":"Signedinlistbox"}
style={{ width: 167 }} onChange={(e)=>this.handleChange(e,record.user_id)}>
{
newstate&&newstate.map((item,key)=>{
return(
<Option value={item.id} key={key}>{item.name}</Option>
<Option value={item.id} key={key}
className={item.name==="正常签到"?"color26C7C9 sginbox":item.name==="请 假"?"colorEAAE4E sginbox":item.name==="旷 课"?"colorFF835C sginbox":""}>{item.name}</Option>
)
})
}
@ -274,11 +302,18 @@ class Signedinlist extends Component {
<Col className="gutter-row ml20" span={6}>
<Select defaultValue="全部状态" className={"Signedinlistbox"} style={{ width: 167 }} onChange={this.handleChangestate}>
<Select defaultValue="全部状态"
className={"Signedinlistbox"}
//className={attendance_status&&attendance_status==="NORMAL"?"color26C7C9 Signedinlistbox sginboxcolor26C7C9":attendance_status&&attendance_status==="LEAVE"?"colorEAAE4E Signedinlistbox sginboxcolorEAAE4E":attendance_status&&attendance_status==="ABSENCE"?"colorFF835C Signedinlistbox sginboxcolorFF835C":"Signedinlistbox"}
style={{ width: 167 }} onChange={this.handleChangestate}>
{
state&&state.map((item,key)=>{
return(
<Option value={item.id} key={key}>{item.name}</Option>
<Option value={item.id} key={key}
//className={item.name==="正常签到"?"color26C7C9":item.name==="请假"?"colorEAAE4E":item.name==="旷课"?"colorFF835C":""}
>
{item.name}
</Option>
)
})
}

@ -25,8 +25,6 @@ class Signindetails extends Component{
//.log(response);
if(response){
if(response.data){
console.log("头部数据")
console.log(response.data)
this.setState({
headdata:response.data
})
@ -37,12 +35,6 @@ class Signindetails extends Component{
}
componentDidUpdate = (prevProps) => {
console.log("componentDidUpdate");
}
render(){
let {headdata}= this.state;

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

@ -30,7 +30,7 @@ class ShixunPathSearch extends Component {
//适配器
onChangeLabel(value) {
let rs = value === 'new' ? 'updated_at' : 'myshixuns_scount'
let rs = value === 'new' ? 'updated_at' : 'myshixuns_count'
let { discipline_id, sub_discipline_id } = this.state;
this.setState({
order: rs,

Loading…
Cancel
Save