PCqiandao
杨树林 5 years ago
parent c5bac09491
commit ef061d4be8

@ -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";

@ -101,7 +101,7 @@ class Teacherentry extends Component {
:
item.edit_auth === true ?
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s xiaoshou" onClick={()=>this.props.qiandaoxiangq(true,item.id)}>编辑</div>
<div className="jiezhis h40s xiaoshou" onClick={()=>this.props.Signinnamestypes(item.id,true,item.name)}>编辑</div>
<div className="shanchu h40s xiaoshou" onClick={()=>this.props.thisdelete(item.id)}>删除</div>
</div>
:

@ -149,6 +149,7 @@ class Teaccomponent extends Component{
mydatas.map((object, index) => {
return (
<Teacherentry
Signinnamestypes={(id,b,a)=>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)}

@ -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(
<React.Fragment>
{this.props.Signinnamestype?<Modal
title="提示"
visible={this.props.Signinnamestype}
closable={false}
footer={null}
>
<Form {...formItemLayout}>
<Form.Item>
{getFieldDecorator('name', {initialValue: this.props.mybianjiname,
rules: [{ required: true, message: '请输入签到名称' }],
})(<Input placeholder="请输入签到名称"/>)}
</Form.Item>
<div className={"mt20 marginauto clearfix edu-txt-center"}>
<a>
<Button type="primary" ghost style={leftbuton} onClick={()=>this.props.Signinnamestypes(null,false,"")}>
取消
</Button>
</a>
<a>
<Button type="primary" className={"ml20"} style={rightbuton} onClick={()=>this.setdatas()}>
确定
</Button>
</a>
</div>
</Form>
</Modal>:""}
</React.Fragment>
)
}
}
const Signinnames = Form.create({ name: 'Signinnames' })(Signinname);
export default Signinnames

@ -70,7 +70,7 @@ class Studentssignmodel extends Component {
<Form.Item>
{getFieldDecorator('name', {
rules: [{ required: true, message: 'Please input the title of collection!' }],
rules: [{ required: true, message: '请输入签到码' }],
})(<Input placeholder="请输入签到码"/>)}
</Form.Item>

@ -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{
<React.Fragment>
<div className="">
{/*编辑名称*/}
<Signinname
{...this.props}
{...this.state}
switattendance_id={switattendance_id}
mybianjiname={mybianjiname}
Signinnamestypes={(id,b,a)=>this.Signinnamestypes(id,b,a)}
getsetdatas={()=>this.getsetdatas()}
/>
{/*创建实训*/}
<Createsignmodel
{...this.state}
@ -262,6 +282,7 @@ class Students_signin extends Component{
<p className="mt20 mysligtes">{attendances_count}个签到正在进行</p>
<Teaccomponent
Spin={Spin}
Signinnamestypes={(id,b,a)=>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{
<Teaccomponent
Spin={Spin}
Signinnamestypes={(id,b,a)=>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)}

Loading…
Cancel
Save