Browse Source

Merge branch 'master' of https://git.coding.net/aft/AFT-WEB

wubb 8 years ago
parent
commit
ee53fbb8c7

BIN
AFT-WEB-master修改接口前备份.zip


+ 5 - 0
entry.js

@@ -13,6 +13,7 @@ module.exports = {
     //admin
     'admin/index': './js/admin/index.js',
     'admin/login': './js/admin/login.js',
+    'admin/set': './js/admin/set.js',
     'admin/userManage': './js/admin/userManage.js',
     //admin-servicesManage
     'admin/servicesManage/patent': './js/admin/servicesManage/patent.js',
@@ -67,6 +68,10 @@ module.exports = {
       'webpack/hot/only-dev-server',
       './js/admin/userManage.js'
     ],
+    'admin/set': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+      'webpack/hot/only-dev-server',
+      './js/admin/set.js'
+    ],
     'admin/servicesManage/patent': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/patent.js'

+ 16 - 0
js/admin/set.js

@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import '../../css/base.less';
+
+import TopTab from '../component/manageCenter/topTab.jsx';
+import Footer from '../component/manageCenter/bottom.jsx';
+import Content from '../component/manageCenter/set/content.jsx';
+
+ReactDOM.render(
+    <div className="wrap clearfix">
+        <TopTab active={'set'}/>
+        <Content />
+        <Footer />
+    </div>,
+    document.getElementById('root')
+)

+ 1 - 1
js/admin/userManage.js

@@ -8,7 +8,7 @@ import Content from '../component/manageCenter/userManage/content.jsx';
 
 ReactDOM.render(
     <div className="wrap clearfix">
-        <TopTab active={'set'}/>
+        <TopTab active={'userManage'}/>
         <Content />
         <Footer />
     </div>,

+ 2 - 1
js/component/account/services/patent.jsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import { Icon, Alert, Button, Input, Select, Spin, Table, message } from 'antd';
 import { patentTypeList, patentStateList } from '../../dataDic.js';
-import { getPatentType, getPatentState, getTime } from '../../tools.js';
+import { getPatentType, getPatentState, getTime, setUserContactsList } from '../../tools.js';
 import ajax from 'jquery/src/ajax/xhr.js'
 import $ from 'jquery/src/ajax';
 import './patent.less';
@@ -152,6 +152,7 @@ const Patent = React.createClass({
             )
         });
         this.loadData();
