Commit afd1bc02 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/bww-v1'

parents 7f724c6e 534423f4
......@@ -1322,6 +1322,68 @@ export default {
// message.error(timePutData.msg, 1);
}
},
* querySearchClassStudentList({ payload }, { call, put, select }) {
const { classId, queryClassStudentListParams, classStudentTotal } = yield select(state => state.classdetail);
const { params } = payload;
const { sid } = yield select(state => state.webapp);
let newclassStudentTotal = classStudentTotal;
const newqueryClassStudentListParams = Object.assign(queryClassStudentListParams, params, {
class_id: classId,
school_id: sid,
extra: 'time,recently_course',
});
const courseplanListDate = yield call(classMgtAjax.classStudentList, newqueryClassStudentListParams);
if (courseplanListDate.code == 200) {
if (courseplanListDate.data && courseplanListDate.data.total !== undefined) {
newclassStudentTotal = courseplanListDate.data.total;
}
yield put({
type: 'updateState',
payload: {
classStudentList: courseplanListDate.data.list,
classStudentTotal: newclassStudentTotal,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: courseplanListDate,
},
});
}
},
* queryResetClassStudentList({ payload }, { call, put, select }) {
const { classId, queryClassStudentListParams, classStudentTotal } = yield select(state => state.classdetail);
const { sid } = yield select(state => state.webapp);
let newclassStudentTotal = classStudentTotal;
const newqueryClassStudentListParams = Object.assign(queryClassStudentListParams, {
class_id: classId,
school_id: sid,
extra: 'time,recently_course',
keyword: '',
});
const courseplanListDate = yield call(classMgtAjax.classStudentList, newqueryClassStudentListParams);
if (courseplanListDate.code == 200) {
if (courseplanListDate.data && courseplanListDate.data.total !== undefined) {
newclassStudentTotal = courseplanListDate.data.total;
}
yield put({
type: 'updateState',
payload: {
classStudentList: courseplanListDate.data.list,
classStudentTotal: newclassStudentTotal,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: courseplanListDate,
},
});
}
},
* pageInit({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
......
......@@ -17,8 +17,15 @@ import {
const { TabPane } = Tabs;
const { Option } = Select;
const { TextArea } = Input;
const FormItem = Form.Item;
const { Group } = Radio;
class ClassDetailForm extends React.Component {
constructor(props) {
super(props);
this.state = {
studentKeyword: '',
};
}
componentDidMount() { // 挂载
pageIn('班级管理');
// 初始化地图函数 自定义函数名init
......@@ -912,6 +919,35 @@ class ClassDetailForm extends React.Component {
},
});
}
handleSearchKeyword = (e) => {
this.setState({
studentKeyword: e.target.value,
});
}
handleSearchStudent = () => {
const { dispatch, form, classDetail } = this.props;
const { studentKeyword } = this.state;
dispatch({
type: 'classdetail/querySearchClassStudentList',
payload: {
params: {
page: 1,
keyword: studentKeyword,
},
},
});
}
handleSearchReset = () => {
const { dispatch } = this.props;
this.setState({
studentKeyword: '',
});
dispatch({
type: 'classdetail/queryResetClassStudentList',
payload: {
},
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
......@@ -962,6 +998,7 @@ class ClassDetailForm extends React.Component {
addTimeSubmitting,
courseTimeListShow,
} = this.props;
const { studentKeyword } = this.state;
const courseplancolumns = [
{
title: '排课方式',
......@@ -1528,12 +1565,15 @@ class ClassDetailForm extends React.Component {
<Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }} className={pageStyle.searchcol}>
<Input
style={{ width: '214px', marginRight: '21px' }}
placeholder="搜索学员"
placeholder="搜索学员姓名"
suffix={
<Icon type="search" style={{ color: 'rgba(0,0,0,.45)' }} />
}
value={studentKeyword}
onChange={e => this.handleSearchKeyword(e)}
/>
<Button type="primary"> </Button>
<Button onClick={this.handleSearchReset} style={{ marginRight: 10 }}> </Button>
<Button type="primary" onClick={this.handleSearchStudent}> </Button>
</Col>
</Row>
<div className={pageStyle.studenttablebox}>
......
......@@ -45,6 +45,9 @@ class StoreMgt extends React.Component {
{
title: '姓名',
dataIndex: 'student.name',
render: (text, row) => {
return <div> {text || '-'}</div>;
},
},
{
title: '积分操作',
......
......@@ -17,40 +17,37 @@ const { Option } = Select;
const { TextArea } = Input;
const { TabPane } = Tabs;
class StudentMgt extends React.Component {
state = {
cage: 0,
qrCodeTitle: '',
avatorUploader: {
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: 1,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !1,
cropBoxResizable: !1,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
isExpendMore: false,
// Inviteloading: false,
};
constructor(props) {
super(props);
this.state = {
isChecked: false,
isShowQuestion: false,
verifyValue: '',
cage: 0,
qrCodeTitle: '',
avatorUploader: {
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: 1,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !1,
cropBoxResizable: !1,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
isExpendMore: false,
};
}
componentDidMount() { // 挂载
......
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