yee hace 7 años
padre
commit
1929f457ac

+ 2 - 2
js/component/account/index/normal.jsx

@@ -95,8 +95,8 @@ const Content = React.createClass({
                         <ul className="record-list clearfix">
                             <li>专利:<a href={globalConfig.context + "/user/account/services.html#patent"}>{this.state.patentNum || 0}</a> 项</li>
                             <li>软著:<a href={globalConfig.context + "/user/account/services.html#copyright"}>{this.state.copyrightNum || 0}</a> 项</li>
-                            <li>知识产权:<a href={globalConfig.context + "/user/account/services.html#cognizance"}>{this.state.intellectualPropertyNum || 0}</a> 项</li>
-                            <li>科技项目:<a href={globalConfig.context + "/user/account/services.html#intellectual"}>{this.state.techProjectNum || 0}</a> 项</li>
+                            <li>知识产权:<a href={globalConfig.context + "/user/account/services.html#intellectual"}>{this.state.intellectualPropertyNum || 0}</a> 项</li>
+                            <li>科技项目:<a href={globalConfig.context + "/user/account/services.html#technology"}>{this.state.techProjectNum || 0}</a> 项</li>
                             <li>技术成果:<a href={globalConfig.context + "/user/account/achievement.html#techAchievement"}>{this.state.achievementNum || 0}</a> 项</li>
                             <li>发布需求:<a href={globalConfig.context + "/user/account/demand.html#techDemand"}>{this.state.demandNum || 0}</a> 项</li>
                         </ul>

+ 1 - 1
js/component/account/services/cognizance.jsx

@@ -115,7 +115,7 @@ const CognizanceDescFrom = Form.create()(React.createClass({
                 key: 'grossProfit',
             }],
             stateColumns: [{
-                title: '专利状态',
+                title: '状态',
                 dataIndex: 'state',
                 key: 'state',
                 render: (text) => { return getCognizanceState(text) }

+ 256 - 0
js/component/manageCenter/idea/bannerManage/bannerManage.jsx

@@ -0,0 +1,256 @@
+import React from 'react';
+import { Icon, Button, Spin, message, Table, Input, Modal, DatePicker, Upload, Select } from 'antd';
+import { beforeUpload, getBase64 } from '../../../tools';
+import moment from 'moment';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+
+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({
+    loadData(pageNo) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/banners/list',
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                key: this.state.searcchKey
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.length; i++) {
+                        let thisdata = data.data[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id, //主键
+                            sign: thisdata.sign,  // 位置标示
+                            text: thisdata.text,  //广告图描述
+                            imgurl: thisdata.imgurl, //广告图url
+                            url: thisdata.url, //跳转链接
+                            width: thisdata.width, //宽度
+                            height: thisdata.height, //高度
+                            startDate: thisdata.startDate, //广告图开始时间
+                            endDate: thisdata.endDate //广告图结束时间
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    tableData: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    loadKeys() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            url: globalConfig.context + '/api/admin/banners/keys',
+            success: function (data) {
+                let theArr = [];
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let item in data.data) {
+                        let thisdata = data.data[item];
+                        theArr.push(
+                            <Select.Option value={item} key={item}>{thisdata}</Select.Option>
+                        );
+                    };
+                };
+                this.setState({
+                    keysOption: theArr,
+                    keysObj: data.data
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            loading: false,
+            keysObj: {},
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '位置',
+                    dataIndex: 'sign',
+                    key: 'sign',
+                    render: text => { return keysObj[text] }
+                }, {
+                    title: '广告图描述',
+                    dataIndex: 'text',
+                    key: 'text',
+                }, {
+                    title: '广告图url',
+                    dataIndex: 'imgurl',
+                    key: 'imgurl',
+                }, {
+                    title: '跳转链接',
+                    dataIndex: 'url',
+                    key: 'url',
+                }, {
+                    title: '宽度',
+                    dataIndex: 'width',
+                    key: 'width',
+                }, {
+                    title: '高度',
+                    dataIndex: 'height',
+                    key: 'height',
+                }, {
+                    title: '开始时间',
+                    dataIndex: 'startDate',
+                    key: 'startDate',
+                }, {
+                    title: '结束时间',
+                    dataIndex: 'endDate',
+                    key: 'endDate',
+                }
+            ],
+            tableData: []
+        };
+    },
+    componentWillMount() {
+        this.loadKeys();
+        this.loadData();
+    },
+    submit() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + (this.state.addModal.id ? '/api/admin/lecture/update' : '/api/admin/lecture/add'),
+            data: {
+                '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('保存成功!');
+                    this.setState({ addVisible: false });
+                    this.loadData();
+                };
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    reset() {
+        this.state.searchKey = undefined;
+        this.loadData();
+    },
+    render() {
+        return (
+            <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">
+                        <Select placeholder="选择广告图位置"
+                            style={{ width: 200 }}
+                            value={this.state.searchKey}
+                            onChange={(e) => { this.setState({ searchKey: e }) }}>
+                            {this.state.keysOption}
+                        </Select>
+                        <Button type="primary" onClick={this.loadData}>搜索</Button>
+                        <Button onClick={this.reset}>重置</Button>
+                    </div>
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.tableData}
+                            pagination={this.state.pagination} />
+                    </Spin>
+                </div>
+            </div>
+        );
+    }
+});
+
+export default Lecture;

+ 297 - 187
js/component/manageCenter/idea/bigShot/lecture.jsx

@@ -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;

+ 6 - 4
js/component/manageCenter/idea/bigShot/star.jsx

@@ -1,6 +1,6 @@
 import React from 'react';
 import { Icon, Button, Spin, message, Table, Cascader, Input } from 'antd';
-import { techFieldList } from '../../../DicTechFieldList';
+import { techFieldList, getTechField } from '../../../DicTechFieldList';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 
@@ -35,7 +35,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,
@@ -78,7 +78,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,
@@ -118,7 +118,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,
@@ -169,6 +169,7 @@ const Star = React.createClass({
                     title: '从事领域',
                     dataIndex: 'engagedField',
                     key: 'engagedField',
+                    render: text => { return getTechField(text[0], text[1], text[2]); }
                 }, {
                     title: '职称名字',
                     dataIndex: 'professionalTitle',
@@ -206,6 +207,7 @@ const Star = React.createClass({
                     title: '从事领域',
                     dataIndex: 'engagedField',
                     key: 'engagedField',
+                    render: text => { return getTechField(text[0], text[1], text[2]); }
                 }, {
                     title: '职称名字',
                     dataIndex: 'professionalTitle',

+ 8 - 0
js/component/manageCenter/idea/content.jsx

@@ -37,6 +37,14 @@ class Content extends Component {
                     });
                 });
                 break;
+            case 'banner':
+                require.ensure([], () => {
+                    const Banner = require('./bannerManage/bannerManage').default;
+                    this.setState({
+                        component: Banner
+                    });
+                });
+                break;
         };
         window.location.hash = key;
     }

+ 54 - 0
js/component/manageCenter/idea/content.less

@@ -25,4 +25,58 @@
             }
         }
     }