+        this.state.contactsOption = setUserContactsList();
     },
     alertClose(e) {
         console.log(e);

+ 32 - 4
js/component/account/services/patentAdd.jsx

@@ -1,6 +1,6 @@
 import React from 'react';
-import { Icon, Modal, Button, Form, Upload, message, Input, Spin, Checkbox } from 'antd';
-import { beforeUploadFile, downloadFile } from '../../tools.js';
+import { Icon, Modal, Button, Form, Upload, message, Input, Spin, Checkbox, Select } from 'antd';
+import { beforeUploadFile, downloadFile, setUserContactsList } from '../../tools.js';
 import './patent.less';
 import ajax from 'jquery/src/ajax/xhr.js'
 import $ from 'jquery/src/ajax';
@@ -12,9 +12,11 @@ const PatentAddFrom = Form.create()(React.createClass({
             firstCheck: 0,
             secondCheck: 0,
             thirdCheck: 0
-
         };
     },
+    componentWillMount() {
+        this.state.contactsOption = setUserContactsList();
+    },
     handleSubmit(e) {
         e.preventDefault();
         if (!this.state.patentProryStatementUrl) {
@@ -33,6 +35,8 @@ const PatentAddFrom = Form.create()(React.createClass({
                         'firstInventorIdNumber': values.firstInventorID,
                         'firstInventorName': values.firstInventorName,
                         'patentDes': values.intro,
+                        'patentName': values.patentName,
+                        'contacts': values.contacts,
                         'secondInventorName': values.secondInventorName,
                         'thirdInventorName': values.thirdInventorName,
                         'firstInventorIsPublish': this.state.firstCheck,
@@ -96,6 +100,30 @@ const PatentAddFrom = Form.create()(React.createClass({
         return (
             <Form horizontal onSubmit={this.handleSubmit} className="patent-form">
                 <FormItem
+                    {...formItemLayout}
+                    label="专利名称"
+                >
+                    {getFieldDecorator('patentName', {
+                        rules: [{ required: true, message: '请输入姓名!' }]
+                    })(
+                        <Input placeholder="请输入专利名称" style={{ width: 200 }} />
+                        )}
+                </FormItem>
+                <FormItem
+                    {...formItemLayout}
+                    label="选择联系人"
+                >
+                    {getFieldDecorator('contacts', {
+                        rules: [{ required: true, message: '请选择一个联系人!' }]
+                    })(
+                        <Select placeholder="请选择联系人" style={{ width: 200 }}
+                            notFoundContent="未获取到联系人列表"
+                            onSelect={(e, n) => { this.setState({ contacts: e }); }}>
+                            {this.state.contactsOption}
+                        </Select>
+                        )}
+                </FormItem>
+                <FormItem
                     labelCol={{ span: 24 }}
                     wrapperCol={{ span: 24 }}
                     label="专利简要描述"
@@ -176,7 +204,7 @@ const PatentAddFrom = Form.create()(React.createClass({
                     >
                         <Button><Icon type="upload" /> 上传专利代理委托书 </Button>
                     </Upload>
-                    <p style={{paddingLeft:'10px',marginTop:'10px'}}>
+                    <p style={{ paddingLeft: '10px', marginTop: '10px' }}>
                         <a onClick={() => { window.open(globalConfig.context + "/open/downloadTemplateFile?sign=patent_prory_statement") }}>专利代理委托书模板下载</a>
                     </p>
                 </div>

+ 5 - 30
js/component/account/services/patentDesc.jsx

@@ -1,8 +1,8 @@
 import React from 'react';
 import { Icon, Modal, message, Spin, Timeline, Button } from 'antd';
-import { getPatentType, getPatentState, getTime, getPatentField, downloadFile } from '../../tools.js';
+import { getPatentType, getPatentState, getTime, getPatentField, downloadFile, getStepList } from '../../tools.js';
 import './patent.less';
-import ajax from 'jquery/src/ajax/xhr.js'
+import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 
 const PatentDesc = React.createClass({
@@ -24,32 +24,6 @@ const PatentDesc = React.createClass({
         });
         this.props.closeDesc(false, true);
     },
-    getStepList(thepid) {
-        this.state.stepList = [];
-        $.ajax({
-            method: "post",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/techservice/patent/patentProcess",
-            data: {
-                pid: thepid
-            },
-            success: function (data) {
-                if (data.error && data.error.length && !data.data) {
-                    return;
-                };
-                let _me = this;
-                for (var item in data.data) {
-                    _me.state.stepList.push(
-                        <Timeline.Item key={item}> <span>{getPatentState(data.data[item].state)}</span> {getTime(data.data[item].recordTime)}</Timeline.Item>
-                    )
-                };
-                this.setState({
-                    stepList: this.state.stepList
-                });
-            }.bind(this),
-        });
-    },
     getPatentInfo(thepid) {
         $.ajax({
             method: "post",
@@ -68,14 +42,15 @@ const PatentDesc = React.createClass({
                     thisData = {};
                 };
                 this.setState({
-                    patentInfoData: thisData
+                    patentInfoData: thisData,
+                    stepList: this.state.stepList
                 });
             }.bind(this),
         });
     },
     componentWillReceiveProps(nextProps) {
         if (nextProps.data && nextProps.data.pid !== null && !this.state.visible && nextProps.showDesc) {
-            this.getStepList(nextProps.data.pid);
+            this.state.stepList = getStepList(nextProps.data.pid, '/techservice/patent/patentProcess');
             this.getPatentInfo(nextProps.data.pid);
         };
         this.state.visible = nextProps.showDesc;

+ 42 - 21
js/component/dataDic.js

@@ -343,7 +343,7 @@ module.exports = {
                 areaList: ['市辖区', '北湖区', '苏仙区', '桂阳县', '宜章县', '永兴县', '嘉禾县', '临武县', '汝城县', '桂东县', '安仁县', '资兴市']
             }, {
                 name: '永州市',
-                areaList: ['市辖区', '芝山区', '冷水滩区', '祁阳县', '东安县', '双牌县', '道 县', '江永县', '宁远县', '蓝山县', '新田县', '江华瑶族自治县']
+                areaList: ['市辖区', '零陵区', '冷水滩区', '祁阳县', '东安县', '双牌县', '道 县', '江永县', '宁远县', '蓝山县', '新田县', '江华瑶族自治县']
             }, {
                 name: '怀化市',
                 areaList: ['市辖区', '鹤城区', '中方县', '沅陵县', '辰溪县', '溆浦县', '会同县', '麻阳苗族自治县', '新晃侗族自治县', '芷江侗族自治县', '靖州苗族侗族自治县', '通道侗族自治县', '洪江市']
@@ -2914,10 +2914,10 @@ module.exports = {
         }, {
             value: "12",
             key: "发证"
-        }, {
+        },{
             value: "13",
             key: "已结款"
-        }, {
+        },{
             value: "14",
             key: "撤销"
         }],
@@ -4216,27 +4216,39 @@ module.exports = {
             key: "申请"
         },{
             value: "1",
+            key: "签单"
+        },,{
+            value: "2",
+            key: "派单"
+        },,{
+            value: "3",
+            key: "流转"
+        },{
+            value: "4",
             key: "准备材料"
         },{
-            value: "2",
+            value: "5",
             key: "提交国家系统"
         },{
-            value: "3",
+            value: "6",
             key: "审批通过"
         },{
-            value: "4",
+            value: "7",
             key: "审批不通过"
         },{
-            value: "5",
+            value: "8",
             key: "已发证"
         },{
-            value: "6",
+            value: "9",
             key: "已到期"
         },{
-            value: "7",
+            value: "10",
             key: "培育中"
         },{
-            value: "8",
+            value: "11",
+            key: "已结款"
+        },{
+            value: "12",
             key: "撤销"
         }
     ],
@@ -4253,18 +4265,18 @@ module.exports = {
         },{
             value: "3",
             key: "流转"
-        },{
+        }, {
             value: "4",
-            key: "材料提交"
+            key: "受理"
         },{
             value: "5",
-            key: "受理"
+            key: "审批通过"
         },{
             value: "6",
-            key: "审批通过"
+            key: "审批通过"
         },{
             value: "7",
-            key: "审批不通过"
+            key: "项目批复"
         },{
             value: "8",
             key: "已结款"
@@ -4275,28 +4287,37 @@ module.exports = {
     ],
     copyrightStateList:[
         {
-            value: "1",
+            value: "0",
             key: "创建"
         },{
+            value: "1",
+            key: "签单"
+        },{
             value: "2",
             key: "派单"
         },{
             value: "3",
+            key: "流转"
+        }, {
+            value: "4",
             key: "材料提交"
         },{
-            value: "4",
+            value: "5",
             key: "受理"
         },{
-            value: "5",
+            value: "6",
             key: "补正"
         },{
-            value: "6",
+            value: "7",
             key: "驳回"
         },{
-            value: "7",
+            value: "8",
             key: "已下证"
         },{
-            value: "8",
+            value: "9",
+            key: "已结款"
+        },{
+            value: "10",
             key: "撤销"
         }
     ],

+ 6 - 4
js/component/manageCenter/servicesManage/copyright/copyright.jsx

@@ -332,6 +332,8 @@ const copyright = React.createClass({
     reset() {
         this.state.province = undefined;
         this.state.unitName = undefined;
+        this.state.copyrightName = undefined;
+        thiss.state.status = undefined;
         this.state.createTime = [];
         this.state.acceptTime = [];
         this.state.authTime = [];
@@ -362,7 +364,7 @@ const copyright = React.createClass({
                     </div>
                     <div className="foster-query">
                         <Select placeholder="选择省份"
-                            style={{ width: 200 }}
+                            style={{ width: 100 }}
                             value={this.state.province}
                             showSearch
                             filterOption={companySearch}
@@ -377,15 +379,15 @@ const copyright = React.createClass({
                             onChange={(e) => { this.setState({ unitName: e }) }}>
                             {this.state.companyOption}
                         </Select>
-                        <Input style={{ width: '160px' }}
+                        <Input style={{ width: 160 }}
                             placeholder="请输入软著名称"
                             value={this.state.copyrightName}
                             onChange={(e) => { this.setState({ copyrightName: e.target.value }); }} />
-                        <Select style={{ width: '160px' }}
+                        <Select style={{ width: 120 }}
                             value={this.state.status}
                             onChange={(e) => { this.setState({ status: e }) }}
                             placeholder="选择一个状态">{this.state.stateOption}</Select>
-                        <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
+                        <span>更多搜索  <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                         <Button type="primary" onClick={this.search}>搜索</Button>
                         <Button onClick={this.reset}>重置</Button>
                         <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}

+ 8 - 20
js/component/manageCenter/servicesManage/copyright/copyright.less

@@ -2,8 +2,7 @@
     padding: 20px;
     background: #fff;
     .content-title {
-        height: 32px;
-        margin-bottom: 10px;
+        line-height: 32px;
         >span {
             color: #333;
             font-size: 16px;
@@ -12,23 +11,12 @@
     }
     .foster-query {
         margin-bottom: 10px;
-        >input {
-            width: 180px;
+        >* {
+            margin-top: 10px;
             margin-right: 20px;
         }
-        >div {
-            margin-right: 20px;
-        }
-        button {
-            margin-left: 20px;
-        }
-        >span {
-            margin-left: 20px;
-            >span {
-                margin-left: 10px;
-            }
-        }
         .search-more {
+            margin-top: 0;
             >span {
                 margin-top: 10px;
                 margin-right: 10px;
@@ -36,6 +24,7 @@
         }
     }
 }
+
 .patent-addNew {
     float: right;
     margin-left: 20px;
@@ -47,7 +36,7 @@
         padding: 6px 10px;
         margin-left: 20px;
     }
-    button:hover{
+    button:hover {
         background: #ea0862;
     }
 }
@@ -120,8 +109,7 @@
 
 .ant-modal-content {
     .ant-modal-header {
-        padding: 10px 16px;
-        //background: #2d2d2d;
+        padding: 10px 16px; //background: #2d2d2d;
         .ant-modal-title {
             //color: #fff;
             font-size: 16px;
@@ -270,4 +258,4 @@
             }
         }
     }
-}
+}

+ 46 - 12
js/component/manageCenter/servicesManage/patent/comPatentDesc.jsx

@@ -1,7 +1,8 @@
 import React from 'react';
-import { Icon, Modal, message, Spin, Steps, Input, Select, Upload, DatePicker, Button } from 'antd';
+import { Icon, Modal, message, Spin, Steps, Input, Select, Upload, DatePicker, Button, Table } from 'antd';
 import './comprehensive.less';
 import ajax from 'jquery/src/ajax/xhr.js';
+import moment from 'moment';
 import $ from 'jquery/src/ajax';
 import { patentTypeList, patentFieldList, patentStateList } from '../../../dataDic.js';
 import { getBase64, beforeUpload, getPatentState, getTime, newDownloadFile } from '../../../tools.js';
@@ -54,7 +55,29 @@ const PatentDesc = React.createClass({
             patentFieldOption: [],
             patentStateOption: [],
             adminOption: [],
-            patentProcessList: []
+            stateTable: [],
+            stateColumns: [{
+                title: '申请状态',
+                dataIndex: 'status',
+                key: 'status',
+                render: (text) => { return getPatentState(text) }
+            }, {
+                title: '处理时间',
+                dataIndex: 'recordTimeFormattedDate',
+                key: 'recordTimeFormattedDate',
+            }, {
+                title: '负责人',
+                dataIndex: 'principal',
+                key: 'principal',
+            }, {
+                title: '操作人',
+                dataIndex: 'operator',
+                key: 'operator',
+            }, {
+                title: '备注',
+                dataIndex: 'comment',
+                key: 'comment',
+            }]
         };
     },
     loadData() {
@@ -162,7 +185,8 @@ const PatentDesc = React.createClass({
                 "pState": this.props.data.patentState,
                 "state": this.state.patentStateAdd,
                 "recordTimeFormattedDate": this.state.recordTime,
-                "principal": this.state.adminName
+                "principal": this.state.adminName,
+                "comment": this.state.comment
             }
         }).done(function (data) {
             if (!data.error.length) {
@@ -192,11 +216,11 @@ const PatentDesc = React.createClass({
         this.getOption();
     },
     componentWillReceiveProps(nextProps) {
-        this.state.patentStateAdd = '';
-        this.state.adminName = '';
-        this.state.recordTime = '';
+        this.state.patentStateAdd = undefined;
+        this.state.adminName = undefined;
+        this.state.recordTime = undefined;
+        this.state.comment = undefined;
         this.state.adminOption = [];
-        this.state.patentProcessList = [];
         if (nextProps.data && !this.state.visible && nextProps.showDesc) {
             this.state.xid = nextProps.data.pid;
             this.state.patentDes = nextProps.data.patentDes;
@@ -330,22 +354,32 @@ const PatentDesc = React.createClass({
                                 <Avatar urlData={this.getPatentCertificateUrl} name='patent_certificate' uid={theData.uid}/>
                             </div>
                             <div className="avatar-text"><span>专利稿件上传</span><span>授权通知书上传</span><span>专利证书上传</span></div>
-                            <div>
+                            <div className="clearfix">
                                 <p>专利状态流转记录:</p>
-                                {this.state.patentProcessList}
+                                <Table 
+                                    style={{ margin: '10px 0' }}
+                                    pagination={false}
+                                    dataSource={this.state.stateTable}  
+                                    columns={this.state.stateColumns} />
                                 <div className="widthThird">
                                     <span>状态流转:</span>
-                                    <Select value={this.state.patentStateAdd} style={{ width: 150 }} onChange={(e) => { this.setState({ patentStateAdd: e }); } }>{this.state.patentStateOption}</Select>
+                                    <Select placeholder='请选择状态' value={this.state.patentStateAdd} style={{ width: 150 }} onChange={(e) => { this.setState({ patentStateAdd: e }); } }>{this.state.patentStateOption}</Select>
                                 </div>
                                 <p className="widthThird">
                                     <span>处理时间:</span>
-                                    <DatePicker defaultValue={null} onChange={(data,dataString)=>{this.state.recordTime = dataString}}/>
+                                    <DatePicker 
+                                    value={this.state.recordTime ? moment(this.state.recordTime) : undefined} 
+                                    onChange={(data,dataString)=>{this.setState({recordTime : dataString});}}/>
                                 </p>
                                 <div className="widthThird">
                                     <span>负责人:</span>
-                                    <Select value={this.state.adminName} style={{ width: 150 }} onChange={(e) => { this.setState({ adminName: e }); } }>{this.state.adminOption}</Select>
+                                    <Select placeholder='请填写负责人' value={this.state.adminName} style={{ width: 150 }} onChange={(e) => { this.setState({ adminName: e }); } }>{this.state.adminOption}</Select>
                                 </div>
                             </div>
+                            <div>
+                                <span>备注:</span>
+                                <Input value={this.state.comment} placeholder='请填写备注' style={{ width: 400 }} onChange={(e)=>{this.setState({comment : e.target.value});}}/>
+                            </div>
                         </Modal>
                     </Spin>
                 </div>

+ 63 - 0
js/component/manageCenter/set/content.jsx

@@ -0,0 +1,63 @@
+import React, { Component } from 'react';
+import '../content.less';
+import './content.less';
+import LeftTab from './leftTab';
+
+
+class Content extends Component {
+    constructor() {
+        super();
+        this.state = {
+            loading: false,
+            component: <div />,
+        };
+    }
+    componentWillMount() {
+        if (window.location.hash) {
+            this.getKey(window.location.hash.substr(1));
+        } else {
+            this.getKey('member');
+        };
+    }
+    getKey(key) {
+        switch (key) {
+            case 'member':
+                require.ensure([], () => {
+                    const Member = require('./member').default;
+                    this.setState({
+                        component: <Member />,
+                    });
+                });
+                break;
+            case 'permission':
+                require.ensure([], () => {
+                    const Permission = require('./permission').default;
+                    this.setState({
+                        component: <Permission />,
+                    });
+                });
+                break;
+            case 'role':
+                require.ensure([], () => {
+                    const Role = require('./role').default;
+                    this.setState({
+                        component: <Role />,
+                    });
+                });
+                break;
+        };
+        window.location.hash = key;
+    }
+    render() {
+        return (
+            <div className="manage-content">
+                <LeftTab handlekey={this.getKey.bind(this)} />
+                <div className="content-right">
+                    {this.state.component}
+                </div>
+            </div>
+        )
+    }
+}
+
+export default Content;

+ 16 - 0
js/component/manageCenter/set/content.less

@@ -0,0 +1,16 @@
+.set-content {
+    background: #fff;
+    padding: 20px;
+    .set-title {
+        >span {
+            font-size: 16px;
+            color: #333;
+        }
+        >button {
+            float: right;
+        }
+    }
+    .member-table {
+        margin-top: 20px;
+    }
+}

+ 46 - 0
js/component/manageCenter/set/leftTab.jsx

@@ -0,0 +1,46 @@
+import React from 'react';
+import { Menu, Icon } from 'antd';
+import '../leftTab.less';
+const SubMenu = Menu.SubMenu;
+const MenuItemGroup = Menu.ItemGroup;
+
+
+const LeftTab = React.createClass({
+    getInitialState() {
+        return {
+            current: 'userList',
+        };
+    },
+    handleClick(e) {
+        this.props.handlekey(e.key);
+        this.setState({
+            current: e.key,
+        });
+    },
+    componentWillMount(){
+        if ( window.location.hash ) {
+            this.state.current = window.location.hash.substr(1);
+        };
+    },
+    render() {
+        return (
+            <Menu onClick={this.handleClick}
+                selectedKeys={[this.state.current]}
+                mode="vertical"
+                className="account-left"
+                >
+                <Menu.Item key="member">
+                    管理员列表
+                </Menu.Item>
+                <Menu.Item key="permission">
+                    权限控制
+                </Menu.Item>
+                <Menu.Item key="role">
+                    角色控制
+                </Menu.Item>
+            </Menu>
+        );
+    },
+});
+
+export default LeftTab;

+ 179 - 0
js/component/manageCenter/set/member.jsx

@@ -0,0 +1,179 @@
+import React from 'react';
+import { Table, Button, Spin, message, Popconfirm, Icon } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+import TheModal from './modal.jsx';
+
+const Member = React.createClass({
+    loadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        return $.ajax({
+            type: 'get',
+            cache: false,
+            url: globalConfig.context + "/api/admin/adminList",
+            dataType: "json",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize
+            },
+            success: function (data) {
+                if (!data.data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    return;
+                };
+                for (let i = 0; i < data.data.list.length; i++) {
+                    let thisdata = data.data.list[i];
+                    this.state.data.push({
+                        key: i,
+                        id: thisdata.id,
+                        mobile: thisdata.mobile,
+                        name: thisdata.name,
+                        email: thisdata.email,
+                        createTime: thisdata.createTime,
+                        number: thisdata.number,
+                        province: thisdata.province,
+                        createTimeFormattedDate: thisdata.createTimeFormattedDate
+                    });
+                };
+                this.state.pagination.current = data.data.pageNo;
+                this.state.pagination.total = data.data.totalCount;
+                this.setState({
+                    data: this.state.data,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            data: [],
+            dataSource: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            modalData: {},
+            modalShow: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            }
+        }
+    },
+    componentDidMount() {
+        this.loadData();
+    },
+    addNew() {
+        let e = {}
+        this.setState({
+            modalData: e,
+            modalShow: true
+        })
+    },
+    edit(e) {
+        this.setState({
+            modalData: e,
+            modalShow: true
+        })
+    },
+    handleReturn(show, render) {
+        this.state.modalShow = show;
+        if (render) {
+            this.loadData();
+        }
+    },
+    resetPwd(e) {
+        this.setState({
+            loading: true
+        })
+        $.ajax({
+            type: 'post',
+            url: globalConfig.context + "/api/user/reset",
+            dataType: "json",
+            data: {
+                id: e.id
+            }
+        }).done((res) => {
+            if (res.error.length) {
+                message.error(res.error[0].message);
+            } else {
+                message.success("密码重置成功");
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            })
+        });
+    },
+    render() {
+        const columns = [{
+            title: '编号',
+            dataIndex: 'id',
+            key: 'id'
+        }, {
+            title: '登录账号',
+            dataIndex: 'mobile',
+            key: 'mobile'
+        }, {
+            title: '名字',
+            dataIndex: 'name',
+            key: 'name'
+        }, {
+            title: '省份',
+            dataIndex: 'province',
+            key: 'province'
+        }, {
+            title: '邮箱',
+            dataIndex: 'email',
+            key: 'email'
+        }, {
+            title: '创建时间',
+            dataIndex: 'createTimeFormattedDate',
+            key: 'createTimeFormattedDate'
+        }, {
+            title: '操作',
+            dataIndex: 'act',
+            key: 'act',
+            render: (text, record, index) => {
+                return <Popconfirm title={"用户" + record.name + "的密码将会重置为123456,确认操作?"} onConfirm={this.resetPwd.bind(null, record)} okText="确认" cancelText="取消" placement="topRight">
+                    <Button>重置密码</Button>
+                </Popconfirm>
+            },
+            width: '15%'
+        }];
+        return (
+            <Spin spinning={this.state.loading}>
+                <div className="set-content">
+                    <div className="set-title">
+                        <span>管理员设置</span>
+                        <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
+                            onClick={this.addNew}>添加<Icon type="plus" /></Button>
+                    </div>
+                    <TheModal data={this.state.modalData} show={this.state.modalShow} handleReturn={this.handleReturn} />
+                    <Table className='member-table'
+                        columns={columns}
+                        onRowClick={this.edit}
+                        dataSource={this.state.data}
+                        pagination={this.state.pagination} />
+                </div>
+            </Spin>
+        );
+    }
+});
+export default Member;

+ 164 - 0
js/component/manageCenter/set/modal.jsx

@@ -0,0 +1,164 @@
+import React from 'react';
+import { Modal, Input, Spin, Switch, Select, Message } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+
+export default class TheModal extends React.Component {
+    postData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            type: "POST",
+            url: this.state.id ? globalConfig.context + "/api/user/update" : globalConfig.context + "/api/user/create",
+            data: {
+                'id': this.state.id,
+                'name': this.state.name,
+                'email': this.state.email,
+                'mobile': this.state.mobile,
+                'status': this.state.status ? 1 : 0,
+                'roles': this.state.bindroles,
+                'rooms': this.state.bindrooms
+            }
+        }).done((res) => {
+            if (res.error.length) {
+                Message.error(res.error[0].message);
+            } else {
+                Message.success("保存成功");
+                this.setState({
+                    visible: false,
+                });
+                this.props.handleReturn(false, true);
+                //第二个参数表示保存
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            })
+        })
+        this.props.postData;
+    }
+    constructor(props) {
+        super(props);
+        this.state = {
+            name: '',
+            email: '',
+            mobile: '',
+            rooms: [],
+            roles: [],
+            visible: false,
+            loading: false,
+            bindrooms: [],
+            bindroles: []
+        }
+    }
+    handleCancel() {
+        this.setState({
+            visible: false,
+        });
+        this.props.handleReturn(false, false);
+    }
+    loadInitialData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/admin/roles',
+            cache: false
+        }).done((rolesres) => {
+            this.setState({
+                roles: rolesres.data,
+                loading: false
+            });
+        })
+    }
+    componentWillReceiveProps(nextProps) {
+        if (nextProps.show && !this.state.roles.length) {
+            this.loadInitialData();
+        }
+        let nextState = {
+            visible: nextProps.show,
+            id: nextProps.data ? nextProps.data.id : '',
+            name: nextProps.data ? nextProps.data.name : '',
+            email: nextProps.data ? nextProps.data.email : '',
+            mobile: nextProps.data ? nextProps.data.mobile : '',
+            bindroles: nextProps.data && nextProps.data.roles ? nextProps.data.roles.map((role) => { return String(role.id); }) : []
+        };
+        this.setState(nextState)
+    }
+
+    getRolesSelection() {
+        if (this.state.id > 1) {
+            return <li>
+                <span className='modal-text'>角色</span>
+                <Select
+                    multiple
+                    style={{ width: '90%' }}
+                    placeholder="选择用户关联角色"
+                    value={this.state.bindroles}
+                    onChange={this.bindRoles.bind(this)}
+                >
+                    {this.getRolesOptions()}
+                </Select>
+            </li>
+        } else if (this.state.id === 1) {
+            return <li><span className='modal-text'>角色</span><span>系统管理员</span></li>
+        }
+    }
+
+
+    bindRoles(val) {
+        this.setState({
+            bindroles: val
+        });
+    }
+
+
+    getRolesOptions() {
+        let options = [];
+        for (let i = 0; i < this.state.roles.length; i++) {
+            options.push(<Option key={String(this.state.roles[i].id)}>{this.state.roles[i].name}</Option>);
+        }
+        return options;
+    }
+
+    render() {
+        const Option = Select.Option;
+        return (
+            <div className="modal" >
+                <Spin spinning={this.state.loading} >
+                    <Modal title="用户编辑"
+                        closable={false}
+                        visible={this.state.visible}
+                        onOk={this.postData.bind(this)}
+                        onCancel={this.handleCancel.bind(this)}
+                    >
+                        <ul className="modal-content">
+                            <li>
+                                <span className='modal-text'>名字</span>
+                                <Input value={this.state.name} onChange={(e) => { this.state.name = e.target.value; this.setState({ name: this.state.name }); }} />
+                            </li>
+                            <li>
+                                <span className='modal-text'>登录账号</span>
+                                <Input value={this.state.mobile} onChange={(e) => { this.state.mobile = e.target.value; this.setState({ mobile: this.state.mobile }); }} />
+                            </li>
+                            <li>
+                                <span className='modal-text'>省份</span>
+                                <Input value={this.state.email} onChange={(e) => { this.state.email = e.target.value; this.setState({ email: this.state.email }); }} />
+                            </li>
+                            <li>
+                                <span className='modal-text'>邮箱</span>
+                                <Input value={this.state.email} onChange={(e) => { this.state.email = e.target.value; this.setState({ email: this.state.email }); }} />
+                            </li>
+                            <li>
+                                <span className='modal-text'>状态</span>
+                                <Switch disabled={this.state.id == 1} checked={this.state.status == 1 ? true : false} onChange={(e) => { this.setState({ status: e }) }} />
+                            </li>
+                            {this.getRolesSelection()}
+                        </ul>
+                    </Modal>
+                </Spin>
+            </div >
+        );
+    }
+}

+ 160 - 0
js/component/manageCenter/set/permission.jsx

@@ -0,0 +1,160 @@
+import React from 'react';
+import { Table, Button, Input, Spin, Message } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+
+export default class Permission extends React.Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            data: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false
+        }
+    }
+
+    componentDidMount() {
+        this.loadData();
+    }
+
+    loadData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/permissions',
+            method: 'get',
+            cache: false
+        }).done((res) => {
+            if (!res.error.length) {
+                this.setState({
+                    data: res.data
+                })
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        });
+    }
+
+    save() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/permission',
+            method: 'post',
+            data: {
+                data: JSON.stringify(this.state.data)
+            }
+        }).done((res) => {
+            if (!res.error.length) {
+                Message.success("保存成功");
+                this.loadData();
+            } else {
+                Message.error(res.error[0].message);
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        })
+    }
+
+    remove() {
+        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.state.selectedRowKeys.sort((a, b) => { return b - a });
+        for (let idx = 0; idx < this.state.selectedRowKeys.length; idx++) {
+            let dataIndex = this.state.selectedRowKeys[idx];
+            this.state.data.splice(dataIndex, 1);
+        }
+        this.setState({
+            data: this.state.data,
+            selectedRowKeys: [],
+            loading: deletedIds.length > 0
+        });
+        if (deletedIds.length) {
+            $.ajax({
+                url: globalConfig.context + '/api/permission/delete',
+                method: 'post',
+                data: {
+                    data: JSON.stringify(deletedIds)
+                }
+            }).done((res) => {
+                if (!res.error.length) {
+                    Message.success("删除成功");
+                } else {
+                    Message.error(res.error[0].message);
+                }
+            }).always(() => {
+                this.setState({
+                    loading: false
+                });
+            })
+        }
+    }
+
+    addNew() {
+        this.state.data.push({
+            id: '',
+            name: '',
+            url: ''
+        });
+        this.setState({
+            data: this.state.data
+        })
+    }
+
+    render() {
+        const columns = [{
+            title: 'id',
+            dataIndex: 'id',
+            key: 'id',
+            width: '10%'
+        }, {
+            title: '权限名字',
+            dataIndex: 'name',
+            key: 'name',
+            render: (text, record, index) => {
+                return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ data: this.state.data }); }} />
+            },
+            width: '40%'
+        }, {
+            title: '接口路径',
+            dataIndex: 'url',
+            key: 'url',
+            render: (text, record, index) => {
+                return <Input value={record.url} onChange={(e) => { record.url = e.target.value; this.setState({ data: this.state.data }); }} />
+            },
+            width: '50%'
+        }];
+        const rowSelection = {
+            type: 'checkbox',
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows,
+                    selectedRowKeys: selectedRowKeys
+                });
+            }
+        }
+        return (
+            <Spin spinning={this.state.loading}>
+                <div>
+                    <Button type="primary" onClick={this.save.bind(this)}>保存修改</Button>
+                    <Button onClick={this.addNew.bind(this)}>新增</Button>
+                    <Button onClick={this.remove.bind(this)}>删除选中</Button>
+                </div>
+                <Table columns={columns} dataSource={this.state.data} pagination={false} scroll={{ y: 450 }} rowSelection={rowSelection} />
+            </Spin>
+        );
+    }
+};

+ 259 - 0
js/component/manageCenter/set/role.jsx

@@ -0,0 +1,259 @@
+import React from 'react';
+import { Table, Button, Input, Spin, Message, Select, Modal, Tag } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+
+export default class Role extends React.Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            visible: false,
+            disabled: false,
+            name: '',
+            selectOption: [],
+            data: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            permissions: {
+
+            },
+            modelRecord: {
+                id: '',
+                name: '',
+                permissions: []
+            }
+        }
+    }
+
+    componentWillMount() {
+        this.loadData();
+    }
+
+    loadData() {
+        let _me = this;
+        this.setState({
+            loading: true
+        });
+        $.when($.ajax({
+            url: globalConfig.context + '/api/roles',
+            method: 'get',
+            cache: false
+        }), $.ajax({
+            url: globalConfig.context + '/api/permissions',
+            method: 'get',
+            cache: false
+        })).done((roles, permissions) => {
+            if (!roles[0].error.length && roles[0].data) {
+                this.state.data = [];
+                for (let i = 0; i < roles[0].data.length; i++) {
+                    let thisdata = roles[0].data[i];
+                    this.state.data.push({
+                        key: i,
+                        id: thisdata.id,
+                        name: thisdata.name,
+                        permissions: thisdata.permissions.map((p) => { return String(p.id) }) || []
+                    });
+                };
+            }
+            if (!permissions[0].error.length && permissions[0].data) {
+                _me.state.selectOption = [];
+                permissions[0].data.map(function (item) {
+                    _me.state.selectOption.push(
+                        <Select.Option key={item.id}>{item.name}</Select.Option>
+                    )
+                    _me.state.permissions[String(item.id)] = item.name;
+                });
+            }
+        }).always(() => {
+            this.setState({
+                loading: false
+            });
+        });
+    }
+
+    save() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + '/api/role',
+            method: 'post',
+            data: { data: JSON.stringify(this.state.modelRecord) },
+        }).done((res) => {
+            if (!res.error.length) {
+                Message.success("保存成功");
+                this.loadData();
+            } else {
+                Message.error(res.error[0].message);
+            }
+        }).always(() => {
+            this.setState({
+                loading: false,
+                visible: false,
+                disabled: false
+            });
+        })
+    }
+
+    remove() {
+        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.state.selectedRowKeys.sort((a, b) => { return b - a });
+        for (let idx = 0; idx < this.state.selectedRowKeys.length; idx++) {
+            let dataIndex = this.state.selectedRowKeys[idx];
+            this.state.data.splice(dataIndex, 1);
+        }
+        this.setState({
+            data: this.state.data,
+            selectedRowKeys: [],
+            loading: deletedIds.length > 0
+        });
+        if (deletedIds.length) {
+            $.ajax({
+                url: globalConfig.context + '/api/role/delete',
+                method: 'post',
+                data: {
+                    data: JSON.stringify(deletedIds)
+                }
+            }).done((res) => {
+                if (!res.error.length) {
+                    Message.success("删除成功");
+                } else {
+                    Message.error(res.error[0].message);
+                }
+            }).always(() => {
+                this.setState({
+                    loading: false
+                });
+            })
+        }
+    }
+
+    addNew() {
+        this.setState({
+            visible: true,
+            modelRecord: {
+                id: '',
+                name: '',
+                permissions: []
+            }
+        })
+    }
+
+    edit(e) {
+        this.setState({
+            modelRecord: e,
+            visible: true,
+            disabled: false
+        })
+    }
+
+    handleCancel() {
+        this.setState({
+            visible: false,
+            disabled: false
+        })
+    }
+
+    render() {
+        const columns = [{
+            title: 'ID',
+            dataIndex: 'id',
+            key: 'id',
+            width: '10%'
+        }, {
+            title: '名字',
+            dataIndex: 'name',
+            key: 'name',
+            width: '20%'
+        }, {
+            title: '绑定权限',
+            dataIndex: 'permissions',
+            key: 'permissions',
+            render: (text, record, index) => {
+                let _me = this;
+                return <div>
+                    {record.permissions && record.permissions.map((tag) => {
+                        return <Tag key={tag} closable={false}>
+                            {_me.state.permissions[tag]}
+                        </Tag>
+                    }
+                    )}
+                </div>
+            },
+            width: '60%'
+        }, {
+            title: '操作',
+            dataIndex: 'act',
+            key: 'act',
+            render: (text, record, index) => {
+                return <Button type='primary' onClick={this.edit.bind(this, record)}>编辑</Button>
+            },
+            width: '20%'
+        }];
+        const rowSelection = {
+            type: 'checkbox',
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows,
+                    selectedRowKeys: selectedRowKeys
+                });
+            }
+        }
+        return (
+            <Spin spinning={this.state.loading}>
+                <Modal title="用户编辑"
+                    closable={false}
+                    visible={this.state.visible}
+                    onOk={this.save.bind(this)}
+                    onCancel={this.handleCancel.bind(this)}
+                >
+                    <ul className="modal-content">
+                        <li>
+                            <span className='modal-text'>名字</span>
+                            <Input value={this.state.modelRecord.name} onChange={(e) => {
+                                this.state.modelRecord.name = e.target.value;
+                                this.setState({
+                                    modelRecord: this.state.modelRecord
+                                })
+                            }} />
+                        </li>
+                        <li>
+                            <span className='modal-text'>权限</span>
+                            <Select
+                                multiple
+                                style={{ width: '90%' }}
+                                placeholder="选择绑定权限"
+                                disabled={!this.state.modelRecord.id}
+                                value={this.state.modelRecord.permissions}
+                                onChange={(pids) => {
+                                    let _me = this;
+                                    this.state.modelRecord.permissions = pids;
+                                    this.setState({
+                                        modelRecord: this.state.modelRecord
+                                    })
+                                }}
+                            >
+                                {this.state.selectOption}
+                            </Select>
+                        </li>
+                    </ul>
+                </Modal>
+                <div style={{
+                    marginBottom: '6px'
+                }}>
+                    <Button onClick={this.addNew.bind(this)}>新增</Button>
+                    <Button onClick={this.remove.bind(this)}>删除选中</Button>
+                </div>
+                <Table columns={columns} dataSource={this.state.data} pagination={false} scroll={{ y: 450 }} rowSelection={rowSelection} />
+            </Spin>
+        );
+    }
+};

