diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index d26fad5f4..180176ce2 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -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? diff --git a/public/react/src/modules/courses/signin/component/Teacherentry.js b/public/react/src/modules/courses/signin/component/Teacherentry.js index 0f6c8e9ae..f3aa4c297 100644 --- a/public/react/src/modules/courses/signin/component/Teacherentry.js +++ b/public/react/src/modules/courses/signin/component/Teacherentry.js @@ -36,7 +36,7 @@ class Teacherentry extends Component {
-

this.props.qiandaoxiangq(true,item.id)}> +

this.props.qiandaoxiangq(true,item.id):""}> { item.name } @@ -112,10 +112,24 @@ class Teacherentry extends Component { ( this.props.defaultActiveKey === "1" ?

+ { + item.attendance_status? + ( + item.attendance_status==="ABSENCE"? +
this.props.Signin(item.mode,item.id,item.attendance_code)}> + 签到 +
+ : + item.attendance_status==="NORMAL"? +
+ 正常签到 +
+ :"" + ) + : + "" + } -
this.props.Signin(item.mode,item.id,item.attendance_code)}> - 签到 -
:
diff --git a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js index 5b8d21b1d..099625aaf 100644 --- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js +++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js @@ -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={ diff --git a/public/react/src/modules/courses/signin/css/Signinstatistics.css b/public/react/src/modules/courses/signin/css/Signinstatistics.css index 0cd32b0a4..627458052 100644 --- a/public/react/src/modules/courses/signin/css/Signinstatistics.css +++ b/public/react/src/modules/courses/signin/css/Signinstatistics.css @@ -161,4 +161,28 @@ .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; } \ No newline at end of file diff --git a/public/react/src/modules/courses/signin/student/Signedinlist.js b/public/react/src/modules/courses/signin/student/Signedinlist.js index 46c6643c4..f9c3459a6 100644 --- a/public/react/src/modules/courses/signin/student/Signedinlist.js +++ b/public/react/src/modules/courses/signin/student/Signedinlist.js @@ -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) => ( + {record.user_name===null?"--":record.user_name} + ) }, { title: '学号', dataIndex: 'student_id', key: 'student_id', + width:300, className: "textcenter", + render: (text, record) => ( + {record.student_id===null?"--":record.student_id} + ) }, { title: '状态', key: 'attendance_status', + width:300, dataIndex: 'attendance_status', + className: "textcenter", render: (text, record) => ( - this.handleChange(e,record.user_id)}> { newstate&&newstate.map((item,key)=>{ return( - + ) }) } @@ -274,11 +302,18 @@ class Signedinlist extends Component { - { state&&state.map((item,key)=>{ return( - + ) }) } diff --git a/public/react/src/modules/courses/signin/student/Signindetails.js b/public/react/src/modules/courses/signin/student/Signindetails.js index b1d497b65..b9a7c7446 100644 --- a/public/react/src/modules/courses/signin/student/Signindetails.js +++ b/public/react/src/modules/courses/signin/student/Signindetails.js @@ -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; diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index 1a8326885..10a1a1a43 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -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({ diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index 844215974..d445a0c1d 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -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,