From 103c0f39a40e920ef9f45b0f2eea269aee28785e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 02:07:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 +- .../courses/signin/component/Teacherentry.js | 20 +++- .../teachercomponent/Teaccomponent.js | 98 ++++++++++++------- 3 files changed, 79 insertions(+), 43 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index fee6eb724..332e8ea73 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +// debugType="admin"; // 老师 // debugType="teacher"; // 学生 -// debugType="student"; +debugType="student"; diff --git a/public/react/src/modules/courses/signin/component/Teacherentry.js b/public/react/src/modules/courses/signin/component/Teacherentry.js index 0f6c8e9ae..6cbb48858 100644 --- a/public/react/src/modules/courses/signin/component/Teacherentry.js +++ b/public/react/src/modules/courses/signin/component/Teacherentry.js @@ -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..a03df188d 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,76 @@ class Teaccomponent extends Component{ } //截止 thisEnd=(attendance_id)=>{ - const url = `/weapps/attendances/${attendance_id}/end.json`; - var data={ - } - 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) { + // + // } + this.props.getsetdatas(); + }else{ + this.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); + 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 { + this.props.showNotification(`删除成功`); + }catch (e) { + + } + + this.props.getsetdatas(); + }else{ + this.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={ From 3fdbccd789b7465cb49040f172f066771fb43ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 02:08:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 332e8ea73..fee6eb724 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -// debugType="admin"; +debugType="admin"; // 老师 // debugType="teacher"; // 学生 -debugType="student"; +// debugType="student"; From 8caf263a5d3221e4a96f7e20e90ad88243192956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 02:13:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teachercomponent/Teaccomponent.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 a03df188d..099625aaf 100644 --- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js +++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js @@ -35,6 +35,7 @@ class Teaccomponent extends Component{ } //截止 thisEnd=(attendance_id)=>{ + let thiss=this confirm({ title: '提示', @@ -52,9 +53,9 @@ class Teaccomponent extends Component{ // }catch (e) { // // } - this.props.getsetdatas(); + thiss.props.getsetdatas(); }else{ - this.props.showNotification(result.data.message); + thiss.props.showNotification(result.data.message); } }).catch((error) => { @@ -69,6 +70,7 @@ class Teaccomponent extends Component{ } //删除 thisdelete=(attendance_id)=>{ + let thiss=this confirm({ title: '提示', content: '确认删除此签到吗?', @@ -80,15 +82,15 @@ class Teaccomponent extends Component{ axios.delete(url, data) .then((result) => { if (result.data.status === 0) { - try { - this.props.showNotification(`删除成功`); - }catch (e) { - - } + // try { + // thiss.props.showNotification(`删除成功`); + // }catch (e) { + // + // } - this.props.getsetdatas(); + thiss.props.getsetdatas(); }else{ - this.props.showNotification(result.data.message); + thiss.props.showNotification(result.data.message); } }).catch((error) => { From 5c450a59184b4c949531798a36a1c4bf6158bcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 14 Mar 2020 02:21:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/signin/teacher/Teachers_signin.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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({