+}
+
+.ant-modal-body {
+    .modal-box {
+        overflow: hidden;
+        line-height: 28px;
+        margin-bottom: 10px;
+        .modal-box-title {
+            float: left;
+            width: 60px;
+            margin-right: 20px;
+        }
+        .modal-box-detail {
+            float: left;
+            width: 400px;
+            >span {
+                margin-right: 6px;
+            }
+        }
+        >button {
+            margin-right: 20px;
+        }
+    }
+}
+
+.avatar-uploader,
+.avatar-uploader-trigger,
+.avatar {
+    width: 150px;
+    height: 150px;
+}
+
+.avatar-uploader {
+    display: block;
+    padding: 1px;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    img {
+        position: absolute;
+        top: -1px;
+        left: -1px;
+        height: 150px;
+    } //
+    float: left;
+    margin-right: 20px;
+}
+
+.avatar-uploader-trigger {
+    display: table-cell;
+    vertical-align: middle;
+    font-size: 28px;
+    color: #999;
 }

+ 7 - 1
js/component/manageCenter/idea/leftTab.jsx

@@ -11,7 +11,8 @@ const LeftTab = React.createClass({
             current: 'star',
             subKey: 'sub1',
             keyList: [
-                { key: 'sub1', value: ['star','lecture'] },
+                { key: 'sub1', value: ['star', 'lecture'] },
+                { key: 'sub10', value: ['banner'] }
             ]
         };
     },
@@ -51,6 +52,11 @@ const LeftTab = React.createClass({
                         科技讲堂
                     </Menu.Item>
                 </SubMenu>
+                <SubMenu key="sub10" title={<span>广告图</span>}>
+                    <Menu.Item key="banner">
+                        广告图管理
+                    </Menu.Item>
+                </SubMenu>
             </Menu>
         );
     }