|
@@ -1,10 +1,51 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Button, Spin, message, Table, Cascader, Input } from 'antd';
|
|
|
-import { techFieldList } from '../../../DicTechFieldList';
|
|
|
+import { Icon, Button, Spin, message, Table, Cascader, Input, Modal, DatePicker, Upload, Checkbox } from 'antd';
|
|
|
+import { techFieldList, getTechField } from '../../../DicTechFieldList';
|
|
|
+import { beforeUpload, getBase64 } from '../../../tools';
|
|
|
+import moment from 'moment';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
-const Star = React.createClass({
|
|
|
+const Avatar = React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ imageUrl: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleChange(info) {
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ // Get this url from response in real world.
|
|
|
+ getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
|
|
|
+ this.props.urlData(info.file.response.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ if (this.props.uid != nextProps.uid) {
|
|
|
+ this.state.imageUrl = null;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ const imageUrl = this.state.imageUrl;
|
|
|
+ return (
|
|
|
+ <Upload
|
|
|
+ className="avatar-uploader"
|
|
|
+ name={this.props.name}
|
|
|
+ showUploadList={false}
|
|
|
+ action={globalConfig.context + "/api/admin/lecture/upload"}
|
|
|
+ data={{ 'uid': this.props.uid, 'sign': 'lecture_picture' }}
|
|
|
+ beforeUpload={beforeUpload}
|
|
|
+ onChange={this.handleChange} >
|
|
|
+ {
|
|
|
+ (imageUrl || this.props.imageUrl) ?
|
|
|
+ <img src={imageUrl || this.props.imageUrl} role="presentation" id={this.props.name} /> :
|
|
|
+ <Icon type="plus" className="avatar-uploader-trigger" />
|
|
|
+ }
|
|
|
+ </Upload>
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const Lecture = React.createClass({
|
|
|
loadUserData(pageNo) {
|
|
|
this.setState({
|
|
|
loading: true
|
|
@@ -13,7 +54,7 @@ const Star = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/star/list',
|
|
|
+ url: globalConfig.context + '/api/admin/lecture/starAndExpertList',
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.userPagination.pageSize,
|
|
@@ -35,7 +76,7 @@ const Star = React.createClass({
|
|
|
theArr.push({
|
|
|
key: i,
|
|
|
uid: thisdata.uid,
|
|
|
- engagedField: thisdata.engagedField,
|
|
|
+ engagedField: thisdata.engagedField ? thisdata.engagedField.split(',') : [],
|
|
|
username: thisdata.username,
|
|
|
professionalTitle: thisdata.professionalTitle,
|
|
|
workUnit: thisdata.workUnit,
|
|
@@ -47,7 +88,7 @@ const Star = React.createClass({
|
|
|
this.state.userPagination.total = data.data.totalCount;
|
|
|
};
|
|
|
this.setState({
|
|
|
- dataSource: theArr,
|
|
|
+ userTableData: theArr,
|
|
|
userPagination: this.state.userPagination
|
|
|
});
|
|
|
}.bind(this),
|
|
@@ -71,8 +112,8 @@ const Star = React.createClass({
|
|
|
pageSize: this.state.lecturePagination.pageSize,
|
|
|
username: this.state.searchLectureUser, //用户名称
|
|
|
name: this.state.searchLectureName, //讲座名称
|
|
|
- startLectureTime: this.state.startTime ? this.state.startTime.format("yyyy-MM-dd HH:MM:SS") : undefined,
|
|
|
- endLectureTime: this.state.endTime ? this.state.endTime.format("yyyy-MM-dd HH:MM:SS") : undefined,
|
|
|
+ startLectureTime: this.state.startLectureTime,
|
|
|
+ endLectureTime: this.state.endLectureTime
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -84,14 +125,19 @@ const Star = React.createClass({
|
|
|
for (let i = 0; i < data.data.list.length; i++) {
|
|
|
let thisdata = data.data.list[i];
|
|
|
theArr.push({
|
|
|
+ key: i,
|
|
|
id: thisdata.id,
|
|
|
uid: thisdata.uid,
|
|
|
lectureTime: thisdata.lectureTime,
|
|
|
+ endTime: thisdata.endTime,
|
|
|
name: thisdata.name,
|
|
|
summary: thisdata.summary,
|
|
|
username: thisdata.username,
|
|
|
lectureUrl: thisdata.lectureUrl,
|
|
|
lectureTimeFormattedDate: thisdata.lectureTimeFormattedDate,
|
|
|
+ endTimeFormattedDate: thisdata.endTimeFormattedDate,
|
|
|
+ hot: thisdata.hot,
|
|
|
+ dynamic: thisdata.dynamic
|
|
|
});
|
|
|
};
|
|
|
this.state.lecturePagination.current = data.data.pageNo;
|
|
@@ -116,7 +162,7 @@ const Star = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/star/hotList',
|
|
|
+ url: globalConfig.context + '/api/admin/lecture/hotList',
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
|
if (!data.data) {
|
|
@@ -128,13 +174,18 @@ const Star = React.createClass({
|
|
|
let thisdata = data.data[i];
|
|
|
theArr.push({
|
|
|
key: i,
|
|
|
+ id: thisdata.id,
|
|
|
uid: thisdata.uid,
|
|
|
- engagedField: thisdata.engagedField,
|
|
|
+ lectureTime: thisdata.lectureTime,
|
|
|
+ endTime: thisdata.endTime,
|
|
|
+ name: thisdata.name,
|
|
|
+ summary: thisdata.summary,
|
|
|
username: thisdata.username,
|
|
|
- professionalTitle: thisdata.professionalTitle,
|
|
|
- workUnit: thisdata.workUnit,
|
|
|
- number: thisdata.number,
|
|
|
- achievementNums: thisdata.achievementNums,
|
|
|
+ lectureUrl: thisdata.lectureUrl,
|
|
|
+ lectureTimeFormattedDate: thisdata.lectureTimeFormattedDate,
|
|
|
+ endTimeFormattedDate: thisdata.endTimeFormattedDate,
|
|
|
+ hot: thisdata.hot,
|
|
|
+ dynamic: thisdata.dynamic
|
|
|
});
|
|
|
};
|
|
|
};
|
|
@@ -148,7 +199,7 @@ const Star = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- loadStarData() {
|
|
|
+ loadDynamicData() {
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -156,7 +207,7 @@ const Star = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/star/starList',
|
|
|
+ url: globalConfig.context + '/api/admin/lecture/dynamic',
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
|
if (!data.data) {
|
|
@@ -168,18 +219,23 @@ const Star = React.createClass({
|
|
|
let thisdata = data.data[i];
|
|
|
theArr.push({
|
|
|
key: i,
|
|
|
+ id: thisdata.id,
|
|
|
uid: thisdata.uid,
|
|
|
- engagedField: thisdata.engagedField,
|
|
|
+ lectureTime: thisdata.lectureTime,
|
|
|
+ endTime: thisdata.endTime,
|
|
|
+ name: thisdata.name,
|
|
|
+ summary: thisdata.summary,
|
|
|
username: thisdata.username,
|
|
|
- professionalTitle: thisdata.professionalTitle,
|
|
|
- workUnit: thisdata.workUnit,
|
|
|
- number: thisdata.number,
|
|
|
- achievementNums: thisdata.achievementNums,
|
|
|
+ lectureUrl: thisdata.lectureUrl,
|
|
|
+ lectureTimeFormattedDate: thisdata.lectureTimeFormattedDate,
|
|
|
+ endTimeFormattedDate: thisdata.endTimeFormattedDate,
|
|
|
+ hot: thisdata.hot,
|
|
|
+ dynamic: thisdata.dynamic
|
|
|
});
|
|
|
};
|
|
|
};
|
|
|
this.setState({
|
|
|
- starTableData: theArr
|
|
|
+ dynamicTableData: theArr
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -188,14 +244,19 @@ const Star = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ loadData() {
|
|
|
+ this.loadUserData();
|
|
|
+ this.loadLectureData();
|
|
|
+ this.loadHotData();
|
|
|
+ this.loadDynamicData();
|
|
|
+ },
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
addVisible: false,
|
|
|
- hotSelectedRowKeys: [],
|
|
|
- hotSelectedRows: [],
|
|
|
- starSelectedRowKeys: [],
|
|
|
- starSelectedRows: [],
|
|
|
+ addModal: {},
|
|
|
+ selectedRowKeys: [],
|
|
|
+ selectedRows: [],
|
|
|
userPagination: {
|
|
|
defaultCurrent: 1,
|
|
|
defaultPageSize: 10,
|
|
@@ -233,6 +294,7 @@ const Star = React.createClass({
|
|
|
title: '从事领域',
|
|
|
dataIndex: 'engagedField',
|
|
|
key: 'engagedField',
|
|
|
+ render: text => { return getTechField(text[0], text[1], text[2]) }
|
|
|
}, {
|
|
|
title: '职称名字',
|
|
|
dataIndex: 'professionalTitle',
|
|
@@ -245,16 +307,6 @@ const Star = React.createClass({
|
|
|
title: '成果数量',
|
|
|
dataIndex: 'achievementNums',
|
|
|
key: 'achievementNums',
|
|
|
- }, {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- key: 'action',
|
|
|
- render: (text, record, index) => {
|
|
|
- return <div>
|
|
|
- <Button onClick={() => { this.addIndex(record) }} type="primary" style={{ marginRight: '10px' }}>添加到大咖说</Button>
|
|
|
- <Button onClick={() => { this.addStar(record) }} type="primary">添加到明星页</Button>
|
|
|
- </div>
|
|
|
- }
|
|
|
}
|
|
|
],
|
|
|
lectureColumns: [
|
|
@@ -270,6 +322,15 @@ const Star = React.createClass({
|
|
|
title: '描述',
|
|
|
dataIndex: 'summary',
|
|
|
key: 'summary',
|
|
|
+ width: '50%'
|
|
|
+ }, {
|
|
|
+ title: '开始时间',
|
|
|
+ dataIndex: 'lectureTimeFormattedDate',
|
|
|
+ key: 'lectureTimeFormattedDate',
|
|
|
+ }, {
|
|
|
+ title: '结束时间',
|
|
|
+ dataIndex: 'endTimeFormattedDate',
|
|
|
+ key: 'endTimeFormattedDate',
|
|
|
}, {
|
|
|
title: '展示图',
|
|
|
dataIndex: 'lectureUrl',
|
|
@@ -286,103 +347,45 @@ const Star = React.createClass({
|
|
|
userTableData: [],
|
|
|
lectureTableData: [],
|
|
|
hotTableData: [],
|
|
|
- starTableData: []
|
|
|
+ dynamicTableData: []
|
|
|
};
|
|
|
},
|
|
|
- addIndex(record) {
|
|
|
- let theBool = true;
|
|
|
- this.state.hotTableData.map((item, i) => {
|
|
|
- if (item.uid == record.uid) {
|
|
|
- message.warning('该条记录已经存在于大咖列表中!');
|
|
|
- theBool = false;
|
|
|
- return;
|
|
|
- };
|
|
|
- if (i == 4) {
|
|
|
- message.warning('大咖列表最多只能显示4条记录!');
|
|
|
- theBool = false;
|
|
|
- return;
|
|
|
- };
|
|
|
- });
|
|
|
- if (theBool) {
|
|
|
- this.state.hotTableData.push(record);
|
|
|
- this.setState({ hotTableData: this.state.hotTableData });
|
|
|
- };
|
|
|
- },
|
|
|
- addStar(record) {
|
|
|
- let theBool = true;
|
|
|
- this.state.starTableData.map((item, i) => {
|
|
|
- if (item.uid == record.uid) {
|
|
|
- message.warning('该条记录已经存在于明星列表中!');
|
|
|
- theBool = false;
|
|
|
- return;
|
|
|
- };
|
|
|
- if (i == 6) {
|
|
|
- message.warning('明星列表最多只能显示6条记录!');
|
|
|
- theBool = false;
|
|
|
- return;
|
|
|
- };
|
|
|
- });
|
|
|
- if (theBool) {
|
|
|
- this.state.starTableData.push(record);
|
|
|
- this.setState({ starTableData: this.state.starTableData });
|
|
|
- };
|
|
|
- },
|
|
|
- hotDelectRow() {
|
|
|
- let deletedArr = this.state.hotTableData.concat();
|
|
|
- for (let idx = 0; idx < this.state.hotSelectedRows.length; idx++) {
|
|
|
- let deleteIndex = this.state.hotSelectedRows[idx];
|
|
|
- if (deleteIndex.uid) {
|
|
|
- for (let n = 0; n < deletedArr.length; n++) {
|
|
|
- if (deleteIndex.uid == deletedArr[n].uid) {
|
|
|
- deletedArr.splice(n, 1);
|
|
|
- };
|
|
|
- };
|
|
|
+ delectRow() {
|
|
|
+ let deletedIds = [];
|
|
|
+ for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
|
|
|
+ let rowItem = this.state.selectedRows[idx];
|
|
|
+ if (rowItem.id) {
|
|
|
+ deletedIds.push(rowItem.id)
|
|
|
};
|
|
|
};
|
|
|
this.setState({
|
|
|
- hotTableData: deletedArr,
|
|
|
- hotSelectedRowKeys: []
|
|
|
+ selectedRowKeys: [],
|
|
|
+ loading: deletedIds.length > 0
|
|
|
});
|
|
|
- },
|
|
|
- starDelectRow() {
|
|
|
- let deletedArr = this.state.starTableData.concat();
|
|
|
- for (let idx = 0; idx < this.state.starSelectedRows.length; idx++) {
|
|
|
- let deleteIndex = this.state.starSelectedRows[idx];
|
|
|
- if (deleteIndex.uid) {
|
|
|
- for (let n = 0; n < deletedArr.length; n++) {
|
|
|
- if (deleteIndex.uid == deletedArr[n].uid) {
|
|
|
- deletedArr.splice(n, 1);
|
|
|
- };
|
|
|
- };
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/lecture/delete",
|
|
|
+ data: {
|
|
|
+ ids: deletedIds
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ } else {
|
|
|
+ message.success('删除成功!');
|
|
|
+ this.loadData();
|
|
|
};
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- starTableData: deletedArr,
|
|
|
- starSelectedRowKeys: []
|
|
|
- });
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
- this.loadHotData();
|
|
|
- this.loadStarData();
|
|
|
},
|
|
|
submit() {
|
|
|
- let hotArr = [], starArr = [];
|
|
|
- for (let i = 0; i < this.state.hotTableData.length; i++) {
|
|
|
- let hotUid = this.state.hotTableData[i].uid;
|
|
|
- if (hotUid) {
|
|
|
- hotArr.push(hotUid);
|
|
|
- };
|
|
|
- };
|
|
|
- for (let n = 0; n < this.state.starTableData.length; n++) {
|
|
|
- let starUid = this.state.starTableData[n].uid;
|
|
|
- if (starUid) {
|
|
|
- starArr.push({
|
|
|
- uid: starUid,
|
|
|
- star: 1
|
|
|
- });
|
|
|
- };
|
|
|
- };
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -390,16 +393,25 @@ const Star = React.createClass({
|
|
|
method: "post",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/star/save',
|
|
|
+ url: globalConfig.context + (this.state.addModal.id ? '/api/admin/lecture/update' : '/api/admin/lecture/add'),
|
|
|
data: {
|
|
|
- data: JSON.stringify(starArr),
|
|
|
- hot: hotArr
|
|
|
+ 'id': this.state.addModal.id,
|
|
|
+ "uid": this.state.addModal.uid,
|
|
|
+ "name": this.state.addModal.name,
|
|
|
+ "summary": this.state.addModal.summary,
|
|
|
+ "lectureUrl": this.state.addModal.lectureUrl,
|
|
|
+ "lectureTimeFormattedDate": this.state.addModal.lectureTimeFormattedDate,
|
|
|
+ "endTimeFormattedDate": this.state.addModal.endTimeFormattedDate,
|
|
|
+ "hot": this.state.addModal.showBig ? 1 : 0,
|
|
|
+ "dynamic": this.state.addModal.showStar ? 1 : 0
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
} else {
|
|
|
- message.success('保存成功!')
|
|
|
+ message.success('保存成功!');
|
|
|
+ this.setState({ addVisible: false });
|
|
|
+ this.loadData();
|
|
|
};
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -408,44 +420,47 @@ const Star = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- search() {
|
|
|
- this.loadData();
|
|
|
- },
|
|
|
- reset() {
|
|
|
+ resetUser() {
|
|
|
+ this.state.searchUserNumber = undefined;
|
|
|
+ this.state.searchUserName = undefined;
|
|
|
+ this.state.searchField = undefined;
|
|
|
this.state.searchPfs = undefined;
|
|
|
this.state.searchUnit = undefined;
|
|
|
- this.state.searchNumber = undefined;
|
|
|
- this.state.searchName = undefined;
|
|
|
- this.state.searchField = [];
|
|
|
- this.loadData();
|
|
|
+ this.loadUserData();
|
|
|
+ },
|
|
|
+ resetList() {
|
|
|
+ this.state.searchLectureUser = undefined;
|
|
|
+ this.state.searchLectureName = undefined;
|
|
|
+ this.state.startLectureTime = undefined;
|
|
|
+ this.state.endLectureTime = undefined;
|
|
|
+ this.loadLectureData();
|
|
|
},
|
|
|
userTableRowClick(record, index) {
|
|
|
- this.state.userData = record;
|
|
|
+ this.state.addModal.uid = record.uid;
|
|
|
+ this.state.addModal.username = record.username;
|
|
|
+ this.setState({
|
|
|
+ addVisible: true
|
|
|
+ });
|
|
|
+ },
|
|
|
+ listTableRowClick(record, index) {
|
|
|
+ this.state.addModal = record;
|
|
|
+ this.state.addModal.showBig = record.hot ? true : false;
|
|
|
+ this.state.addModal.showStar = record.dynamic ? true : false;
|
|
|
this.setState({
|
|
|
addVisible: true
|
|
|
});
|
|
|
},
|
|
|
render() {
|
|
|
- const hotRowSelection = {
|
|
|
- selectedRowKeys: this.state.hotSelectedRowKeys,
|
|
|
+ const rowSelection = {
|
|
|
+ selectedRowKeys: this.state.selectedRowKeys,
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
this.setState({
|
|
|
- hotSelectedRows: selectedRows,
|
|
|
- hotSelectedRowKeys: selectedRowKeys
|
|
|
+ selectedRows: selectedRows,
|
|
|
+ selectedRowKeys: selectedRowKeys
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
- const starRowSelection = {
|
|
|
- selectedRowKeys: this.state.starSelectedRowKeys,
|
|
|
- onChange: (selectedRowKeys, selectedRows) => {
|
|
|
- this.setState({
|
|
|
- starSelectedRows: selectedRows,
|
|
|
- starSelectedRowKeys: selectedRowKeys
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
- const hotHasSelected = this.state.hotSelectedRowKeys.length > 0;
|
|
|
- const starHasSelected = this.state.starSelectedRowKeys.length > 0;
|
|
|
+ const hasSelected = this.state.selectedRowKeys.length > 0;
|
|
|
return (
|
|
|
<div className="admin-content" >
|
|
|
<div className="admin-content-title">科技讲堂管理</div>
|
|
@@ -468,8 +483,8 @@ const Star = React.createClass({
|
|
|
<Input placeholder="工作单位" style={{ width: 160 }}
|
|
|
value={this.state.searchUnit}
|
|
|
onChange={(e) => { this.setState({ searchUnit: e.target.value }); }} />
|
|
|
- <Button type="primary" onClick={this.search}>搜索</Button>
|
|
|
- <Button onClick={this.reset}>重置</Button>
|
|
|
+ <Button type="primary" onClick={() => { this.loadUserData() }}>搜索</Button>
|
|
|
+ <Button onClick={this.resetUser}>重置</Button>
|
|
|
</div>
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table columns={this.state.userColumns}
|
|
@@ -478,68 +493,163 @@ const Star = React.createClass({
|
|
|
onRowClick={this.userTableRowClick} />
|
|
|
</Spin>
|
|
|
</div>
|
|
|
+ <div className="admin-content-warp">
|
|
|
+ <div className="admin-content-header">
|
|
|
+ <span>讲堂列表</span>
|
|
|
+ <Button type='danger' disabled={!hasSelected} onClick={this.delectRow}>
|
|
|
+ 删除<Icon type="minus" />
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div className="admin-content-search">
|
|
|
+ <Input placeholder="开讲人名称" style={{ width: 160 }}
|
|
|
+ value={this.state.searchLectureUser}
|
|
|
+ onChange={(e) => { this.setState({ searchLectureUser: e.target.value }); }} />
|
|
|
+ <Input placeholder="讲座标题" style={{ width: 160 }}
|
|
|
+ value={this.state.searchLectureName}
|
|
|
+ onChange={(e) => { this.setState({ searchLectureName: e.target.value }); }} />
|
|
|
+ <span>开始时间</span>
|
|
|
+ <DatePicker
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="选择开始搜索时间"
|
|
|
+ value={this.state.startLectureTime ? moment(this.state.startLectureTime, "YYYY-MM-DD HH:mm:ss") : undefined}
|
|
|
+ onChange={(t, str) => {
|
|
|
+ this.setState({ startLectureTime: str });
|
|
|
+ }} />
|
|
|
+ <span>到</span>
|
|
|
+ <DatePicker
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="选择结束搜索时间"
|
|
|
+ value={this.state.endLectureTime ? moment(this.state.endLectureTime, "YYYY-MM-DD HH:mm:ss") : undefined}
|
|
|
+ onChange={(t, str) => {
|
|
|
+ this.setState({ endLectureTime: str });
|
|
|
+ }} />
|
|
|
+ <Button type="primary" onClick={() => { this.loadLectureData() }}>搜索</Button>
|
|
|
+ <Button onClick={this.resetList}>重置</Button>
|
|
|
+ </div>
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <Table columns={this.state.lectureColumns}
|
|
|
+ dataSource={this.state.lectureTableData}
|
|
|
+ rowSelection={rowSelection}
|
|
|
+ onRowClick={this.listTableRowClick}
|
|
|
+ pagination={this.state.lecturePagination} />
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
<div className="clearfix">
|
|
|
<div className="admin-content-warp" style={{ width: '50%', float: 'left' }}>
|
|
|
<div className="admin-content-header">
|
|
|
- <span>讲堂列表</span>
|
|
|
- <Button type='danger' disabled={!hotHasSelected} onClick={this.hotDelectRow}>
|
|
|
- 删除<Icon type="minus" />
|
|
|
- </Button>
|
|
|
+ <span>大咖页列表</span>
|
|
|
</div>
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<Table columns={this.state.lectureColumns}
|
|
|
- dataSource={this.state.lectureTableData}
|
|
|
- rowSelection={hotRowSelection}
|
|
|
- pagination={this.state.lecturePagination} />
|
|
|
+ dataSource={this.state.hotTableData}
|
|
|
+ onRowClick={this.listTableRowClick}
|
|
|
+ pagination={false} />
|
|
|
</Spin>
|
|
|
</div>
|
|
|
<div className="admin-content-warp" style={{ width: '50%', float: 'left' }}>
|
|
|
<div className="admin-content-header">
|
|
|
- <span>明星显示列表</span>
|
|
|
- <Button type='danger' disabled={!starHasSelected} onClick={this.starDelectRow}>
|
|
|
- 删除<Icon type="minus" />
|
|
|
- </Button>
|
|
|
+ <span>明星动态列表</span>
|
|
|
</div>
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
- <Table columns={this.state.otherColumns}
|
|
|
- dataSource={this.state.starTableData}
|
|
|
- rowSelection={starRowSelection}
|
|
|
+ <Table columns={this.state.lectureColumns}
|
|
|
+ dataSource={this.state.dynamicTableData}
|
|
|
+ onRowClick={this.listTableRowClick}
|
|
|
pagination={false} />
|
|
|
</Spin>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Button onClick={this.submit} type="primary" style={{ marginTop: '20px' }}>保存</Button>
|
|
|
<Modal
|
|
|
- title="新建科技讲堂" width={600}
|
|
|
+ title="科技讲堂详情" width={600}
|
|
|
visible={this.state.addVisible}
|
|
|
+ maskClosable={false}
|
|
|
footer={null}
|
|
|
+ afterClose={() => { this.state.addModal = {} }}
|
|
|
onCancel={() => { this.setState({ addVisible: false }) }} >
|
|
|
- <div className="modal-box">
|
|
|
- <span className="modal-box-title">开讲人</span>
|
|
|
- <div className="modal-box-detail">
|
|
|
- {this.state.userData.name}
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">开讲人</span>
|
|
|
+ <div className="modal-box-detail">
|
|
|
+ {this.state.addModal.username}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div className="modal-box">
|
|
|
- <span className="modal-box-title">讲堂标题</span>
|
|
|
- <div className="modal-box-detail">
|
|
|
- <Input value={this.state.addModal.title}
|
|
|
- onChange={(e) => {
|
|
|
- this.state.addModal.title = e.target.value;
|
|
|
- this.setState({ addModal: this.state.addModal });
|
|
|
- }} />
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">讲堂标题</span>
|
|
|
+ <div className="modal-box-detail">
|
|
|
+ <Input value={this.state.addModal.name}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.state.addModal.name = e.target.value;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div className="modal-box">
|
|
|
- <span className="modal-box-title">开讲时间</span>
|
|
|
- <div className="modal-box-detail">
|
|
|
- {this.state.userData.name}
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">讲堂描述</span>
|
|
|
+ <div className="modal-box-detail">
|
|
|
+ <Input type="textarea" value={this.state.addModal.summary} rows={4}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.state.addModal.summary = e.target.value;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">开讲时间</span>
|
|
|
+ <div className="modal-box-detail">
|
|
|
+ <DatePicker
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="选择开始时间"
|
|
|
+ value={this.state.addModal.lectureTimeFormattedDate ? moment(this.state.addModal.lectureTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
|
|
|
+ onChange={(t, str) => {
|
|
|
+ this.state.addModal.lectureTimeFormattedDate = str;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }} />
|
|
|
+ <span>到</span>
|
|
|
+ <DatePicker
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placeholder="选择结束时间"
|
|
|
+ value={this.state.addModal.endTimeFormattedDate ? moment(this.state.addModal.endTimeFormattedDate, "YYYY-MM-DD HH:mm:ss") : undefined}
|
|
|
+ onChange={(t, str) => {
|
|
|
+ this.state.addModal.endTimeFormattedDate = str;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">讲堂图片</span>
|
|
|
+ <div className="modal-box-detail clearfix">
|
|
|
+ <Avatar uid={this.state.addModal.uid}
|
|
|
+ imageUrl={this.state.addModal.lectureUrl ? (globalConfig.avatarHost + "/upload" + this.state.addModal.lectureUrl) : null}
|
|
|
+ urlData={(url) => { this.state.addModal.lectureUrl = url }} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="modal-box">
|
|
|
+ <span className="modal-box-title">其他选项</span>
|
|
|
+ <div className="modal-box-detail clearfix">
|
|
|
+ <Checkbox checked={this.state.addModal.showBig}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.state.addModal.showBig = e.target.checked;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }}>显示到大咖说</Checkbox>
|
|
|
+ <Checkbox checked={this.state.addModal.showStar}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.state.addModal.showStar = e.target.checked;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }}>显示到明星动态</Checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="modal-box">
|
|
|
+ <Button type="primary" onClick={this.submit}>提交</Button>
|
|
|
+ <Button type="ghost" onClick={() => { this.setState({ addVisible: false }) }}>取消</Button>
|
|
|
+ </div>
|
|
|
+ </Spin>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-export default Star;
|
|
|
+export default Lecture;
|