From ef061d4be8bcce06d9ec1f87c5565ec4fb83c865 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 22:13:52 +0800 Subject: [PATCH] =?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 | 2 +- .../teachercomponent/Teaccomponent.js | 1 + .../courses/signin/model/Signinname.js | 105 ++++++++++++++++++ .../courses/signin/model/Studentssignmodel.js | 2 +- .../courses/signin/teacher/Teachers_signin.js | 26 ++++- 6 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 public/react/src/modules/courses/signin/model/Signinname.js diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 7a35aa116..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"; diff --git a/public/react/src/modules/courses/signin/component/Teacherentry.js b/public/react/src/modules/courses/signin/component/Teacherentry.js index 486afb5c5..0f6c8e9ae 100644 --- a/public/react/src/modules/courses/signin/component/Teacherentry.js +++ b/public/react/src/modules/courses/signin/component/Teacherentry.js @@ -101,7 +101,7 @@ class Teacherentry extends Component { : item.edit_auth === true ?
-
this.props.qiandaoxiangq(true,item.id)}>编辑
+
this.props.Signinnamestypes(item.id,true,item.name)}>编辑
this.props.thisdelete(item.id)}>删除
: 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 581d9e36b..5b8d21b1d 100644 --- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js +++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js @@ -149,6 +149,7 @@ class Teaccomponent extends Component{ mydatas.map((object, index) => { return ( this.props.Signinnamestypes(id,b,a)} Signin={(a,b,c)=>this.Signin(a,b,c)} qiandaoxiangq={(b,id)=>this.props.qiandaoxiangq(b,id)} thisdelete={(id)=>this.thisdelete(id)} diff --git a/public/react/src/modules/courses/signin/model/Signinname.js b/public/react/src/modules/courses/signin/model/Signinname.js new file mode 100644 index 000000000..47b181151 --- /dev/null +++ b/public/react/src/modules/courses/signin/model/Signinname.js @@ -0,0 +1,105 @@ +import React,{ Component } from "react"; + +import { Modal , Form, Input,Button} from 'antd'; +import axios from 'axios'; + +class Signinname extends Component { + constructor(props) { + super(props) + } + setdatas=()=>{ + this.props.form.validateFields((err, values) => { + if (!err) { + const url = `/weapps/attendances/${this.props.switattendance_id}.json`; + let data={ + name:values.name, + } + axios.put(url, data) + .then((result) => { + if (result.data.status === 0) { + try { + this.props.showNotification(`修改成功`); + }catch (e) { + + } + this.props.getsetdatas(); + this.props.Signinnamestypes(null,false,"") + }else{ + this.props.showNotification(result.data.message); + + } + }).catch((error) => { + }) + } + }); + + + + } + render() { + const { getFieldDecorator } = this.props.form; + const formItemLayout = { + wrapperCol: { span: 25}, + }; + + const leftbuton={ + "width":"130px", + "height":"40px", + "border":"1px solid rgba(76,172,255,1)", + "border-radius":"4px", + } + + const rightbuton={ + "width":"130px", + "height":"40px", + "background":"#4CACFF", + "border-radius":"4px", + } + return( + + {this.props.Signinnamestype? + +
+ + + {getFieldDecorator('name', {initialValue: this.props.mybianjiname, + rules: [{ required: true, message: '请输入签到名称' }], + })()} + + +
+ + + + + + + + +
+ + +
+
:""} +
+ + ) + } + +} + + + + +const Signinnames = Form.create({ name: 'Signinnames' })(Signinname); + +export default Signinnames diff --git a/public/react/src/modules/courses/signin/model/Studentssignmodel.js b/public/react/src/modules/courses/signin/model/Studentssignmodel.js index 7650d103d..fa2f22882 100644 --- a/public/react/src/modules/courses/signin/model/Studentssignmodel.js +++ b/public/react/src/modules/courses/signin/model/Studentssignmodel.js @@ -70,7 +70,7 @@ class Studentssignmodel extends Component { {getFieldDecorator('name', { - rules: [{ required: true, message: 'Please input the title of collection!' }], + rules: [{ required: true, message: '请输入签到码' }], })()} 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 8da7c358a..1a8326885 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -6,8 +6,10 @@ import Teaccomponent from '../component/teachercomponent/Teaccomponent'; import Createsignmodel from '../model/Createsignmodel'; import Studentssignmodels from "../model/Studentssignmodel"; import Qrcodesignin from "../model/Qrcodesignin"; +import Signinname from '../model/Signinname'; import Signinstatistics from "../Signinstatistics/Signinstatistics"; import Signindetails from '../student/Signindetails'; + import axios from 'axios'; const { TabPane } = Tabs; @@ -35,6 +37,8 @@ class Students_signin extends Component{ switchs:false, switattendance_id:null, Spin:false, + Signinnamestype:false, + mybianjiname:"", } } @@ -212,13 +216,20 @@ class Students_signin extends Component{ this.gogetdatas(data); } - + Signinnamestypes=(id,bool,name)=>{ + this.setState({ + switattendance_id:id, + Signinnamestype:bool, + mybianjiname:name, + }) + } render(){ let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas,absence_count,leave_count,normal_count, - Studentssigntype,Studentssigntypedata,Qrcodesignintype,Qrcodesignintypedata,switchs,switattendance_id,Spin + Studentssigntype,Studentssigntypedata,Qrcodesignintype,Qrcodesignintypedata,switchs,switattendance_id,Spin, + mybianjiname } =this.state; const isAdmin =this.props.isAdmin(); @@ -226,6 +237,15 @@ class Students_signin extends Component{
+ {/*编辑名称*/} + this.Signinnamestypes(id,b,a)} + getsetdatas={()=>this.getsetdatas()} + /> {/*创建实训*/} 共{attendances_count}个签到正在进行

this.Signinnamestypes(id,b,a)} qiandaoxiangq={(b,id)=>this.qiandaoxiangq(b,id)} Gotomodes={(d,b)=>this.Gotomodes(d,b)} GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)} @@ -301,6 +322,7 @@ class Students_signin extends Component{ this.Signinnamestypes(id,b,a)} qiandaoxiangq={(b,id)=>this.qiandaoxiangq(b,id)} Gotomodes={(d,b)=>this.Gotomodes(d,b)} GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}