|
@@ -46,58 +46,6 @@ const Avatar = React.createClass({
|
|
|
});
|
|
|
|
|
|
const Lecture = React.createClass({
|
|
|
- loadUserData(pageNo) {
|
|
|
- this.setState({
|
|
|
- loading: true
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/lecture/starAndExpertList',
|
|
|
- data: {
|
|
|
- pageNo: pageNo || 1,
|
|
|
- pageSize: this.state.userPagination.pageSize,
|
|
|
- number: this.state.searchUserNumber, //编号
|
|
|
- username: this.state.searchUserName, //名称
|
|
|
- engagedField: this.state.searchField ? this.state.searchField.join(',') : undefined,
|
|
|
- professionalTitle: this.state.searchPfs,
|
|
|
- workUnit: this.state.searchUnit
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let theArr = [];
|
|
|
- if (!data.data || !data.data.list) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- } else {
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- theArr.push({
|
|
|
- key: i,
|
|
|
- uid: thisdata.uid,
|
|
|
- engagedField: thisdata.engagedField ? thisdata.engagedField.split(',') : [],
|
|
|
- username: thisdata.username,
|
|
|
- professionalTitle: thisdata.professionalTitle,
|
|
|
- workUnit: thisdata.workUnit,
|
|
|
- number: thisdata.number,
|
|
|
- achievementNums: thisdata.achievementNums,
|
|
|
- });
|
|
|
- };
|
|
|
- this.state.userPagination.current = data.data.pageNo;
|
|
|
- this.state.userPagination.total = data.data.totalCount;
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- userTableData: theArr,
|
|
|
- userPagination: this.state.userPagination
|
|
|
- });
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
loadLectureData(pageNo) {
|
|
|
this.setState({
|
|
|
loading: true
|
|
@@ -245,7 +193,7 @@ const Lecture = React.createClass({
|
|
|
}.bind(this));
|
|
|
},
|
|
|
loadData() {
|
|
|
- this.loadUserData();
|
|
|
+ // this.loadUserData();
|
|
|
this.loadLectureData();
|
|
|
this.loadHotData();
|
|
|
this.loadDynamicData();
|
|
@@ -257,18 +205,18 @@ const Lecture = React.createClass({
|
|
|
addModal: {},
|
|
|
selectedRowKeys: [],
|
|
|
selectedRows: [],
|
|
|
- userPagination: {
|
|
|
- defaultCurrent: 1,
|
|
|
- defaultPageSize: 10,
|
|
|
- showQuickJumper: true,
|
|
|
- pageSize: 10,
|
|
|
- onChange: function (page) {
|
|
|
- this.loadUserData(page);
|
|
|
- }.bind(this),
|
|
|
- showTotal: function (total) {
|
|
|
- return '共' + total + '条数据';
|
|
|
- }
|
|
|
- },
|
|
|
+ // userPagination: {
|
|
|
+ // defaultCurrent: 1,
|
|
|
+ // defaultPageSize: 10,
|
|
|
+ // showQuickJumper: true,
|
|
|
+ // pageSize: 10,
|
|
|
+ // onChange: function (page) {
|
|
|
+ // this.loadUserData(page);
|
|
|
+ // }.bind(this),
|
|
|
+ // showTotal: function (total) {
|
|
|
+ // return '共' + total + '条数据';
|
|
|
+ // }
|
|
|
+ // },
|
|
|
lecturePagination: {
|
|
|
defaultCurrent: 1,
|
|
|
defaultPageSize: 10,
|
|
@@ -281,34 +229,34 @@ const Lecture = React.createClass({
|
|
|
return '共' + total + '条数据';
|
|
|
}
|
|
|
},
|
|
|
- userColumns: [
|
|
|
- {
|
|
|
- title: '编号',
|
|
|
- dataIndex: 'number',
|
|
|
- key: 'number',
|
|
|
- }, {
|
|
|
- title: '姓名',
|
|
|
- dataIndex: 'username',
|
|
|
- key: 'username',
|
|
|
- }, {
|
|
|
- title: '从事领域',
|
|
|
- dataIndex: 'engagedField',
|
|
|
- key: 'engagedField',
|
|
|
- render: text => { return getTechField(text[0], text[1], text[2]) }
|
|
|
- }, {
|
|
|
- title: '职称名字',
|
|
|
- dataIndex: 'professionalTitle',
|
|
|
- key: 'professionalTitle',
|
|
|
- }, {
|
|
|
- title: '工作单位',
|
|
|
- dataIndex: 'workUnit',
|
|
|
- key: 'workUnit',
|
|
|
- }, {
|
|
|
- title: '成果数量',
|
|
|
- dataIndex: 'achievementNums',
|
|
|
- key: 'achievementNums',
|
|
|
- }
|
|
|
- ],
|
|
|
+ // userColumns: [
|
|
|
+ // {
|
|
|
+ // title: '编号',
|
|
|
+ // dataIndex: 'number',
|
|
|
+ // key: 'number',
|
|
|
+ // }, {
|
|
|
+ // title: '姓名',
|
|
|
+ // dataIndex: 'username',
|
|
|
+ // key: 'username',
|
|
|
+ // }, {
|
|
|
+ // title: '从事领域',
|
|
|
+ // dataIndex: 'engagedField',
|
|
|
+ // key: 'engagedField',
|
|
|
+ // render: text => { return getTechField(text[0], text[1], text[2]) }
|
|
|
+ // }, {
|
|
|
+ // title: '职称名字',
|
|
|
+ // dataIndex: 'professionalTitle',
|
|
|
+ // key: 'professionalTitle',
|
|
|
+ // }, {
|
|
|
+ // title: '工作单位',
|
|
|
+ // dataIndex: 'workUnit',
|
|
|
+ // key: 'workUnit',
|
|
|
+ // }, {
|
|
|
+ // title: '成果数量',
|
|
|
+ // dataIndex: 'achievementNums',
|
|
|
+ // key: 'achievementNums',
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
lectureColumns: [
|
|
|
{
|
|
|
title: '讲堂名称',
|
|
@@ -316,8 +264,8 @@ const Lecture = React.createClass({
|
|
|
key: 'name',
|
|
|
}, {
|
|
|
title: '开讲人姓名',
|
|
|
- dataIndex: 'username',
|
|
|
- key: 'username',
|
|
|
+ dataIndex: 'lecturer',
|
|
|
+ key: 'lecturer',
|
|
|
}, {
|
|
|
title: '描述',
|
|
|
dataIndex: 'summary',
|
|
@@ -397,6 +345,7 @@ const Lecture = React.createClass({
|
|
|
data: {
|
|
|
'id': this.state.addModal.id,
|
|
|
"uid": this.state.addModal.uid,
|
|
|
+ "lecturer": this.state.addModal.lecturer,
|
|
|
"name": this.state.addModal.name,
|
|
|
"summary": this.state.addModal.summary,
|
|
|
"lectureUrl": this.state.addModal.lectureUrl,
|
|
@@ -445,14 +394,14 @@ const Lecture = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- resetUser() {
|
|
|
- this.state.searchUserNumber = undefined;
|
|
|
- this.state.searchUserName = undefined;
|
|
|
- this.state.searchField = undefined;
|
|
|
- this.state.searchPfs = undefined;
|
|
|
- this.state.searchUnit = undefined;
|
|
|
- this.loadUserData();
|
|
|
- },
|
|
|
+ // resetUser() {
|
|
|
+ // this.state.searchUserNumber = undefined;
|
|
|
+ // this.state.searchUserName = undefined;
|
|
|
+ // this.state.searchField = undefined;
|
|
|
+ // this.state.searchPfs = undefined;
|
|
|
+ // this.state.searchUnit = undefined;
|
|
|
+ // this.loadUserData();
|
|
|
+ // },
|
|
|
resetList() {
|
|
|
this.state.searchLectureUser = undefined;
|
|
|
this.state.searchLectureName = undefined;
|
|
@@ -460,9 +409,7 @@ const Lecture = React.createClass({
|
|
|
this.state.endLectureTime = undefined;
|
|
|
this.loadLectureData();
|
|
|
},
|
|
|
- userTableRowClick(record, index) {
|
|
|
- this.state.addModal.uid = record.uid;
|
|
|
- this.state.addModal.username = record.username;
|
|
|
+ addClick() {
|
|
|
this.setState({
|
|
|
addVisible: true
|
|
|
});
|
|
@@ -490,41 +437,13 @@ const Lecture = React.createClass({
|
|
|
<div className="admin-content" >
|
|
|
<div className="admin-content-title">科技讲堂管理</div>
|
|
|
<div className="admin-content-warp">
|
|
|
- <div className="admin-content-header">专家明星列表</div>
|
|
|
- <div className="admin-content-search">
|
|
|
- <Input placeholder="编号" style={{ width: 100 }}
|
|
|
- value={this.state.searchUserNumber}
|
|
|
- onChange={(e) => { this.setState({ searchUserNumber: e.target.value }); }} />
|
|
|
- <Input placeholder="专家明星名称" style={{ width: 160 }}
|
|
|
- value={this.state.searchUserName}
|
|
|
- onChange={(e) => { this.setState({ searchUserName: e.target.value }); }} />
|
|
|
- <Cascader placeholder="请选择一个行业" style={{ width: 300 }}
|
|
|
- options={techFieldList}
|
|
|
- value={this.state.searchField}
|
|
|
- onChange={(e) => { this.setState({ searchField: e }) }} />
|
|
|
- <Input placeholder="职称名字" style={{ width: 160 }}
|
|
|
- value={this.state.searchPfs}
|
|
|
- onChange={(e) => { this.setState({ searchPfs: e.target.value }); }} />
|
|
|
- <Input placeholder="工作单位" style={{ width: 160 }}
|
|
|
- value={this.state.searchUnit}
|
|
|
- onChange={(e) => { this.setState({ searchUnit: e.target.value }); }} />
|
|
|
- <Button type="primary" onClick={() => { this.loadUserData() }}>搜索</Button>
|
|
|
- <Button onClick={this.resetUser}>重置</Button>
|
|
|
- </div>
|
|
|
- <Spin spinning={this.state.loading}>
|
|
|
- <Table columns={this.state.userColumns}
|
|
|
- dataSource={this.state.userTableData}
|
|
|
- pagination={this.state.userPagination}
|
|
|
- onRowClick={this.userTableRowClick} />
|
|
|
- </Spin>
|
|
|
- </div>
|
|
|
- <div className="admin-content-warp">
|
|
|
<div className="admin-content-header">
|
|
|
<span>讲堂列表</span>
|
|
|
<Button type="primary" onClick={() => { this.cleanCache('lecture_list_cache_key'); }}>清除缓存</Button>
|
|
|
<Button type='danger' disabled={!hasSelected} onClick={this.delectRow}>
|
|
|
删除<Icon type="minus" />
|
|
|
</Button>
|
|
|
+ <Button type="primary" onClick={() => { this.addClick(); }}>新增</Button>
|
|
|
</div>
|
|
|
<div className="admin-content-search">
|
|
|
<Input placeholder="开讲人名称" style={{ width: 160 }}
|
|
@@ -599,7 +518,11 @@ const Lecture = React.createClass({
|
|
|
<div className="modal-box">
|
|
|
<span className="modal-box-title">开讲人</span>
|
|
|
<div className="modal-box-detail">
|
|
|
- {this.state.addModal.username}
|
|
|
+ <Input value={this.state.addModal.lecturer}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.state.addModal.lecturer = e.target.value;
|
|
|
+ this.setState({ addModal: this.state.addModal });
|
|
|
+ }} />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="modal-box">
|
|
@@ -680,4 +603,87 @@ const Lecture = React.createClass({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-export default Lecture;
|
|
|
+export default Lecture;
|
|
|
+
|
|
|
+ // loadUserData(pageNo) {
|
|
|
+ // this.setState({
|
|
|
+ // loading: true
|
|
|
+ // });
|
|
|
+ // $.ajax({
|
|
|
+ // method: "get",
|
|
|
+ // dataType: "json",
|
|
|
+ // crossDomain: false,
|
|
|
+ // url: globalConfig.context + '/api/admin/lecture/starAndExpertList',
|
|
|
+ // data: {
|
|
|
+ // pageNo: pageNo || 1,
|
|
|
+ // pageSize: this.state.userPagination.pageSize,
|
|
|
+ // number: this.state.searchUserNumber, //编号
|
|
|
+ // username: this.state.searchUserName, //名称
|
|
|
+ // engagedField: this.state.searchField ? this.state.searchField.join(',') : undefined,
|
|
|
+ // professionalTitle: this.state.searchPfs,
|
|
|
+ // workUnit: this.state.searchUnit
|
|
|
+ // },
|
|
|
+ // success: function (data) {
|
|
|
+ // let theArr = [];
|
|
|
+ // if (!data.data || !data.data.list) {
|
|
|
+ // if (data.error && data.error.length) {
|
|
|
+ // message.warning(data.error[0].message);
|
|
|
+ // };
|
|
|
+ // } else {
|
|
|
+ // for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ // let thisdata = data.data.list[i];
|
|
|
+ // theArr.push({
|
|
|
+ // key: i,
|
|
|
+ // uid: thisdata.uid,
|
|
|
+ // engagedField: thisdata.engagedField ? thisdata.engagedField.split(',') : [],
|
|
|
+ // username: thisdata.username,
|
|
|
+ // professionalTitle: thisdata.professionalTitle,
|
|
|
+ // workUnit: thisdata.workUnit,
|
|
|
+ // number: thisdata.number,
|
|
|
+ // achievementNums: thisdata.achievementNums,
|
|
|
+ // });
|
|
|
+ // };
|
|
|
+ // this.state.userPagination.current = data.data.pageNo;
|
|
|
+ // this.state.userPagination.total = data.data.totalCount;
|
|
|
+ // };
|
|
|
+ // this.setState({
|
|
|
+ // userTableData: theArr,
|
|
|
+ // userPagination: this.state.userPagination
|
|
|
+ // });
|
|
|
+ // }.bind(this),
|
|
|
+ // }).always(function () {
|
|
|
+ // this.setState({
|
|
|
+ // loading: false
|
|
|
+ // });
|
|
|
+ // }.bind(this));
|
|
|
+ // },
|
|
|
+
|
|
|
+ // <div className="admin-content-warp">
|
|
|
+ // <div className="admin-content-header">专家明星列表</div>
|
|
|
+ // <div className="admin-content-search">
|
|
|
+ // <Input placeholder="编号" style={{ width: 100 }}
|
|
|
+ // value={this.state.searchUserNumber}
|
|
|
+ // onChange={(e) => { this.setState({ searchUserNumber: e.target.value }); }} />
|
|
|
+ // <Input placeholder="专家明星名称" style={{ width: 160 }}
|
|
|
+ // value={this.state.searchUserName}
|
|
|
+ // onChange={(e) => { this.setState({ searchUserName: e.target.value }); }} />
|
|
|
+ // <Cascader placeholder="请选择一个行业" style={{ width: 300 }}
|
|
|
+ // options={techFieldList}
|
|
|
+ // value={this.state.searchField}
|
|
|
+ // onChange={(e) => { this.setState({ searchField: e }) }} />
|
|
|
+ // <Input placeholder="职称名字" style={{ width: 160 }}
|
|
|
+ // value={this.state.searchPfs}
|
|
|
+ // onChange={(e) => { this.setState({ searchPfs: e.target.value }); }} />
|
|
|
+ // <Input placeholder="工作单位" style={{ width: 160 }}
|
|
|
+ // value={this.state.searchUnit}
|
|
|
+ // onChange={(e) => { this.setState({ searchUnit: e.target.value }); }} />
|
|
|
+ // <Button type="primary" onClick={() => { this.loadUserData() }}>搜索</Button>
|
|
|
+ // <Button onClick={this.resetUser}>重置</Button>
|
|
|
+ // </div>
|
|
|
+ // <Spin spinning={this.state.loading}>
|
|
|
+ // <Table columns={this.state.userColumns}
|
|
|
+ // dataSource={this.state.userTableData}
|
|
|
+ // pagination={this.state.userPagination}
|
|
|
+ // onRowClick={this.userTableRowClick} />
|
|
|
+ // </Spin>
|
|
|
+ // </div>
|