From a1c9a24cdeff9c926d2ca016ae2725859a04de4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 13 Mar 2020 15:03:06 +0800
Subject: [PATCH 1/5] =?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 | 2 +-
.../teachercomponent/Teaccomponent.js | 68 +++++++++++++++++--
.../modules/courses/signin/css/signincdi.css | 4 +-
3 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index f5510a039..7a35aa116 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -46,7 +46,7 @@ if (isDev) {
// 老师
// debugType="teacher";
// 学生
-// debugType="student";
+debugType="student";
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 26a871416..a7a526f03 100644
--- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js
+++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js
@@ -39,10 +39,15 @@ class Teaccomponent extends Component{
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
- // this.props.showNotification(`组卷成功`);
- // console.log(result.data.exam_id);
- //本来调试卷库首页的
+ // try {
+ // this.props.showNotification(`截止成功`);
+ // }catch (e) {
+ //
+ // }
this.props.getsetdatas();
+ }else{
+ this.props.showNotification(result.data.message);
+
}
}).catch((error) => {
//console.log(error);
@@ -57,10 +62,16 @@ class Teaccomponent extends Component{
axios.delete(url, data)
.then((result) => {
if (result.data.status === 0) {
- // this.props.showNotification(`组卷成功`);
- // console.log(result.data.exam_id);
- //本来调试卷库首页的
+ // try {
+ // this.props.showNotification(`删除成功`);
+ // }catch (e) {
+ //
+ // }
+
this.props.getsetdatas();
+ }else{
+ this.props.showNotification(result.data.message);
+
}
}).catch((error) => {
//console.log(error);
@@ -68,7 +79,50 @@ class Teaccomponent extends Component{
}
//学生签到
- Signin=(type,)=>{
+ Signin=(attendance_mode,attendance_id,code)=>{
+ const url = `/weapps/course_member_attendances.json`;
+ var data={
+
+ }
+ if(attendance_mode==="QUICK"){
+ //快捷签到
+ data={
+ attendance_mode:"QUICK",
+ attendance_id:attendance_id,
+ }
+ 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) => {
+ })
+ }else if(attendance_mode==="QRCODE"){
+ //二维码签到
+ data={
+ attendance_mode:"QRCODE",
+ attendance_id:attendance_id,
+ code:code,
+ }
+
+ }else if(attendance_mode==="NUMBER"){
+ //数字签到
+ data={
+ attendance_mode:"NUMBER",
+ attendance_id:attendance_id,
+ code:code,
+ }
+
+ }
}
diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css
index e6f4ccf21..08ebe7f0a 100644
--- a/public/react/src/modules/courses/signin/css/signincdi.css
+++ b/public/react/src/modules/courses/signin/css/signincdi.css
@@ -211,8 +211,8 @@
}
.ymaxnamewidth60{
- max-width: 60px;
- width: 60px;
+ max-width: 70px;
+ width: 70px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
From f6c7b0072422b3746d8989d9f01c9f1a9a2e9a48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 13 Mar 2020 15:36:29 +0800
Subject: [PATCH 2/5] =?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/package.json | 1 +
.../teachercomponent/Teaccomponent.js | 3 +-
.../courses/signin/model/Qrcodesignin.js | 15 ++--
.../courses/signin/model/Studentssignmodel.js | 33 +++++++--
.../courses/signin/teacher/Teachers_signin.js | 70 ++++++++++++++++++-
5 files changed, 108 insertions(+), 14 deletions(-)
diff --git a/public/react/package.json b/public/react/package.json
index d29adb905..e644e2166 100644
--- a/public/react/package.json
+++ b/public/react/package.json
@@ -61,6 +61,7 @@
"postcss-loader": "2.0.8",
"promise": "8.0.1",
"prop-types": "^15.6.1",
+ "qrcode.react": "^1.0.0",
"qs": "^6.6.0",
"quill": "^1.3.7",
"quill-delta-to-html": "^0.11.0",
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 a7a526f03..e2f51d4e1 100644
--- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js
+++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js
@@ -113,7 +113,7 @@ class Teaccomponent extends Component{
attendance_id:attendance_id,
code:code,
}
-
+ this.props.GotomQrcodesodesy(data,true)
}else if(attendance_mode==="NUMBER"){
//数字签到
data={
@@ -121,6 +121,7 @@ class Teaccomponent extends Component{
attendance_id:attendance_id,
code:code,
}
+ this.props.Gotomodes(data,true)
}
diff --git a/public/react/src/modules/courses/signin/model/Qrcodesignin.js b/public/react/src/modules/courses/signin/model/Qrcodesignin.js
index aa028cb17..1979a6370 100644
--- a/public/react/src/modules/courses/signin/model/Qrcodesignin.js
+++ b/public/react/src/modules/courses/signin/model/Qrcodesignin.js
@@ -1,12 +1,11 @@
import React,{ Component } from "react";
-
import { Modal , Button} from 'antd';
+import QRCode from 'qrcode.react';
class Qrcodesignin extends Component {
constructor(props) {
super(props)
}
-
render() {
const leftbuton={
@@ -33,7 +32,11 @@ class Qrcodesignin extends Component {
-

+
@@ -43,13 +46,13 @@ class Qrcodesignin extends Component {
-
-
+ this.props.GotomQrcodesodesy(null,false)}>
确定
@@ -71,4 +74,4 @@ class Qrcodesignin extends Component {
-export default Qrcodesignin
\ No newline at end of file
+export default Qrcodesignin
diff --git a/public/react/src/modules/courses/signin/model/Studentssignmodel.js b/public/react/src/modules/courses/signin/model/Studentssignmodel.js
index b09f865f5..32ece78b1 100644
--- a/public/react/src/modules/courses/signin/model/Studentssignmodel.js
+++ b/public/react/src/modules/courses/signin/model/Studentssignmodel.js
@@ -1,12 +1,37 @@
import React,{ Component } from "react";
import { Modal , Form, Input,Button} from 'antd';
+import axios from 'axios';
class Studentssignmodel extends Component {
constructor(props) {
super(props)
}
-
+ setdatas=()=>{
+ const url = `/weapps/course_member_attendances.json`;
+ let data={
+ code:this.props.Studentssigntypedata.code,
+ attendance_mode:"NUMBER",
+ attendance_id:this.props.Studentssigntypedata.attendance_id,
+ }
+ axios.post(url, data)
+ .then((result) => {
+ if (result.data.status === 0) {
+ try {
+ this.props.showNotification(`签到成功`);
+ }catch (e) {
+
+ }
+ this.props.getsetdatas();
+ this.props.Gotomodes(null,false)
+ }else{
+ this.props.showNotification(result.data.message);
+
+ }
+ }).catch((error) => {
+ })
+
+ }
render() {
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
@@ -45,13 +70,13 @@ class Studentssignmodel extends Component {
-
+ this.props.Gotomodes(null,false)}>
取消
-
+ this.setdatas()}>
确定
@@ -73,4 +98,4 @@ class Studentssignmodel extends Component {
const Studentssignmodels = Form.create({ name: 'Studentssignmodel' })(Studentssignmodel);
-export default Studentssignmodels
\ No newline at end of file
+export default Studentssignmodels
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 18f327485..e404def1c 100644
--- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js
+++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js
@@ -25,6 +25,10 @@ class Students_signin extends Component{
normal_count:0,
leave_count:0,
absence_count:0,
+ Studentssigntype:false,
+ Studentssigntypedata:null,
+ Qrcodesignintype:false,
+ Qrcodesignintypedata:null,
}
}
@@ -136,10 +140,47 @@ class Students_signin extends Component{
this.gogetdatas(data);
}
+ Gotomodes(data,bool){
+ if(bool===true){
+ this.setState({
+ Studentssigntypedata:data,
+ Studentssigntype:true
+ })
+ }else{
+ this.setState({
+ Studentssigntype:false,
+ Studentssigntypedata:null,
+
+ })
+ }
+
+
+ }
+ GotomQrcodesodesy(data,bool){
+ if(bool===true){
+ this.setState({
+ Qrcodesignintype:false,
+ Qrcodesignintypedata:data,
+ })
+ }else{
+ this.setState({
+ Qrcodesignintype:false,
+ Qrcodesignintypedata:null,
+
+ })
+ }
+
+
+ }
+
+
+
render(){
- let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas,absence_count,leave_count,normal_count} =this.state;
+ let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas,absence_count,leave_count,normal_count,
+ Studentssigntype,Studentssigntypedata,Qrcodesignintype,Qrcodesignintypedata,
+ } =this.state;
const isAdmin =this.props.isAdmin();
return(
@@ -155,11 +196,19 @@ class Students_signin extends Component{
this.Gotomodes(d,b)}
+ getsetdatas={()=>this.getsetdatas()}
/>
{/*二维码*/}
this.getsetdatas()}
+ GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
/>
@@ -169,7 +218,14 @@ class Students_signin extends Component{
共{attendances_count}个签到正在进行
- this.getsetdatas()} datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}
+ this.Gotomodes(d,b)}
+ GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
+ getsetdatas={()=>this.getsetdatas()}
+ datas={datas}
+ defaultActiveKey={defaultActiveKey}
+ {...this.state}
+ {...this.props}
>
@@ -199,7 +255,15 @@ class Students_signin extends Component{
- this.getsetdatas()} datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}>
+ this.Gotomodes(d,b)}
+ GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
+ getsetdatas={()=>this.getsetdatas()}
+ datas={datas}
+ defaultActiveKey={defaultActiveKey}
+ {...this.state}
+ {...this.props}
+ >
From 5e08dc6bf3a8987b12901c1a394ff5c4b52804e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 13 Mar 2020 15:48:47 +0800
Subject: [PATCH 3/5] =?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/model/Studentssignmodel.js | 48 +++++++++++--------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/public/react/src/modules/courses/signin/model/Studentssignmodel.js b/public/react/src/modules/courses/signin/model/Studentssignmodel.js
index 32ece78b1..7650d103d 100644
--- a/public/react/src/modules/courses/signin/model/Studentssignmodel.js
+++ b/public/react/src/modules/courses/signin/model/Studentssignmodel.js
@@ -8,28 +8,34 @@ class Studentssignmodel extends Component {
super(props)
}
setdatas=()=>{
- const url = `/weapps/course_member_attendances.json`;
- let data={
- code:this.props.Studentssigntypedata.code,
- attendance_mode:"NUMBER",
- attendance_id:this.props.Studentssigntypedata.attendance_id,
- }
- axios.post(url, data)
- .then((result) => {
- if (result.data.status === 0) {
- try {
- this.props.showNotification(`签到成功`);
- }catch (e) {
-
- }
- this.props.getsetdatas();
- this.props.Gotomodes(null,false)
- }else{
- this.props.showNotification(result.data.message);
-
+ this.props.form.validateFields((err, values) => {
+ if (!err) {
+ const url = `/weapps/course_member_attendances.json`;
+ let data={
+ code:values.name,
+ attendance_mode:"NUMBER",
+ attendance_id:this.props.Studentssigntypedata.attendance_id,
}
- }).catch((error) => {
- })
+ axios.post(url, data)
+ .then((result) => {
+ if (result.data.status === 0) {
+ try {
+ this.props.showNotification(`签到成功`);
+ }catch (e) {
+
+ }
+ this.props.getsetdatas();
+ this.props.Gotomodes(null,false)
+ }else{
+ this.props.showNotification(result.data.message);
+
+ }
+ }).catch((error) => {
+ })
+ }
+ });
+
+
}
render() {
From 0b4954c8e609a05f371e2fd84824251f700b2b9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 13 Mar 2020 15:49:42 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E7=AD=BE=E5=88=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/signin/teacher/Teachers_signin.js | 4 ----
1 file changed, 4 deletions(-)
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 e404def1c..7f56dd2f1 100644
--- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js
+++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js
@@ -285,10 +285,6 @@ class Students_signin extends Component{
}
-
-
-
this.Qrcodesignintypefun()}>创建签到
-
{
isAdmin?
From 59b1ab9c2650f242085e1bcd6c7784d5ff825dc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 13 Mar 2020 15:50:37 +0800
Subject: [PATCH 5/5] =?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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 7a35aa116..f5510a039 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -46,7 +46,7 @@ if (isDev) {
// 老师
// debugType="teacher";
// 学生
-debugType="student";
+// debugType="student";