Commit 287079fe authored by wangxuelai's avatar wangxuelai

''

parent 9a8d97c1
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>轻校</title><link rel="shortcut icon" href="https://cdn.img.shangjiadao.cn/qingxiao/biz/image/qxlogo4.png"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;" name="viewport"><meta http-equiv="X-UA-Compatible" content="IE=edge"><!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]--><script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script><link href="/dist/index.css?1565771827295" rel="stylesheet"><script src="/lib/vendor.dll.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3" charset="utf-8"></script></head><body><div id="root"></div><script src="/dist/index.js?1565771827295" charset="utf-8"></script></body></html>
\ No newline at end of file
<![endif]--><script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script><link href="/dist/index.css?1565831228714" rel="stylesheet"><script src="/lib/vendor.dll.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3" charset="utf-8"></script></head><body><div id="root"></div><script src="/dist/index.js?1565831228714" charset="utf-8"></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,7 +36,8 @@
"qs": "^6.5.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"video-react": "^0.14.1"
"video-react": "^0.14.1",
"xlsx": "^0.15.0"
},
"devDependencies": {
"babel-eslint": "^8.2.2",
......
......@@ -2,101 +2,87 @@ export default {
menus: [
{
id: '1',
name: '概况',
activeIcon: {
backgroundPosition: '-99px 0',
name: '首页',
style: {
width: '20px',
height: '22px',
},
defaultIcon: {
backgroundPosition: '-67px 0',
},
activeurl: `${__IMGCDN__}menu/indexstaicactive.png`,
notactiveurl: `${__IMGCDN__}menu/indexstaicnotactive.png`,
activeurl: `${__IMGCDN__}menu/indexactive.png`,
notactiveurl: `${__IMGCDN__}menu/index.png`,
path: '/sjd/indexstaic',
relativePath: ['/sjd/indexstaic'],
},
{
id: '2',
name: '微官网管理',
activeIcon: {
backgroundPosition: '-99px -28px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
path: '/sjd/officialweb',
relativePath: ['/sjd/officialweb', '/sjd/officialwebeditor'],
},
{
id: '3',
name: '班级管理',
activeIcon: {
backgroundPosition: '-99px -28px',
style: {
width: '20px',
height: '20px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
activeurl: `${__IMGCDN__}menu/classactive.png`,
notactiveurl: `${__IMGCDN__}menu/class.png`,
path: '/sjd/classmgt',
relativePath: ['/sjd/classmgt', '/sjd/classdetail/:classid'],
},
{
id: '4',
name: '老师管理',
activeIcon: {
backgroundPosition: '-99px -28px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
style: {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
activeurl: `${__IMGCDN__}menu/teacheractive.png`,
notactiveurl: `${__IMGCDN__}menu/teacher.png`,
path: '/sjd/teacher',
relativePath: ['/sjd/teacher', '/sjd/teacherinfo/:id'],
},
{
id: '5',
name: '学生管理',
activeIcon: {
backgroundPosition: '-99px -28px',
style: {
width: '20px',
height: '20px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
activeurl: `${__IMGCDN__}menu/studentactive.png`,
notactiveurl: `${__IMGCDN__}menu/student.png`,
path: '/sjd/student',
relativePath: ['/sjd/student', '/sjd/studentinfo/:id', '/sjd/studentclass/:id'],
},
{
id: '6',
name: '课程管理',
activeIcon: {
backgroundPosition: '-99px -28px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
style: {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
activeurl: `${__IMGCDN__}menu/courseactive.png`,
notactiveurl: `${__IMGCDN__}menu/course.png`,
path: '/sjd/course',
relativePath: ['/sjd/course'],
},
{
id: '7',
name: '机构管理',
activeIcon: {
backgroundPosition: '-99px -28px',
style: {
width: '20px',
height: '20px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
activeurl: `${__IMGCDN__}menu/orgmgtactive.png`,
notactiveurl: `${__IMGCDN__}menu/orgmgt.png`,
path: '/sjd/institutions',
relativePath: ['/sjd/institutions'],
},
{
id: '2',
name: '小程序管理',
style: {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/minappactive.png`,
notactiveurl: `${__IMGCDN__}menu/minapp.png`,
// path: '/sjd/officialweb',
// relativePath: ['/sjd/officialweb', '/sjd/officialwebeditor'],
},
],
};
......@@ -8,17 +8,17 @@ const { TextArea } = Input;
const { Group } = Radio;
class CallStudents extends React.Component {
componentDidMount() { // 挂载
const { dispatch, classDetail } = this.props;
dispatch({
type: 'callstudents/updateState',
payload: {
expend: classDetail.expend,
copyExpend: classDetail.expend,
courseId: classDetail.course_id,
classroomId: classDetail.class_room_id,
classId: classDetail.id,
},
});
// const { dispatch, classDetail } = this.props;
// dispatch({
// type: 'callstudents/updateState',
// payload: {
// expend: classDetail.expend,
// copyExpend: classDetail.expend,
// courseId: classDetail.course_id,
// classroomId: classDetail.class_room_id,
// classId: classDetail.id,
// },
// });
}
componentDidUpdate() {
}
......@@ -80,9 +80,16 @@ class CallStudents extends React.Component {
});
}
studentCallPost = () => {
const { dispatch } = this.props;
const { dispatch, callBack } = this.props;
dispatch({
type: 'callstudents/studentCallPost',
payload: {
callBack: () => {
if (callBack && (typeof callBack == 'function')) {
callBack();
}
},
},
});
}
closeLinShiStudent = () => {
......@@ -399,7 +406,7 @@ class CallStudents extends React.Component {
<div>
<Modal
visible={callStudentsShow}
title="班级点名"
title="点名"
okText="确定"
onCancel={this.hideCallStudents}
onOk={this.studentCallPost}
......
......@@ -31,7 +31,9 @@ class classRoomMgt extends React.Component {
});
}
plansubmit = (e) => {
const { form, dispatch, classId } = this.props;
const {
form, dispatch, classId, saveSubmit,
} = this.props;
e.preventDefault();
form.validateFields((err, values) => {
if (!err) {
......@@ -40,6 +42,19 @@ class classRoomMgt extends React.Component {
payload: {
classId,
values,
callBack: () => {
if (saveSubmit && (typeof saveSubmit == 'function')) {
form.resetFields();
dispatch({
type: 'plancourse/updateState',
payload: {
selectWeekDays: [],
selectPlanDays: [],
},
});
saveSubmit();
}
},
},
});
}
......@@ -52,6 +67,8 @@ class classRoomMgt extends React.Component {
type: 'plancourse/updateState',
payload: {
PlanCourseShow: false,
selectWeekDays: [],
selectPlanDays: [],
rulePlanDetail: {
class_id: 0,
class_room_id: '',
......@@ -78,8 +95,6 @@ class classRoomMgt extends React.Component {
},
});
}
console.log(this.props.selectPlanDays.indexOf(day.date));
console.log(this.props.selectPlanDays, day.date);
}
daychange = (type) => {
const { dispatch } = this.props;
......@@ -119,6 +134,7 @@ class classRoomMgt extends React.Component {
calendarData,
selectPlanDays,
currentTimestamp,
classDetail,
} = this.props;
const { getFieldDecorator } = this.props.form;
return (
......@@ -154,7 +170,7 @@ class classRoomMgt extends React.Component {
rules: [{ required: true, message: '开始时间不能为空' }],
initialValue: rulePlanDetail.start_date ? moment(rulePlanDetail.start_date, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD'),
})(
<DatePicker style={{ width: '100%' }} disabledDate={this.disabledDate} />)}
<DatePicker style={{ width: '100%' }} placeholder="请选择开始时间" disabledDate={this.disabledDate} />)}
</Form.Item>
<Form.Item
label="结束时间:"
......@@ -170,7 +186,7 @@ class classRoomMgt extends React.Component {
{getFieldDecorator('end_date', {
rules: [{ required: true, message: '结束时间不能为空' }],
initialValue: rulePlanDetail.end_date ? moment(rulePlanDetail.end_date, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD'),
})(<DatePicker style={{ width: '100%' }} disabledDate={this.endDisabledDate} />)}
})(<DatePicker style={{ width: '100%' }} placeholder="请选择结束时间" disabledDate={this.endDisabledDate} />)}
</Form.Item>
<Form.Item
label="是否重复:"
......@@ -260,7 +276,7 @@ class classRoomMgt extends React.Component {
initialValue: rulePlanDetail.teacher_id,
rules: [{ required: true, message: '请选择上课老师' }],
})(
<Select defaultValue="1" style={{ width: '100%' }}>
<Select defaultValue="1" style={{ width: '100%' }} placeholder="请选择上课老师">
<Option value=""></Option>
{teacherList.map(ele => <Option value={ele.id}>{ele.nickname}</Option>)}
</Select>)}
......@@ -283,7 +299,7 @@ class classRoomMgt extends React.Component {
{getFieldDecorator('class_room_id', {
initialValue: rulePlanDetail.class_room_id,
})(
<Select defaultValue="1">
<Select placeholder="请选择上课教室" >
<Option value=""></Option>
{classroomList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>)}
......@@ -489,6 +505,8 @@ function mapStateToProps(state) {
calendarData,
selectPlanDays,
currentTimestamp,
teacherList,
classDetail,
} = state.plancourse;
return {
tabType,
......@@ -500,6 +518,8 @@ function mapStateToProps(state) {
calendarData,
selectPlanDays,
currentTimestamp,
teacherList,
classDetail,
};
}
export default connect(mapStateToProps)(classRoomMgtForm);
......
......@@ -35,6 +35,8 @@ class SjdMenu extends React.Component {
fontSize: '13px',
height: '40px',
paddingLeft: '35px',
display: 'flex',
alignItems: 'center',
};
return (
<Layout>
......@@ -63,7 +65,7 @@ class SjdMenu extends React.Component {
{
menus.map(ele => (
<Menu.Item key={ele.id} style={menuItemStyle}>
<div className={SjdMenuStyle.menuicon} style={defaultMenu === ele.id ? { backgroundImage: `url(${ele.activeurl})` } : { backgroundImage: `url(${ele.notactiveurl})` }} />
<div className={SjdMenuStyle.menuicon} style={defaultMenu === ele.id ? { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.activeurl})` } : { width: ele.style.width, height: ele.style.height, backgroundImage: `url(${ele.notactiveurl})` }} />
<Icon style={{ width: 0, minWidth: 'initial' }} />
<span>{ele.name}</span>
</Menu.Item>
......
......@@ -127,6 +127,7 @@ export default {
},
});
let newcallStudentTotal = bukeStudentTotal;
console.log(courseId, 'courseId');
const newqueryScheduleStudentListParams = Object.assign(querybukeStudentListParams, {
school_id: sid,
exclude_class_id: classId,
......@@ -425,6 +426,7 @@ export default {
const {
callStudentOperateList, courseId, classroomId, callType, expend, classId, callStudentSchedule, startTime, callStudentSubmitting,
} = yield select(state => state.callstudents);
const { callBack } = payload;
if (callStudentSubmitting) {
return;
}
......@@ -466,12 +468,15 @@ export default {
callStudentsShow: false,
},
});
yield put({
type: 'classdetail/queryScheduleList',
payload: {
params: {},
},
});
// yield put({
// type: 'classdetail/queryScheduleList',
// payload: {
// params: {},
// },
// });
if (callBack && (typeof callBack == 'function')) {
callBack();
}
} else {
message.error(studentCallsDate.msg, 1);
}
......
......@@ -204,7 +204,7 @@ export default {
school_id: sid,
course_id: classDetail.course_id,
exclude_class_id: params.exclude_class_id || classId,
start_time: moment(datetime, 'YYYY-MM-DD'),
start_time: datetime.split(' ')[0],
end_time: '',
});
const queryScheduleListData = yield call(schedulemgtAjax.scheduleList, newScheduleListQueryParams);
......@@ -487,6 +487,13 @@ export default {
},
},
});
yield put({
type: 'queryToAddStudentList',
payload: {
params: {
},
},
});
} else {
message.error(studentAdjustData.msg, 1);
}
......@@ -523,13 +530,16 @@ export default {
* queryClassList({ payload }, { call, put, select }) {
const { params, action } = payload;
const { sid } = yield select(state => state.webapp);
const { classListQueryParams, classListTotal, classDetail } = yield select(state => state.classdetail);
const {
classListQueryParams, classListTotal, classDetail, classId,
} = yield select(state => state.classdetail);
let newClassListTotal = classListTotal;
const loading = message.loading('班级数据加载中...', 1);
const newClassListQueryParams = Object.assign(classListQueryParams, params, {
school_id: sid,
course_id: classDetail.course_id,
status: 1,
exclude_class_id: classId,
// teacher_id: 77,
});
const classListData = yield call(classMgtAjax.getClassList, newClassListQueryParams);
......@@ -735,7 +745,6 @@ export default {
});
},
* queryinfo({ payload }, { call, put, select }) {
console.log(payload, 'payload');
yield put({
type: 'updateState',
payload: {
......
......@@ -50,6 +50,8 @@ export default {
calendarData: {},
currentTimestamp: 0,
selectPlanDays: [],
classDetail: {},
teacherList: [],
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -58,7 +60,13 @@ export default {
effects: {
* toEditClassPlan({ payload }, { call, put, select }) {
const { plan, classId, edittype } = payload;
const {
plan,
classId,
edittype,
classDetail,
teacherList,
} = payload;
const {
tabType,
rulePlanDetail,
......@@ -88,6 +96,8 @@ export default {
rulePlanDetail: { ...rulePlanDetail },
PlanCourseShow: true,
selectWeekDays: [...plan.rule.week_day],
classDetail: { ...classDetail },
teacherList: [...teacherList],
},
});
} else if (plan.rule.type == 2) { // 日历排课
......@@ -109,6 +119,8 @@ export default {
datePlanDetail: { ...datePlanDetail },
selectPlanDays: [...plan.rule.dates],
PlanCourseShow: true,
classDetail: { ...classDetail },
teacherList: [...teacherList],
},
});
}
......@@ -192,7 +204,7 @@ export default {
const {
class_room_id, content, end_date, is_repeat, start_date, teacher_id, times, class_room_id2, content2, teacher_id2, times2,
} = payload.values;
const { classId } = payload;
const { classId, callBack } = payload;
const {
selectWeekDays, tabType, planSubmitting, selectPlanDays, rulePlanDetail, datePlanDetail,
} = yield select(state => state.plancourse);
......@@ -295,6 +307,9 @@ export default {
}
// PlanCourseShow
if (plansAddDate.code == 200) {
if (callBack && (typeof callBack == 'function')) {
callBack();
}
yield put({
type: 'updateState',
payload: {
......
......@@ -331,10 +331,17 @@ export default {
yield put({
type: 'updateState',
payload: {
selectedCourse: studentCourseAndClassInfo[0],
studentClassObj,
studentCourseAndClassInfo,
},
});
yield put({
type: 'queryClassList',
payload: {
title: '',
},
});
} else {
message.error(studentsReadlist.msg, 1);
}
......@@ -429,6 +436,11 @@ export default {
editClassModalShow: false,
},
});
yield put({
type: 'queryClassList',
payload: {
},
});
} else {
message.error(classAddDate.msg, 1);
}
......
......@@ -45,7 +45,7 @@ export default {
start_time: '',
end_time: '',
class_id: '',
status: 1,
status: '',
course_id: '',
class_room_id: '',
page: 1,
......@@ -91,10 +91,12 @@ export default {
effects: {
* queryCoureList({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const { teacherId } = yield select(state => state.teachersinfo);
const courselistinfo = yield call(courseAjax.courseList, {
school_id: sid,
page: 1,
perPage: 100,
perPage: 200,
teacher_id: teacherId,
});
if (courselistinfo.code == 200 && courselistinfo.data) {
yield put({
......
......@@ -404,10 +404,12 @@ export default {
let matchedmenu = null;
for (let i = 0; i < menus.length; i++) {
const menu = menus[i];
for (let j = 0; j < menu.relativePath.length; j++) {
if (pathToRegexp(menu.relativePath[j]).exec(pathname)) {
matchedmenu = menu;
newDefaultMenu = menu.id;
if (menu.relativePath && menu.relativePath.length > 0) {
for (let j = 0; j < menu.relativePath.length; j++) {
if (pathToRegexp(menu.relativePath[j]).exec(pathname)) {
matchedmenu = menu;
newDefaultMenu = menu.id;
}
}
}
}
......
......@@ -182,7 +182,7 @@ class ChangeCourse extends React.Component {
<Row gutter={4}>
<Col span={13}>
{getFieldDecorator('class_room_id', {
initialValue: selectScheduleinfo.class_room_id,
initialValue: selectScheduleinfo.class_room_id == 0 ? '' : selectScheduleinfo.class_room_id,
})(
<Select defaultValue="1">
<Option value=""></Option>
......
......@@ -345,7 +345,11 @@ class ClassDetailForm extends React.Component {
});
}
toAddClassStudent = () => {
const { dispatch } = this.props;
const { dispatch, classDetail } = this.props;
if (classDetail.status == 2) {
message.warn('班级已结业,不能添加班级!', 0.5);
return;
}
dispatch({
type: 'classdetail/updateState',
payload: {
......@@ -525,7 +529,15 @@ class ClassDetailForm extends React.Component {
});
}
changeSchedule = (record) => {
const { dispatch } = this.props;
const { dispatch, datetime } = this.props;
if (new Date(datetime.replace(/-/g, '/')).getTime() - new Date(record.start_time.replace(/-/g, '/')).getTime() > 0) {
message.error('本课时已经开始,无法调课', 0.5);
return;
}
if (record.call_time) {
message.warn('该课时已点名,不能调课', 0.5);
return;
}
dispatch({
type: 'classdetail/updateState',
payload: {
......@@ -625,6 +637,11 @@ class ClassDetailForm extends React.Component {
type: 'callstudents/updateState',
payload: {
callStudentsShow: true,
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
classId: schedule.class_id,
},
});
dispatch({
......@@ -641,6 +658,11 @@ class ClassDetailForm extends React.Component {
type: 'callstudents/updateState',
payload: {
callStudentsShow: true,
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
classId: schedule.class_id,
},
});
dispatch({
......@@ -659,6 +681,8 @@ class ClassDetailForm extends React.Component {
classId: classDetail.id,
plan,
edittype: 'edit',
classDetail,
teacherList: classDetail.school_teachers,
},
});
}
......@@ -673,6 +697,26 @@ class ClassDetailForm extends React.Component {
payload: {
PlanCourseShow: true,
edittype: 'add',
classDetail,
teacherList: classDetail.school_teachers,
},
});
}
plancoursesaveSubmit = () => {
const { dispatch } = this.props;
dispatch({
type: 'classdetail/queryCoursePlansList',
payload: {
params: {},
},
});
}
saveCallStudents = () => {
const { dispatch } = this.props;
dispatch({
type: 'classdetail/queryScheduleList',
payload: {
params: {},
},
});
}
......@@ -866,7 +910,7 @@ class ClassDetailForm extends React.Component {
render: (text, record, index) => {
return (
<div>
{record.expend_time}/{record.total}
{record.expend}/{record.total}
</div>
);
},
......@@ -1148,10 +1192,10 @@ class ClassDetailForm extends React.Component {
<div className={`${pageStyle.container} classdetailcontainer`}>
<PlanCourse
classroomList={classroomList}
teacherList={teacherList}
classroomMgt={this.classroomMgt}
addCourseTime={this.addCourseTime}
classId={classId}
saveSubmit={this.plancoursesaveSubmit}
/>
<AddCourseTime
visible={addCourseTimeShow}
......@@ -1446,10 +1490,9 @@ class ClassDetailForm extends React.Component {
changeStudentSchedule={this.changeStudentSchedule}
sureAdjustCourse={this.sureAdjustCourse}
/>
{classDetail.id &&
<CallStudents
classDetail={classDetail}
/>}
<CallStudents
callBack={this.saveCallStudents}
/>
</div>
);
}
......
import { connect } from 'dva';
import React from 'react';
import PropTypes from 'prop-types';
import { Icon, Button, Row, Col, Input, Select, Checkbox, Table, Modal, Form, Alert, InputNumber } from 'antd';
import { message, Row, Col, Input, Select, Modal, Form, InputNumber } from 'antd';
import pageStyle from './EditClassModal.less';
import { pageIn } from '../../utils/index';
const { Option } = Select;
......@@ -27,9 +27,15 @@ class EditClassModal extends React.Component {
}
save = () => {
const { form, save } = this.props;
const {
form, save, isEdit, editClassInfo,
} = this.props;
form.validateFields((err, values) => {
if (!err) {
if (isEdit == 1 && values.capacity < editClassInfo.class_student_count) {
message.warn(`班级容量不能小于当前班级人数${editClassInfo.class_student_count}人`, 1);
return;
}
save(values, form);
}
});
......@@ -56,11 +62,9 @@ class EditClassModal extends React.Component {
teacherList,
classroomMgt,
editClassInfo,
save,
classSubmitting,
classroomList,
isEdit,
form,
} = this.props;
const { classRoomId, title } = this.state;
let classRoom;
......
import { connect } from 'dva';
import React from 'react';
import { Icon, Button, Row, Col, Input, Select, Checkbox, Form, InputNumber, Table, Modal, DatePicker } from 'antd';
import { Icon, Button, Row, Col, Input, Select, Checkbox, Form, InputNumber, Table, Modal, DatePicker, message } from 'antd';
import pageStyle from './index.less';
import { pageIn } from '../../utils/index';
import RenewEdit from './RenewEdit';
......@@ -35,12 +35,16 @@ class StudentMgt extends React.Component {
},
});
}
toChoiceClass = (id) => {
toChoiceClass = (record) => {
if (record.student_courses.length == 0) {
message.error('该学生没有购买课程,无法排课', 0.5);
return;
}
const { dispatch } = this.props;
dispatch({
type: 'students/toChoiceClass',
payload: {
id,
id: record.id,
},
});
}
......@@ -314,7 +318,7 @@ class StudentMgt extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChoiceClass(record.id)}>选班</a>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChoiceClass(record)}>选班</a>
<span className={pageStyle.divideline}>|</span>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.goRenewCourse(record)}>续课</a>
{record.student_courses.filter(ele => ele.course_mode != 3).length != 0 &&
......@@ -352,14 +356,14 @@ 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.course_id} onChange={e => this.searchParamsChange(e, 'Select', 'course_id')}>
<Option value=""></Option>
<Option value="">全部课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</Col>
<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.class_id} onChange={e => this.searchParamsChange(e, 'Select', 'class_id')}>
<Option value=""></Option>
<Option value="">全部班级</Option>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</Col>
......@@ -381,7 +385,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.birthday_month} onChange={e => this.searchParamsChange(e, 'Select', 'birthday_month')}>
<Option value={0}></Option>
<Option value={0}>全部</Option>
<Option value={1}>一月</Option>
<Option value={2}>二月</Option>
<Option value={3}>三月</Option>
......@@ -399,7 +403,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.wechat_status} onChange={e => this.searchParamsChange(e, 'Select', 'wechat_status')}>
<Option value=""></Option>
<Option value="">全部</Option>
<Option value={1}>已绑定</Option>
<Option value={2}>未绑定</Option>
</Select>
......@@ -407,7 +411,7 @@ class StudentMgt extends React.Component {
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 3 }}>
<div className={pageStyle.formitemlabel} >是否选班</div>
<Select className={pageStyle.selectitem} style={{ width: 74 }} placeholder="是" value={searchstudentListQueryParams.assign_class_status} onChange={e => this.searchParamsChange(e, 'Select', 'assign_class_status')}>
<Option value=""></Option>
<Option value="">全部</Option>
<Option value={1}></Option>
<Option value={2}></Option>
</Select>
......
......@@ -88,6 +88,8 @@ class classChange extends React.Component {
type: 'studentclass/updateState',
payload: {
editClassModalShow: true,
selectedClasses: [],
selectedClassesRow: [],
},
});
}
......
......@@ -224,14 +224,14 @@ class ClassMgt extends React.Component {
<Col className={pageStyle.formitem} xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 5 }}>
<div className={pageStyle.formitemlabel}>授课课程</div>
<Select className={pageStyle.selectitem} placeholder="请选择所属课程" value={searchteacherListQueryParams.course_id} onChange={e => this.searchParamsChange(e, 'Select', 'course_id')}>
<Option value=""></Option>
<Option value="">全部课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</Col>
<Col className={pageStyle.formitem} xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 5 }}>
<div className={pageStyle.formitemlabel}>启用状态</div>
<Select className={pageStyle.selectitem} placeholder="全部" value={searchteacherListQueryParams.status} onChange={e => this.searchParamsChange(e, 'Select', 'status')}>
<Option value=""></Option>
<Option value="">全部状态</Option>
<Option value="1">开启</Option>
<Option value="2">关闭</Option>
</Select>
......
......@@ -14,7 +14,7 @@ const { TabPane } = Tabs;
class teachersForm extends React.Component {
state = {
// visible: false,
classInfo: {},
// classInfo: {},
};
componentDidMount() { // 挂载
pageIn('教师详情管理');
......@@ -60,19 +60,24 @@ class teachersForm extends React.Component {
}
toCallStudents = (schedule) => {
const { dispatch } = this.props;
this.setState({
classInfo: {
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
id: schedule.class_id,
},
});
// this.setState({
// classInfo: {
// expend: schedule.class.expend,
// copyExpend: schedule.class.expend,
// courseId: schedule.course_id,
// classroomId: schedule.class_room_id,
// id: schedule.class_id,
// },
// });
dispatch({
type: 'callstudents/updateState',
payload: {
callStudentsShow: true,
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
classId: schedule.class_id,
},
});
dispatch({
......@@ -85,19 +90,15 @@ class teachersForm extends React.Component {
}
toEditCallStudents = (schedule) => {
const { dispatch } = this.props;
this.setState({
classInfo: {
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
id: schedule.class_id,
},
});
dispatch({
type: 'callstudents/updateState',
payload: {
callStudentsShow: true,
expend: schedule.class.expend,
copyExpend: schedule.class.expend,
courseId: schedule.course_id,
classroomId: schedule.class_room_id,
classId: schedule.class_id,
},
});
dispatch({
......@@ -326,6 +327,16 @@ class teachersForm extends React.Component {
type: 'teachersinfo/searchTeachersSchedule',
});
}
saveCallStudents = () => {
const { dispatch } = this.props;
dispatch({
type: 'teachersinfo/queryScheduleList',
payload: {
params: {
},
},
});
}
resetTeachersSchedule = () => {
const { dispatch } = this.props;
dispatch({
......@@ -400,6 +411,7 @@ class teachersForm extends React.Component {
studentChangeScheduleListLoading,
studentChangeScheduleListTotal,
studentChangeScheduleListQueryParams,
copyTeachersScheduleListQueryParams,
} = this.props;
const classinfo = [
{
......@@ -472,7 +484,7 @@ class teachersForm extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
{record.status == 1 ? '已点名' : '未点名'}
{!record.call_time ? '未点名' : '已点名'}
</div>
);
},
......@@ -485,7 +497,7 @@ class teachersForm extends React.Component {
key: 'key',
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
<div>
{index + 1}
</div>
);
......@@ -503,6 +515,18 @@ class teachersForm extends React.Component {
);
},
},
{
title: '班级',
dataIndex: 'class_name',
key: 'class_name',
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
{(record.class && record.class.title) || ''}
</div>
);
},
},
{
title: '上课教师',
dataIndex: 'school_teacher.nickname',
......@@ -710,16 +734,16 @@ class teachersForm extends React.Component {
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>
授课班级:
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="班级列表" onChange={e => this.searchParamsChange(e, 'classId')}>
<Option value=""></Option>
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="班级列表" value={copyTeachersScheduleListQueryParams.class_id} onChange={e => this.searchParamsChange(e, 'classId')}>
<Option value="">全部班级</Option>
{teacherClassListForSearch.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</div>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>点名状态:
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="全部" onChange={e => this.searchParamsChange(e, 'status')}>
<Option value=""></Option>
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="全部" value={copyTeachersScheduleListQueryParams.status} onChange={e => this.searchParamsChange(e, 'status')}>
<Option value="">全部状态</Option>
<Option value={1}>已点名</Option>
<Option value={2}>未点名</Option>
</Select>
......@@ -729,8 +753,8 @@ class teachersForm extends React.Component {
<Row gutter="24" tyle="flex" align="center">
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>授课课程:
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="课程列表" onChange={e => this.searchParamsChange(e, 'courseId')}>
<Option value=""></Option>
<Select style={{ width: '100%', maxWidth: 233 }} value={copyTeachersScheduleListQueryParams.course_id} placeholder="课程列表" onChange={e => this.searchParamsChange(e, 'courseId')}>
<Option value="">全部课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</div>
......@@ -738,8 +762,8 @@ class teachersForm extends React.Component {
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>
<span style={{ marginRight: 28 }}>教室:</span>
<Select style={{ width: '100%', maxWidth: 233 }} placeholder="教室列表" onChange={e => this.searchParamsChange(e, 'class_room_id')}>
<Option value=""></Option>
<Select style={{ width: '100%', maxWidth: 233 }} value={copyTeachersScheduleListQueryParams.class_room_id} placeholder="教室列表" onChange={e => this.searchParamsChange(e, 'class_room_id')}>
<Option value="">全部教室</Option>
{classroomList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>
</div>
......@@ -770,7 +794,7 @@ class teachersForm extends React.Component {
</TabPane>
<TabPane tab="排课表" key="3">
<div>
<Row className={pageStyle.timechoice}>
<Row className={pageStyle.timechoice} type="flex" align="middle" justify="space-between">
<Col span={6}>
<div className={pageStyle.dianmingtime}>一周点名情况 {scheduleListQueryParams.start_time}{scheduleListQueryParams.end_time}</div>
</Col>
......@@ -806,10 +830,9 @@ class teachersForm extends React.Component {
changeStudentSchedule={this.changeStudentSchedule}
sureAdjustCourse={this.sureAdjustCourse}
/>
{this.state.classInfo.id &&
<CallStudents
classDetail={this.state.classInfo}
/>}
<CallStudents
callBack={this.saveCallStudents}
/>
<EditTeacher
visible={addOrUpdateDiaShow}
hide={() => this.setModal1Visible(false)}
......@@ -841,6 +864,7 @@ function mapStateToProps(state) {
courseList,
teachersscheduleTotal,
teachersScheduleListQueryParams,
copyTeachersScheduleListQueryParams,
} = state.teachersinfo;
const {
changeScheduleIndex,
......@@ -895,6 +919,7 @@ function mapStateToProps(state) {
studentChangeScheduleListLoading,
studentChangeScheduleListTotal,
studentChangeScheduleListQueryParams,
copyTeachersScheduleListQueryParams,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
......@@ -11,6 +11,7 @@ module.exports = {
'jquery',
'cropper',
'bizcharts',
'xlsx',
],
},
output: {
......
......@@ -1098,6 +1098,13 @@ address@1.0.3, address@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9"
adler-32@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/adler-32/-/adler-32-1.2.0.tgz#6a3e6bf0a63900ba15652808cb15c6813d1a5f25"
dependencies:
exit-on-epipe "~1.0.1"
printj "~1.1.0"
af-webpack@^0.22.2:
version "0.22.3"
resolved "https://registry.yarnpkg.com/af-webpack/-/af-webpack-0.22.3.tgz#5863e0a528745d17c228c298a02caf30d7b80cb1"
......@@ -2265,6 +2272,15 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"
cfb@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/cfb/-/cfb-1.1.3.tgz#05de6816259c8e8bc32713aba905608ee385df66"
dependencies:
adler-32 "~1.2.0"
commander "^2.16.0"
crc-32 "~1.2.0"
printj "~1.1.2"
chalk@1.1.3, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
......@@ -2451,6 +2467,13 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
codepage@~1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/codepage/-/codepage-1.14.0.tgz#8cbe25481323559d7d307571b0fff91e7a1d2f99"
dependencies:
commander "~2.14.1"
exit-on-epipe "~1.0.1"
collection-visit@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
......@@ -2508,7 +2531,7 @@ commander@*, commander@2.15.x, commander@^2.11.0, commander@^2.12.1, commander@^
version "2.15.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
commander@2:
commander@2, commander@^2.16.0:
version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
......@@ -2516,6 +2539,14 @@ commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
commander@~2.14.1:
version "2.14.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa"
commander@~2.17.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
commondir@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
......@@ -2718,6 +2749,13 @@ cpx@^1.5.0:
shell-quote "^1.6.1"
subarg "^1.0.0"
crc-32@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208"
dependencies:
exit-on-epipe "~1.0.1"
printj "~1.1.0"
create-ecdh@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff"
......@@ -4023,6 +4061,10 @@ execa@^0.7.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"
exit-on-epipe@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692"
exit@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
......@@ -4462,6 +4504,10 @@ forwarded@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
frac@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/frac/-/frac-1.1.2.tgz#3d74f7f6478c88a1b5020306d747dc6313c74d0b"
fragment-cache@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
......@@ -7721,6 +7767,10 @@ pretty-format@^22.4.0, pretty-format@^22.4.3:
ansi-regex "^3.0.0"
ansi-styles "^3.2.0"
printj@~1.1.0, printj@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222"
private@^0.1.6, private@^0.1.8, private@~0.1.5:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
......@@ -9491,6 +9541,12 @@ sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
ssf@~0.10.2:
version "0.10.2"
resolved "https://registry.yarnpkg.com/ssf/-/ssf-0.10.2.tgz#65b2b4fcdfd967bc8e8383a41349009893115976"
dependencies:
frac "~1.1.2"
sshpk@^1.7.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb"
......@@ -10615,6 +10671,18 @@ xdg-basedir@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"
xlsx@^0.15.0:
version "0.15.0"
resolved "https://registry.yarnpkg.com/xlsx/-/xlsx-0.15.0.tgz#7e5633bbeb3995373b8b9960deb6fbda912ab602"
dependencies:
adler-32 "~1.2.0"
cfb "^1.1.3"
codepage "~1.14.0"
commander "~2.17.1"
crc-32 "~1.2.0"
exit-on-epipe "~1.0.1"
ssf "~0.10.2"
xml-name-validator@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
......
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