Commit 0fab8d00 authored by wangxuelai's avatar wangxuelai

''

parent 15393118
......@@ -17,6 +17,6 @@
</head>
<body>
<div id="root"></div>
<script src="dist/main.js?1574771021223" charset="utf-8"></script>
<script src="dist/main.js?1574779111827" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -1665,6 +1665,12 @@ export default {
info: {},
},
});
yield put({
type: 'selectCourseList',
payload: {
params: {},
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
......@@ -1780,6 +1786,12 @@ export default {
info: {},
},
});
yield put({
type: 'selectCourseList',
payload: {
params: {},
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
......
import React from 'react';
import { List, Icon, DatePicker, Form, Card, Button, Menu, Dropdown, Input } from 'antd';
import { List, Icon, DatePicker, Form, Card, Button, Menu, Dropdown, Input, Pagination } from 'antd';
import moment from 'moment';
import pageStyle from './CourseBox.less';
import { imagify } from '../../../utils';
......@@ -85,6 +85,11 @@ class CourseBoxForm extends React.Component {
toCreateSingleCourse,
toEditSingleCourse,
cancelEditSingleCourse,
toAddCourseWare2,
courseListTotal,
courseQueryParams,
sizeChange,
onChangeCourseList,
} = this.props;
const { getFieldDecorator } = this.props.form;
const formItemModalLineLayout = {
......@@ -128,6 +133,20 @@ class CourseBoxForm extends React.Component {
xxl: 4,
}}
dataSource={list}
footer={
<div className={pageStyle.tablefooterbox} style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Pagination
showSizeChanger
showQuickJumper
onShowSizeChange={sizeChange}
total={Number(total)}
onChange={onChangeCourseList}
current={Number(courseQueryParams.page) || 1}
pageSize={courseQueryParams.perPage}
pageSizeOptions={['12', '24', '36', '48', '60']}
/>
</div>
}
renderItem={item => (
<List.Item style={{ minWidth: '320px' }} className={pageStyle.listitem}>
<Card bodyStyle={{ padding: 20, minWidth: '320px' }}>
......@@ -148,8 +167,9 @@ class CourseBoxForm extends React.Component {
style={{
marginRight: '16px', color: '#2194FF', lineHeight: 1, whiteSpace: 'nowrap',
}}
onClick={() => toAddCourseWare2(item)}
>
编辑课件
{item.content && JSON.parse(item.content) && JSON.parse(item.content).src ? '编辑课件' : '上传课件'}
</span>
<span
className="hreflink"
......
......@@ -65,6 +65,15 @@ class StaticCenter extends React.Component {
callback();
}
}
closePsd = (value, callback) => {
const { dispatch, addCourseObj } = this.props;
this.setState({
psdChangeShow: false,
});
if (callback && (typeof callback == 'function')) {
callback();
}
}
tabShift = (tab) => {
const { dispatch, gatherDetail } = this.props;
dispatch({
......@@ -385,7 +394,6 @@ class StaticCenter extends React.Component {
}
materialSave = (values) => {
const { dispatch, materiaSaveTo, editSingleCourseInfo } = this.props;
console.log(materiaSaveTo, 'materiaSaveTomateriaSaveTo');
if (materiaSaveTo == 1) {
dispatch({
type: 'coursegatherdetail/updateCover',
......@@ -656,6 +664,32 @@ class StaticCenter extends React.Component {
},
});
}
toAddCourseWare2 = (item) => {
const { dispatch, editSingleCourseInfo } = this.props;
this.setState({
addWareType: 2,
});
dispatch({
type: 'coursegatherdetail/updateState',
payload: {
editSingleCourseId: item.id,
editSingleCourseInfo: {
id: item.id,
title: item.title,
start_time: item.start_time,
cover: item.cover,
content: JSON.parse(item.content),
},
},
});
dispatch({
type: 'uploadcourseware/updateState',
payload: {
visible: true,
info: (JSON.parse(item.content)) || {},
},
});
}
toCreateSingleCourse = () => {
const { dispatch } = this.props;
dispatch({
......@@ -732,6 +766,30 @@ class StaticCenter extends React.Component {
choosedPoster: '',
});
}
courseListSizeChange = (page, perPage) => {
const { dispatch } = this.props;
dispatch({
type: 'coursegatherdetail/selectCourseList',
payload: {
params: {
page: 1,
perPage,
},
},
});
}
onChangeCourseList = (page, perPage) => {
const { dispatch } = this.props;
dispatch({
type: 'coursegatherdetail/selectCourseList',
payload: {
params: {
page,
perPage,
},
},
});
}
render() {
const that = this;
const {
......@@ -764,6 +822,7 @@ class StaticCenter extends React.Component {
editSingleCourseInfo,
saveSingleCourseSubmitting,
addCourseObj,
courseQueryParams,
} = this.props;
const menu = (
<Menu>
......@@ -822,6 +881,10 @@ class StaticCenter extends React.Component {
toCreateSingleCourse={this.toCreateSingleCourse}
toEditSingleCourse={this.toEditSingleCourse}
cancelEditSingleCourse={this.cancelEditSingleCourse}
toAddCourseWare2={this.toAddCourseWare2}
courseQueryParams={courseQueryParams}
sizeChange={this.courseListSizeChange}
onChangeCourseList={this.onChangeCourseList}
/>}
{tabIndex == 2 && <StaticBox
staticTotalInfo={staticTotalInfo}
......@@ -879,6 +942,7 @@ class StaticCenter extends React.Component {
/>
<ChangePsdModal
visible={this.state.psdChangeShow}
close={this.closePsd}
info={addCourseObj}
save={this.savePsd}
/>
......@@ -955,6 +1019,7 @@ function mapStateToProps(state) {
editSingleCourseInfo,
saveSingleCourseSubmitting,
addCourseObj,
courseQueryParams,
} = state.coursegatherdetail;
return {
tabIndex,
......@@ -988,6 +1053,7 @@ function mapStateToProps(state) {
editSingleCourseInfo,
saveSingleCourseSubmitting,
addCourseObj,
courseQueryParams,
};
}
export default connect(mapStateToProps)(StaticCenter);
......
......@@ -23,8 +23,9 @@ class ChangePsdModal extends React.Component {
componentWillUnmount() { // 卸载
}
close = () => {
const { close } = this.props;
const { close, form } = this.props;
close();
form.resetFields();
}
save = (e) => {
const { save, form } = this.props;
......
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