+ 2 - 1
js/component/manageCenter/topTab.jsx

@@ -38,11 +38,12 @@ const TopTab = React.createClass({
                 </div>
                 <div className="acc-top-tab">
                     <Row>
-                        <Col className={this.props.active === 'set' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/userManage.html"}>用户管理</a></Col>
+                        <Col className={this.props.active === 'userManage' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/userManage.html"}>用户管理</a></Col>
                         <Col className={this.props.active === 'services' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/servicesManage/patent.html"}>科技服务管理</a></Col>
                         <Col className={this.props.active === 'achievement' ? 'active' : ''} span={3}><a href="">科技成果管理</a></Col>
                         <Col className={this.props.active === 'demand' ? 'active' : ''} span={3}><a href="">科技需求管理</a></Col>
                         <Col className={this.props.active === 'idea' ? 'active' : ''} span={3}><a href="">科技思想管理</a></Col>
+                        <Col className={this.props.active === 'set' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/set.html"}>后台设置</a></Col>
                     </Row>
                 </div>
             </div >

+ 111 - 4
js/component/tools.js

@@ -1,6 +1,7 @@
-import {
-    message
-} from 'antd';
+import { message,Timeline,Select  } from 'antd';
+import React from 'react';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
 import {
     provinceList,
     patentTypeList,
@@ -17,7 +18,6 @@ import {
     copyrightStateList,
     vocations
 } from './dataDic.js';
-
 module.exports = {
     addressInit: function (_cmbProvince, _cmbCity, _cmbArea, defaultProvince, defaultCity, defaultArea) {
         var cmbProvince = document.getElementById(_cmbProvince);
@@ -336,5 +336,112 @@ module.exports = {
             day = (day > 9 ? "" : "0") + day;
             return year + month + day;
         }
+    },
+    getStepList(pid,url) {
+        let stepList = [];
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            cache: false,
+            url: globalConfig.context + url,
+            data: {
+                pid: pid
+            },
+            success: function (data) {
+                if (!data.data) {
+                    if (data.error && data.error.length ) {
+                        return;
+                    };
+                };
+                for (var item in data.data) {
+                    stepList.push(
+                        <Timeline.Item key={item}> 
+                            <span>{module.exports.getPatentState(data.data[item].state)}</span> 
+                            {module.exports.getTime(data.data[item].recordTime)} 
+                        </Timeline.Item>
+                    )
+                };
+            }.bind(this),
+        });
+        return stepList;
+    },
+
+
+    //各种通过接口获取下拉列表
+
+    setPatentStateOption(type) {
+        let theArr = [];
+        const caiwu = ['1', '3', '13'];
+        const xiaoshou = [];
+        switch (type) {
+            case 'caiwu':
+                patentStateList.map(function (item) {
+                    for (let i = 0; i < caiwu.length; i++) {
+                        if (item.value == caiwu[i]) {
+                            theArr.push()
+                        };
+                    };
+                });
+                return theArr;
+            case 'caiwu':
+                patentStateList.map(function (item) {
+                    for (let i = 0; i < caiwu.length; i++) {
+                        if (item.value == caiwu[i]) {
+                            theArr.push()
+                        };
+                    };
+                });
+                return theArr;
+        }
+    },
+    setUserContactsList(){
+        let theOption = [];
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/user/getContacts',
+            success: function (data) {
+                if (!data.data) {
+                    if ( data.error && data.error.length ) {
+                        message.warning(data.error[0].message);
+                    };
+                    return;
+                };
+                for (let item in data.data) {
+                    let theData = data.data[item];
+                    theOption.push(
+                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                    );
+                };
+            }
+        });
+        return theOption;
+    },
+    setAdminContactsList(uid){
+        let theOption = [];
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/getContacts',
+            data:{ "uid": uid },
+            success: function (data) {
+                if (!data.data) {
+                    if ( data.error && data.error.length ) {
+                        message.warning(data.error[0].message);
+                    };
+                    return;
+                };
+                for (let item in data.data) {
+                    let theData = data.data[item];
+                    theOption.push(
+                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                    );
+                };
+            }
+        });
+        return theOption;
     }
 }

+ 7 - 0
webpack.config.js

@@ -120,6 +120,13 @@ module.exports = (function () {
             filename: 'admin/servicesManage/technology.html',
             template: './template/template.html',
             chunks: ['admin/servicesManage/technology', 'vendors']
+        }),
+        //admin-set
+        new HtmlWebpackPlugin({
+            title: '管理员-用户管理',
+            filename: 'admin/set.html',
+            template: './template/template.html',
+            chunks: ['admin/set', 'vendors']
         })
     ];
     if (!isDev) {