Commit 9a8d97c1 authored by sujie@126.com's avatar sujie@126.com

dd

parent a8c70bf1
......@@ -56,6 +56,7 @@
"react/sort-comp": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"react/no-danger": "off",
"no-underscore-dangle": 0
"no-underscore-dangle": 0,
"react/no-did-mount-set-state": 0
}
}
\ No newline at end of file
......@@ -399,7 +399,7 @@ class CallStudents extends React.Component {
<div>
<Modal
visible={callStudentsShow}
title="一键排课"
title="班级点名"
okText="确定"
onCancel={this.hideCallStudents}
onOk={this.studentCallPost}
......
......@@ -246,7 +246,7 @@ export default {
keyword: '',
course_id: '',
class_id: '',
student_status: 1,
student_status: '',
age_start: 0,
age_end: 0,
birthday_month: 0,
......@@ -533,6 +533,7 @@ export default {
student_id: selectdeStudent.id,
course_id: values.course_id,
expend: values.expend,
mode_type: values.course_mode || 1,
});
yield put({
type: 'updateState',
......
......@@ -407,7 +407,7 @@ export default {
const studentsLogsData = yield call(studentsAjax.studentsLog, {
student_id: studentId,
page: 1,
perPage: 10,
perPage: 1999,
// class_id: payload.class_id,
});
setTimeout(loadmessage);
......
......@@ -9,12 +9,20 @@ const { TextArea } = Input;
class EditClassModal extends React.Component {
state = {
classRoomId: '',
title: '',
};
componentWillMount() {
}
componentDidMount() { // 挂载
pageIn('班级管理');
// 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
this.setState({
title: this.props.editClassInfo.title,
});
}
componentWillUnmount() { // 卸载
}
......@@ -36,6 +44,11 @@ class EditClassModal extends React.Component {
classRoomId: e,
});
}
titleChange = (e) => {
this.setState({
title: e.target.value,
});
}
render() {
const {
visible,
......@@ -49,7 +62,7 @@ class EditClassModal extends React.Component {
isEdit,
form,
} = this.props;
const { classRoomId } = this.state;
const { classRoomId, title } = this.state;
let classRoom;
let class_room_id;
if (isEdit == 1) {
......@@ -57,6 +70,9 @@ class EditClassModal extends React.Component {
class_room_id = classRoom ? editClassInfo.class_room_id : '';
}
const { getFieldDecorator } = this.props.form;
const selectBefore = (
<div>{title.length || 0}/20</div>
);
return (
<Modal
visible={visible}
......@@ -68,7 +84,7 @@ class EditClassModal extends React.Component {
confirmLoading={classSubmitting}
zIndex={110}
>
<Form className="modalform" hideRequiredMark={() => (true)}>
<Form className="modalform">
<Form.Item
label="课程名称:"
labelCol={{
......@@ -84,10 +100,12 @@ class EditClassModal extends React.Component {
initialValue: editClassInfo.course_id,
rules: [{ required: true, message: '课程不能为空' }],
})(
<Select>
<Option value="">请选择课程名称</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>)}
isEdit == 1 ?
<span>{ courseList.find(ele => ele.id == editClassInfo.course_id) && courseList.find(ele => ele.id == editClassInfo.course_id).title }</span> :
<Select>
<Option value="">请选择课程名称</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>)}
</Form.Item>
<Form.Item
label="班级名称:"
......@@ -106,7 +124,7 @@ class EditClassModal extends React.Component {
{ required: true, message: '班级名称不能为空' },
{ max: 20, message: '班级名称最多20字符' },
],
})(<Input type="text" placeholder="请输入班级名称" />)}
})(<Input type="text" maxLength={20} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入班级名称" />)}
</Form.Item>
<Form.Item
label="班级容量:"
......@@ -127,6 +145,10 @@ class EditClassModal extends React.Component {
pattern: /^\d+$/,
message: '请输入大于0的整数',
},
{
max: 9999,
message: '容量最多为9999',
},
],
})(<InputNumber placeholder="请输入班级容量" style={{ width: '100%' }} />)}
</Form.Item>
......
......@@ -9,6 +9,7 @@ class ClassMgtForm extends React.Component {
state = {
modalVisible: false,
isEdit: false,
title: '',
}
componentDidMount() { // 挂载
pageIn('课程管理');
......@@ -21,6 +22,10 @@ class ClassMgtForm extends React.Component {
const { dispatch, form } = this.props;
if (modalVisible) {
this.state.isEdit = false;
} else {
this.setState({
title: '',
});
}
form.resetFields();
dispatch({
......@@ -45,6 +50,9 @@ class ClassMgtForm extends React.Component {
this.state.modalVisible = true;
this.state.isEdit = true;
const { dispatch } = this.props;
this.setState({
title: course.title,
});
dispatch({
type: 'course/getSelectedCourse',
payload: {
......@@ -61,6 +69,11 @@ class ClassMgtForm extends React.Component {
},
});
}
titleChange = (e) => {
this.setState({
title: e.target.value,
});
}
courseDelete = (id, courseDelete) => {
const { dispatch } = this.props;
Modal.confirm({
......@@ -123,7 +136,7 @@ class ClassMgtForm extends React.Component {
});
}
render() {
const { isEdit } = this.state;
const { isEdit, title } = this.state;
const { getFieldDecorator } = this.props.form;
const {
coursesinfo,
......@@ -191,6 +204,9 @@ class ClassMgtForm extends React.Component {
},
},
];
const selectBefore = (
<div>{title.length || 0}/20</div>
);
return (
<div className={pageStyle.container}>
<div className={pageStyle.headerbox}>
......@@ -216,7 +232,7 @@ class ClassMgtForm extends React.Component {
destroyOnClose
>
<Form>
<Form.Item hasFeedback>
<Form.Item>
<span style={{ paddingLeft: 45 }}>课程名称*</span>
{getFieldDecorator('title', {
initialValue: editCourseInfo.title,
......@@ -230,7 +246,7 @@ class ClassMgtForm extends React.Component {
message: '课程名称最多20个字符',
},
],
})(<Input style={{ width: 200 }} maxLength={20} placeholder="输入课程名称" />)}
})(<Input style={{ width: 200 }} onChange={e => this.titleChange(e)} addonAfter={selectBefore} maxLength={20} placeholder="输入课程名称" />)}
</Form.Item>
<Form.Item>
<span style={{ paddingLeft: 45 }}>课表颜色*</span>
......
......@@ -135,10 +135,10 @@ class HeadquarterMgtForm extends React.Component {
rules: [
{
required: true,
message: '请输入课程名称',
message: '请输入机构码',
},
],
})(<Input className={pageStyle.inputbtn} style={{ width: 200 }} placeholder="输入课程名称" />)}
})(<Input className={pageStyle.inputbtn} style={{ width: 200 }} placeholder="请输入机构码" />)}
</Form.Item>
</div>
<Alert
......
......@@ -21,7 +21,10 @@ class eliminateEdit extends React.Component {
const { save } = this.props;
this.props.form.validateFields((err, values) => {
if (!err) {
save(values);
save({
...values,
course_mode: this.state.currentCourse.course_mode,
});
}
});
}
......@@ -105,7 +108,11 @@ class eliminateEdit extends React.Component {
sm: { span: 20 },
}}
>
<InputNumber max={currentCourse.surplus || 0} style={{ width: 200 }} />,
{getFieldDecorator('expend', {
rules: [{ required: true, message: '课程不能为空' }],
})(
<InputNumber max={currentCourse.surplus || 0} style={{ width: 200 }} />,
)}
</Form.Item>
<Form.Item
label="操作人"
......
......@@ -366,7 +366,7 @@ class StudentMgt extends React.Component {
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>学员状态</div>
<Select className={pageStyle.selectitem} placeholder="请选择" value={searchstudentListQueryParams.student_status} onChange={e => this.searchParamsChange(e, 'Select', 'student_status')}>
<Option value=""></Option>
<Option value="">全部</Option>
<Option value={1}>在读</Option>
<Option value={2}>到期</Option>
</Select>
......
......@@ -452,10 +452,10 @@ class StudentMgt extends React.Component {
<div className={pageStyle.tableoperatebox}>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toRenewCourse(record)}>续课</a>
<span className={pageStyle.divideline}>|</span>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChangeCourse(record)} >转课</a>
<span className={pageStyle.divideline}>|</span>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.showDeleteConfirm(record.id)}>退课</a>
<span className={pageStyle.divideline}>|</span>
{ record.surplus > 0 && <a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChangeCourse(record)} >转课</a>}
{ record.surplus > 0 && <span className={pageStyle.divideline}>|</span>}
{ record.surplus > 0 && <a className={pageStyle.alink} href="javascript:;" onClick={() => this.showDeleteConfirm(record.id)}>退课</a>}
{ record.surplus > 0 && <span className={pageStyle.divideline}>|</span>}
</div>
);
},
......@@ -565,7 +565,7 @@ class StudentMgt extends React.Component {
<div className={pageStyle.tabselect}>选择课程:</div>
<Col span={4}>
<Select placeholder="课程列表" style={{ width: 233 }} onChange={this.OperationLog}>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
{studentsdetail.student_courses.map(ele => <Option value={ele.id}>{ele.course.title}</Option>)}
</Select>
</Col>
<div className={pageStyle.tablebox}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment