liting2017 6 years ago
parent
commit
5d256487a2
36 changed files with 3209 additions and 666 deletions
  1. 15 0
      js/admin/bottom.jsx
  2. 11 0
      js/admin/bottom.less
  3. 80 0
      js/admin/content.less
  4. 24 0
      js/admin/index.js
  5. 23 0
      js/admin/index/content.jsx
  6. 179 0
      js/admin/index/content.less
  7. 138 0
      js/admin/index/leftMenu.jsx
  8. 48 0
      js/admin/leftTab.less
  9. 13 0
      js/admin/menu.jsx
  10. 59 0
      js/admin/topTab.jsx
  11. 100 0
      js/admin/topTab.less
  12. 27 64
      js/component/account/demand/demandDesc.jsx
  13. 268 0
      js/component/account/demand/demandDetaiel.jsx
  14. 363 361
      js/component/account/demand/demandForm.jsx
  15. 18 26
      js/component/account/demand/techDemand.jsx
  16. 3 0
      js/component/account/demand/techDemand.less
  17. 0 1
      js/component/account/index/content.jsx
  18. 9 9
      js/component/account/index/leftMenu.jsx
  19. 1 1
      js/component/account/menu.jsx
  20. 31 20
      js/component/account/setAccount/account.jsx
  21. 51 91
      js/component/account/setAccount/contacts.jsx
  22. 7 51
      js/component/account/setAccount/personal.jsx
  23. 8 23
      js/component/account/setAccount/unit.jsx
  24. 356 0
      js/component/adminDemand/DemandExamine.jsx
  25. 72 0
      js/component/adminDemand/demandDesc.jsx
  26. 268 0
      js/component/adminDemand/demandDetaiel.jsx
  27. 450 0
      js/component/adminDemand/demandForm.jsx
  28. 356 0
      js/component/adminDemand/techDemand.jsx
  29. 98 0
      js/component/adminDemand/techDemand.less
  30. 46 5
      js/component/dataDic.js
  31. 32 2
      js/component/tools.js
  32. 16 0
      js/user/adminLogin.js
  33. 2 2
      package.json
  34. 1 1
      webpack-dll.config.js
  35. 19 4
      webpack.config.js
  36. 17 5
      webpack/entry.config.js

+ 15 - 0
js/admin/bottom.jsx

@@ -0,0 +1,15 @@
+import React from 'react';
+import './bottom.less';
+
+const Bottom = React.createClass({
+    render() {
+        return (
+            <div className="account-bottom">
+                <p>阿凡提科技</p>
+                <p>技术支持@阿凡提</p>
+            </div>
+        )
+    }
+});
+
+export default Bottom;

+ 11 - 0
js/admin/bottom.less

@@ -0,0 +1,11 @@
+    .account-bottom {
+        width: 100%;
+        color: #d5e4f7;
+        background: #212831;
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        z-index: 1;
+        text-align: center;
+        padding: 6px 0;
+    }

+ 80 - 0
js/admin/content.less

@@ -0,0 +1,80 @@
+.acc-content {
+    height: 100%;
+    width: 100%;
+    padding-bottom: 40px;
+    background: #f0f0f0;
+    .content-right {
+        width: 84%;
+        height: 100%;
+        float: left;
+        overflow-y: auto;
+        padding: 20px;
+        .ant-spin-nested-loading {
+            height: 100%;
+            .ant-spin-container {
+                height: 100%;
+            }
+        }
+    }
+    .loading-container {
+        text-align: center;
+        margin-bottom: 20px;
+        padding: 30px 50px;
+        margin: 20px 0;
+    }
+    .content-container {
+        background: #FFF;
+        padding: 20px;
+    }
+    .content-title {
+        color: #333;
+        font-size: 16px;
+        padding: 0 0 10px 0;
+    }
+    .content-body {
+        min-height: 400px;
+    }
+    .content-search {
+        margin-bottom: 6px;
+    }
+    .content-actions {
+        float: right;
+        margin-right: 20px;
+    }
+}
+#content{
+    box-sizing: border-box;
+    padding: 10px 10px 50px;
+    background: #ccc;
+    .contact-wrap{
+        padding: 0;
+        margin: 10px!important;
+        
+    }
+}
+.ant-modal-body {
+    .half-item {
+        float: left;
+        width: 50%;
+        margin-bottom: 10px;
+    }
+    .third-item {
+        float: left;
+        width: 33%;
+        margin-bottom: 10px;
+        >p {
+            line-height: 30px;
+        }
+    }
+    .item-title {
+        line-height: 30px;
+        font-size: 14px;
+        color: #666;
+        min-width: 100px;
+        display: inline-block;
+    }
+    .form-title {
+        font-size: 16px;
+        color: #333;
+    }
+}

+ 24 - 0
js/admin/index.js

@@ -0,0 +1,24 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import '../../css/base.less';
+
+import TopTab from './topTab.jsx';
+import Footers from './bottom.jsx';
+import ContentRouter from './index/content.jsx';
+import LeftMenu from './index/leftMenu'
+import { Layout } from 'antd';
+const { Header, Footer, Sider, Content } = Layout;
+
+ReactDOM.render(
+    <div className="wrap clearfix">
+        <Header>
+            <TopTab/>
+        </Header>
+        <Layout>
+            <Sider><LeftMenu /></Sider>
+            <Content><ContentRouter /></Content>
+        </Layout>
+        <Footers />
+    </div>,
+    document.getElementById('root')
+)

+ 23 - 0
js/admin/index/content.jsx

@@ -0,0 +1,23 @@
+//管理员登录区域代码
+import DemandLibrary from '@/adminDemand/techDemand';
+import DemandExamine from '@/adminDemand/demandExamine';
+
+import {hashHistory,Route,Router,IndexRedirect} from 'react-router';
+import {Layout} from 'antd';
+import '@/account/content.less'
+
+
+const { Content } = Layout;
+
+export default class ContentRouter extends React.Component {
+  render() {
+    return (
+      <Content className="acc-content" id="content">
+        <Router history={hashHistory}>
+            <Route path="/library" component={DemandLibrary} />
+            <Route path="/examine" component={DemandExamine} />
+        </Router>
+      </Content>
+    )
+  }
+}

+ 179 - 0
js/admin/index/content.less

@@ -0,0 +1,179 @@
+    @a-color: #ea0862;
+    .index-content {
+        height: 100%;
+        .acc-title {
+            color: #333;
+            font-size: 16px;
+            margin-bottom: 10px;
+            span {
+                font-size: 18px;
+                color: @a-color;
+            }
+            img {
+                vertical-align: top;
+                margin-left: 10px;
+                width: 22px;
+                height: 22px;
+            }
+        }
+        .index-userdata {
+            background: #fff;
+            padding: 20px;
+            .userdata-img {
+                height: 120px;
+                width: 120px;
+                padding-top: 120px;
+                position: relative;
+                overflow: hidden;
+                border-radius: 50%;
+                float: left;
+                background: #eee;
+                img {
+                    height: 120px;
+                    width: 120px;
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                }
+            }
+            .userdata-content {
+                margin-left: 140px;
+                line-height: 30px;
+                position: relative;
+                a {
+                    color: @a-color;
+                }
+                .userdata-lvl {
+                    span {
+                        color: #fff;
+                        background: @a-color;
+                        border-radius: 2px;
+                        padding: 0 4px;
+                    }
+                }
+                .userdata-relate {
+                    button {
+                        border: none;
+                        border-radius: 4px;
+                        margin-top: 20px;
+                        margin-right: 20px;
+                        img {
+                            height: 20px;
+                            vertical-align: middle;
+                        }
+                        span {
+                            color: #fff;
+                        }
+                    }
+                    .relateweixin {
+                        background: #12d41e;
+                    }
+                    .relateqq {
+                        background: #3073c1;
+                    }
+                    .relateweibo {
+                        background: #cf331d;
+                    }
+                }
+                .userdata-follow {
+                    position: absolute;
+                    top: 0;
+                    right: 10px;
+                }
+            }
+        }
+        .index-record {
+            background: #fff;
+            padding: 20px;
+            margin-top: 1px;
+            .record-list {
+                li {
+                    float: left;
+                    width: 200px;
+                    margin-right: 100px;
+                    line-height: 30px;
+                    a {
+                        color: @a-color;
+                    }
+                }
+            }
+        }
+        .index-activity {
+            background: #fff;
+            padding: 20px;
+            margin-top: 20px;
+            min-height: 300px;
+            .activity-list {
+                li {
+                    border-bottom: 1px dashed #eee;
+                    padding: 10px 0;
+                    .list-type {
+                        color: #666
+                    }
+                    .list-title {
+                        color: #333;
+                        margin-left: 10px;
+                    }
+                    a {
+                        padding: 0 4px;
+                        background: @a-color;
+                        color: #fff;
+                        border-radius: 2px;
+                        float: right;
+                        margin: 0 10px;
+                    }
+                    .list-time {
+                        color: #666;
+                        float: right;
+                    }
+                }
+            }
+        }
+    }
+
+    .collection {
+        background: #fff;
+        padding: 20px;
+        .avatar-box {
+            height: 80px;
+            width: 80px;
+            padding-top: 80px;
+            margin: 0 auto;
+            position: relative;
+            img {
+                position: absolute;
+                top: 0;
+                left: 0;
+                height: 80px;
+                width: auto;
+            }
+        }
+        .content-title {
+            color: #333;
+            font-size: 16px;
+        }
+        .user-search {
+            margin: 10px 0;
+            >input {
+                width: 140px;
+            }
+            >input,
+            >button,
+            .ant-select {
+                margin-top: 10px;
+                margin-right: 10px;
+            }
+            .search-div {
+                display: inline-block;
+                margin-top: 10px;
+                margin-right: 10px;
+            }
+        }
+    }
+
+    .modal-box {
+        margin-top: 20px;
+        >button {
+            margin-right: 20px;
+        }
+    }

+ 138 - 0
js/admin/index/leftMenu.jsx

@@ -0,0 +1,138 @@
+import React from 'react';
+import { Menu, Icon, Layout } from 'antd';
+import '@/account/leftTab.less';
+const SubMenu = Menu.SubMenu;
+const MenuItemGroup = Menu.ItemGroup;
+import { Link } from 'react-router';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import { adminMenu } from '../menu';
+import logo from 'img/acc-logo.png';
+const { Sider } = Layout;
+
+const LeftTab = React.createClass({
+	getInitialState() {
+		return {
+			openKeys: [ 'sub1' ],
+			current: 'library',
+			switch: false,
+			rootSubmenuKeys :['sub1', 'sub2','sub3','sub4']
+		};
+	},
+	menuClick(e) {
+		this.setState({
+			current: e.key,
+		});
+		window.location.hash = e.key;
+	},
+	iconFun() {
+		let menuW = document.querySelector('.ant-layout-sider');
+		if (this.state.switch) {
+			menuW.style.width = '200px';
+			menuW.style.flex = '0 0 200px';
+		} else {
+			menuW.style.width = '50px';
+			menuW.style.flex = '0 0 50px';
+		}
+		this.setState({
+			switch: !this.state.switch
+		});
+	},
+	onOpenChange(openKeys){
+		const latestOpenKey = openKeys.find(key => this.state.openKeys.indexOf(key) === -1);
+		if (this.state.rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
+		  this.setState({ openKeys });
+		} else {
+		  this.setState({
+			openKeys: latestOpenKey ? [latestOpenKey] : [],
+		  });
+		}
+	 },
+	componentWillMount() {
+		if (window.location.hash) {
+			let current = window.location.hash.substr(2),
+				open=[];
+			if (!current.length) {
+				window.location.hash = 'library';
+				this.setState({
+					openKeys:['sub1'],
+					current:'library'
+				})
+			}else{
+				adminMenu.map(item=>{
+					if(item.children){
+						item.children.map(atem=>{
+							if(current==atem.url){
+								open.push(item.url)
+								return false;
+							}
+						})
+					}
+				})
+				this.setState({
+					openKeys:open,
+					current
+				});
+			}
+		}else{
+			window.location.hash = 'library';
+			this.setState({
+				openKeys:['sub1'],
+				current:'library'
+			})
+		}
+	},
+	render() {
+		return (
+			<div>
+				<div className="acc-index">
+					{!this.state.switch && <img src={logo} alt="" />}
+					{!this.state.switch && (
+						<span>
+							<a href={globalConfig.context + '/user/account/index.html'}>会员中心管理</a>
+						</span>
+					)}
+					<Icon type={this.state.switch ? 'forward' : 'backward'} className="icon" onClick={this.iconFun} />
+				</div>
+				<Menu
+					onClick={this.menuClick}
+					defaultOpenKeys={this.state.openKeys}
+					selectedKeys={[ this.state.current ]}
+					openKeys={this.state.openKeys}
+       				onOpenChange={this.onOpenChange}
+					mode={this.state.switch ? 'vertical' : 'inline'}
+					theme="light"
+					className="account-left"
+				>
+					{adminMenu.map((subMenu) => {
+						if (subMenu.children && subMenu.children.length) {
+							return (
+								<SubMenu
+									key={subMenu.url}
+									title={
+										<span>
+											<Icon type={subMenu.icon} />
+											{!this.state.switch && <span>{subMenu.name}</span>}
+										</span>
+									}
+								>
+									{subMenu.children.map((menu) => <Menu.Item key={menu.url}>{menu.name}</Menu.Item>)}
+								</SubMenu>
+							);
+						}
+						return (
+							<Menu.Item key={subMenu.url}>
+								<Link to={`/${subMenu.url}`}>
+									<Icon type={subMenu.icon} />
+									<span className="nav-text">{subMenu.name}</span>
+								</Link>
+							</Menu.Item>
+						);
+					})}
+				</Menu>
+			</div>
+		);
+	}
+});
+
+export default LeftTab;

+ 48 - 0
js/admin/leftTab.less

@@ -0,0 +1,48 @@
+.acc-content {
+    .account-left {
+        width: 16%;
+        height: 100%;
+        padding-bottom: 50px;
+        float: left;
+        border-right: none;
+        overflow-y: auto;
+        .ant-menu-submenu {
+            .ant-menu-submenu-title {
+              
+                font-size: 16px;
+               
+            }
+        }      
+    }
+}
+.acc-index {
+    display: inline-block;
+    overflow: hidden;
+    width: 100%;
+    margin: 1px auto 0;
+    height: 60px;
+    line-height: 60px;
+    img{
+        vertical-align: middle;
+        margin: 0px 10px;
+    }
+    .icon{
+        cursor: pointer;
+        vertical-align: top;
+        margin-top: 18px;
+        color:#fff;
+        font-size: 25px;
+        float: right;
+        margin-right: 13px;
+    }
+    a{
+        color:#ffffff!important;
+    }
+}
+.ant-layout-sider{
+    height: 100%!important;
+}
+.ant-layout.ant-layout-has-sider{
+    min-height:calc(100vh - 10px);
+    margin-top:1px;
+}

+ 13 - 0
js/admin/menu.jsx

@@ -0,0 +1,13 @@
+module.exports = {
+    adminMenu:[
+      {
+        name: '技术需求管理',
+        url: 'sub1',
+        icon: 'bulb',
+        children: [
+          { name: '技术需求库', url: 'library' },
+          { name: '需求发布审核', url: 'examine' },
+        ]
+      },
+    ]
+}

+ 59 - 0
js/admin/topTab.jsx

@@ -0,0 +1,59 @@
+import React from 'react';
+import { Row, Col } from 'antd';
+import './topTab.less';
+import ajax from 'jquery/src/ajax/xhr.js'
+import $ from 'jquery/src/ajax';
+
+const TopTab = React.createClass({
+    getInitialState() {
+        return {
+            username: 'username',
+        };
+    },
+    logOut() {
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            url: globalConfig.context + "/login",
+        }).done(function (data) {
+            window.location.href = globalConfig.context + "/portal/index.html"
+        });
+    },
+    componentWillMount () {
+        this.getData();
+    },
+    getData () {
+        this.setState({
+            loading: false
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            url: globalConfig.context + "/api/user/nickname"
+        }).done(function (data) {
+            if (data.error && data.error.length) {
+                message.warning(data.error[0].message);
+            } else {
+                this.setState({
+                    nickname: data.data,
+                })
+            }
+        }.bind(this)).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    render() {
+        return (
+            <div className="account-top" >
+                <div className="acc-top-user">
+                    <span className="acc-top-user-name">欢迎您, {this.state.nickname || userData.nickname || userData.number } <a onClick={this.logOut}>[ 退出 ]</a></span>
+                    <span className="acc-top-user-toindex"><a href={globalConfig.context + "/portal/index.html"}>返回首页</a></span>
+                </div>
+            </div >
+        )
+    }
+});
+
+export default TopTab;

+ 100 - 0
js/admin/topTab.less

@@ -0,0 +1,100 @@
+    .account-top {
+        width: 100%;
+        border-bottom: 1px solid #eee;
+        background: #fff;
+        position: absolute;
+        top: 0;
+        left: 0;
+        z-index: 1;
+        .acc-top-user {
+            margin-bottom: 2px;
+            overflow: hidden;
+            height: 50px;
+            line-height: 50px;
+            background: #404040;
+            color:#ffffff;
+            .acc-top-user-name {
+                margin-left: 10px;
+                a:hover{
+                    color:red;
+                }
+            }
+           
+            .acc-top-user-toindex {
+                float: right;
+                margin-right: 10px;
+            }
+        }
+        .acc-index {
+            height: 90px;
+            width: 16%;
+            position: absolute;
+            top: 34px;
+            left: 0;
+            color: #fff;
+            background: #4665bf;
+            padding:27px 10px;
+            .acc-index-imgbox{
+                width: 36px;
+                height: 36px;
+                padding-top: 36px;
+                position: relative;
+                overflow: hidden;
+                float: left;
+                img {
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                    height: 36px;
+                    width: auto;
+                }
+            }
+            span {
+                margin-left: 10px;
+                font-size: 20px;
+                line-height: 36px;
+                a {
+                    color:#fff;
+                }
+            }
+        }
+        .acc-top-tab {
+            margin-left: 16%;
+            height: 50px;
+            line-height: 50px;
+            font-size: 16px;
+            text-align: center;
+            background: #4665bf;
+            color: #fff;
+            border-left: 1px solid #344c8f;
+            .ant-row {
+                padding-left: 20px;
+                border-left: 1px solid #6b84cc;
+                div {
+                    margin:0 10px;
+                    a {
+                        color:#fff;
+                    }
+                }
+                .active {
+                    font-size: 18px;
+                    &:after {
+                        content: '';
+                        position: absolute;
+                        left: 0;
+                        bottom: 0;
+                        display: block;
+                        width: 100%;
+                        height: 3px;
+                        background: #58a3ff;
+                    }
+                }
+            }
+        }
+    }
+    .ant-layout-header{
+        height: 50px;
+        .account-top{
+            height: 50px
+        }
+    }

+ 27 - 64
js/component/account/demand/demandDesc.jsx

@@ -1,74 +1,35 @@
 import React from 'react';
 import { Modal, Spin } from 'antd';
 import DemandForm from '@/account/demand/demandForm';
+import DemandDetaiel from '@/account/demand/demandDetaiel';
 
 class DemandDesc extends React.Component {
 	constructor(props) {
 		super(props);
 		this.state = {
 			loading: false,
-			pictureUrl: []
+			pictureUrl: [],
+			showState:false
 		};
 	}
-	loadData(id) {
-		this.setState({
-			loading: true
-		});
-		$.ajax({
-			method: 'get',
-			dataType: 'json',
-			crossDomain: false,
-			url:
-				globalConfig.context +
-				(window.userData.type == '1'
-					? '/api/user/demand/orgDemandDetail'
-					: '/api/user/demand/userDemandDetail'),
-			data: {
-				id: id
-			},
-			success: function(data) {
-				let thisData = data.data;
-				if (!thisData) {
-					if (data.error && data.error.length) {
-						message.warning(data.error[0].message);
-					}
-					thisData = {};
-				}
-				this.setState({
-					data: thisData,
-					tags: thisData.keyword ? thisData.keyword.split(',') : [],
-					pictureUrl: thisData.pictureUrl
-						? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload')
-						: []
-				});
-			}.bind(this)
-		}).always(
-			function() {
-				this.setState({
-					loading: false
-				});
-			}.bind(this)
-		);
-	}
 	handleCancel() {
 		this.setState({
-			visible: false
+			visible: false,
 		});
+		this.props.closeDesc(false, false);
 	}
 	handOk() {
 		this.setState({
-			visible: false
+			visible: false,
 		});
 		this.props.closeDesc(false, true);
 	}
 	componentWillReceiveProps(nextProps) {
-		if (nextProps.showDesc && nextProps.data && nextProps.data.id) {
-			this.loadData(nextProps.data.id);
-		}
 		this.state.visible = nextProps.showDesc;
+
 	}
 	render() {
-		let data = this.props.data || [];
+		let data = this.props.data || {releaseStatus:0};
 		return (
 			<div className="patent-desc">
 				<Modal
@@ -82,23 +43,25 @@ class DemandDesc extends React.Component {
 					className="admin-desc-content"
 				>
 					<div>
-						{!data.id ? (
-							<div>
-                                <DemandForm 
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    data={[]}
-                                />
-							</div>
-						) : (
-							<div>
-                                <DemandForm 
-                                    closeDesc={this.handleCancel}
-                                    visible={this.state.visible}
-                                    data={this.props.data}
-                                />
-							</div>
-						)}
+						<div>
+								{data.releaseStatus=='1'||data.releaseStatus=='2'?
+									<DemandDetaiel
+									closeDesc={this.handleCancel.bind(this)}
+									data={this.props.data}
+									demandTypeOption={this.props.demandTypeOption}
+									visible={this.state.visible}
+									handOk={this.handOk.bind(this)}
+									/>
+									:
+									<DemandForm 
+										closeDesc={this.handleCancel.bind(this)}
+										data={this.props.data}
+										demandTypeOption={this.props.demandTypeOption}
+										visible={this.state.visible}
+										handOk={this.handOk.bind(this)}
+										/>
+								} 
+						</div>
 					</div>
 				</Modal>
 			</div>

+ 268 - 0
js/component/account/demand/demandDetaiel.jsx

@@ -0,0 +1,268 @@
+import React from 'react';
+import $ from 'jquery/src/ajax';
+import {
+	Icon,
+	Tabs,
+	Table,
+	Tooltip,
+	Modal,
+	Popover,
+	message,
+	Spin,
+	Upload,
+	Input,
+	InputNumber,
+	Select,
+	DatePicker,
+	Button,
+	Radio,
+	Form,
+	Cascader,
+    Tag,
+    Checkbox,
+    Row,
+    Col
+} from 'antd';
+import { getTechField } from '@/DicTechFieldList.js';
+import {areaSelect,getProvince } from '@/NewDicProvinceList';
+import { IndustryObject, getIndustryCategory } from '@/DicIndustryList.js';
+import {  splitUrl, companySearch, getDemandType, getAchievementCategory,getReleaseStateList,getReleasePositionList } from '@/tools.js';
+
+const DemandDetail = Form.create()(React.createClass({
+    getInitialState() {
+        return {
+            visible: false,
+            loading: false,
+            auditStatus: 0,
+            textFileList: [],
+            videoFileList: [],
+            pictureUrl: [],
+        };
+    },
+    loadData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  '/api/user/demand/orgDemandDetail' ,
+            data: {
+                id: id
+            },
+            success: function (data) {
+                let thisData = data.data;
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    thisData = {};
+                };
+                let ProvinceS = thisData.locationProvince, //getprovince
+				    citys = thisData.locationCity,
+				    Areas = thisData.locationArea,
+				    ProvinceCity = getProvince(ProvinceS, citys, Areas);
+                this.setState({
+
+                    data: thisData,
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getTagsArr(e) {
+        this.setState({ tags: e });
+    },
+    getPictureUrl(e) {
+        this.setState({ pictureUrl: e });
+    },
+	cancelFun(){
+		this.props.closeDesc();
+    },
+    //刷新发布-撤销发布
+    updateFun(index){
+        this.setState({
+            loading:true
+        })
+        let api = index?'/api/shuaxin':'/api/chexiao'
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  api,
+            data: {
+                ids: this.state.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    componentWillMount() {
+        if (this.props.data.id) {
+            this.loadData(this.props.data.id);
+        } else {
+            this.state.data = {};
+        };
+    },
+    componentWillReceiveProps(nextProps) {
+        if (!this.props.visible && nextProps.visible) {
+            this.state.textFileList = [];
+            this.state.videoFileList = [];
+            if (nextProps.data.id) {
+                this.loadData(nextProps.data.id);
+            } else {
+				this.state.data = {};
+				this.state.demandType=undefined; //需求类型
+				this.state.urgent=undefined;//加急需求
+				this.state.offer=undefined;//是否悬赏
+				this.state.hotDemand=undefined;
+				this.state.solve=undefined;
+                this.state.pictureUrl = [];
+            };
+            this.props.form.resetFields();
+        };
+    },
+    render() {
+        const theData = this.state.data || {};
+        const { getFieldDecorator } = this.props.form;
+        const FormItem = Form.Item
+        const formItemLayout = {
+            labelCol: { span: 6 },
+            wrapperCol: { span: 12 },
+        };
+        return (
+			<div className='login'>
+			<Form layout="horizontal" id="demand-form">
+				<Spin spinning={this.state.loading}>
+					<div className="clearfix">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发个需求吧">
+                            <span>{theData.problemDes}</span>
+                        </FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="标题">
+                            <span>{theData.name}</span>
+						</FormItem>
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="行业领域">
+                        <span>{getIndustryCategory(theData.industryCategoryA,theData.industryCategoryB)}</span>
+                    </FormItem>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="需求类型">
+                                <span>{getDemandType(theData.demandType)}</span>
+						</FormItem>
+						{theData.demandType=='5'&&
+							<FormItem className="half-item" {...formItemLayout} label="人才需求酬劳">
+							     <span>{theData.demandType1} 元/月</span>
+						    </FormItem>}
+						{theData.demandType=='3'&&<div className="clearfix"><FormItem className="half-item" {...formItemLayout} label="资金需求额度">
+                            <span>{theData.demandType2}万元</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="资金用途">
+							<span>{theData.yongtu?'扩大再生产':'研发'}</span>
+						</FormItem>
+						</div>
+						}
+					</div>
+					<p style={{marginLeft:40,fontSize:18,marginBottom:15}}>您还可以说明</p>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="加急需求">
+                            <span>{theData.urgent?'加急':'非加急'}</span>
+						</FormItem>
+						{theData.urgent?<FormItem className="half-item" {...formItemLayout} label="日期">
+							<span>{theData.urgentTime}</span>
+						</FormItem>:''}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="悬赏需求">
+                            <span>{theData.offer?'悬赏':'未悬赏'}</span>
+						</FormItem>
+						{theData.offer>=1&&<FormItem className="half-item" {...formItemLayout} label="悬赏金额">
+							<span style={{ marginLeft: '20px' }}>{theData.budgetCost}万元</span>
+						</FormItem>}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="热点需求">
+                            <span>{theData.hotDemand?'热点':'非热点'}</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="解决">
+                            <span>{theData.solve?'已解决':'未解决'}</span>
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem
+							className="half-item"
+							{...formItemLayout}
+							label="地区"
+						>
+							{this.state.ProvinceCity}
+						</FormItem>  
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图片)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrl}                               
+                                    onPreview={(file) => {
+                                        this.setState({
+                                            previewImage: file.url || file.thumbUrl,
+                                            previewVisible: true,
+                                        });
+                                    }} >
+                                </Upload>
+                                <Modal maskClosable={false} footer={null}
+                                    visible={this.state.previewVisible}
+                                    onCancel={() => { this.setState({ previewVisible: false }) }}>
+                                    <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
+                                </Modal>
+                            </div> 
+					</FormItem>
+					<div>
+						<FormItem className="half-item" {...formItemLayout} label="发布状态">
+							<span>{getReleaseStateList(theData.releaseState)}</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="发布时间">
+                                <span>{theData.releaseTime}</span>
+						</FormItem>
+					</div>
+                    <div>
+                        <FormItem className="half-item" labelCol={{ span: 6 }}
+							wrapperCol={{ span: 18 }} label="发布位置">
+                                <span>{getReleasePositionList(theData.releasePosition)}</span>
+						</FormItem>
+                    </div>
+					<div className="clearfix">
+						{this.props.data.releaseStatus=='2'&&<FormItem wrapperCol={{ span: 12, offset: 3 }}>
+							<Button className="set-submit" type="primary"  onClick={(e)=>{this.updateFun(1)}} >
+								刷新发布
+							</Button>
+							<Button type="danger" style={{marginRight:20}} onClick={(e)=>{this.updateFun(0)}}>
+								撤销发布
+							</Button>
+							<Button className="set-submit" type="ghost" onClick={this.cancelFun}>
+								取消
+							</Button>
+						</FormItem>}
+					</div>
+				</Spin>
+			</Form>    
+		</div>
+        )
+    }
+}));
+export default DemandDetail;
+
+
+
+

+ 363 - 361
js/component/account/demand/demandForm.jsx

@@ -26,8 +26,8 @@ import {
 import { getTechField } from '@/DicTechFieldList.js';
 import {areaSelect } from '@/NewDicProvinceList';
 import { IndustryObject, getIndustryCategory } from '@/DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getDemandType, getAchievementCategory } from '@/tools.js';
-
+import {  splitUrl, companySearch, getDemandType, getAchievementCategory } from '@/tools.js';
+const FormItem =Form.Item
 
 const PicturesWall = React.createClass({
 	getInitialState() {
@@ -81,368 +81,370 @@ const PicturesWall = React.createClass({
 		);
 	}
 });
-const DemandForm = Form.create()(
-	React.createClass({
-		getInitialState() {
-			return {
-				visible: false,
-				loading: false,
-				auditStatus: 0,
-				textFileList: [],
-				videoFileList: [],
-				pictureUrl: [],
-                tags: [],
-                ProvinceCity:[]
-			};
-		},
-		loadData(id) {
-			this.setState({
-				loading: true
-			});
-			$.ajax({
-				method: 'get',
-				dataType: 'json',
-				crossDomain: false,
-				url:
-					globalConfig.context +
-					(window.userData.type == '1'
-						? '/api/user/demand/orgDemandDetail'
-						: '/api/user/demand/userDemandDetail'),
-				data: {
-					id: id
-				},
-				success: function(data) {
-					let thisData = data.data;
-					if (!thisData) {
-						if (data.error && data.error.length) {
-							message.warning(data.error[0].message);
-						}
-						thisData = {};
-					}
-					this.setState({
-						data: thisData,
-						tags: thisData.keyword ? thisData.keyword.split(',') : [],
-						pictureUrl: thisData.pictureUrl
-							? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload')
-							: []
-					});
-				}.bind(this)
-			}).always(
-				function() {
-					this.setState({
-						loading: false
-					});
-				}.bind(this)
-			);
-		},
-		getTagsArr(e) {
-			this.setState({ tags: e });
-		},
-		getPictureUrl(e) {
-			this.setState({ pictureUrl: e });
-		},
-		handleSubmit(e) {
-			e.preventDefault();
-			this.props.form.validateFields((err, values) => {
-				//keyword长度判断
-				if (this.state.tags.length < 3) {
-					message.warning('关键词数量不能小于3个!');
-					return;
-				}
-				//url转化
-				let thePictureUrl = [];
-				if (this.state.pictureUrl.length) {
-					let picArr = [];
-					this.state.pictureUrl.map(function(item) {
-						if (item.response && item.response.data && item.response.data.length) {
-							picArr.push(item.response.data);
-						}
-					});
-					thePictureUrl = picArr.join(',');
-				}
-				if (!err) {
-					this.setState({
-						loading: true
-					});
-					$.ajax({
-						method: 'POST',
-						dataType: 'json',
-						crossDomain: false,
-						url: this.props.data.id
-							? globalConfig.context + '/api/user/demand/update'
-							: globalConfig.context + '/api/user/demand/apply',
-						data: {
-							id: this.props.data.id,
-							dataCategory: Number(window.userData.type),
-							serialNumber: this.props.data.serialNumber,
-							name: values.name,
-							keyword: this.state.tags ? this.state.tags.join(',') : [],
-							keywords: this.state.tags,
-							infoSources: 1,
-							industryCategoryA: values.industryCategory ? values.industryCategory[0] : undefined,
-							industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
-							demandType: values.demandType,
-							problemDes: values.problemDes,
-							technicalRequirements: values.technicalRequirements,
-							pictureUrl: thePictureUrl,
-							textFileUrl: this.state.textFileUrl,
-							videoUrl: values.videoUrl,
-							fixedBudget: values.fixedBudget,
-							fixedCycle: values.fixedCycle,
-							peopleNumber: values.peopleNumber,
-							fixedScheme: values.fixedScheme,
-							costEscrow: values.costEscrow,
-							budgetCost: values.budgetCost,
-							employerId: values.employerId || this.state.data.employerId,
-							releaseStatus: values.releaseStatus,
-							principalId: values.principalId,
-							validityPeriodFormattedDate: values.validityPeriod
-								? values.validityPeriod.format('YYYY-MM-DD')
-								: undefined,
-							//
-							contacts: values.contacts,
-							status: this.state.status,
-							auditStatus: this.state.auditStatus
-						}
-					}).done(
-						function(data) {
-							this.state.auditStatus = 0;
-							this.setState({
-								loading: false
-							});
-							if (!data.error.length) {
-								message.success('保存成功!');
-								this.setState({
-									visible: false
-								});
-								this.props.handleOk();
-							} else {
-								message.warning(data.error[0].message);
-							}
-						}.bind(this)
-					);
-				}
-			});
-		},
-		componentWillMount() {
-			if (this.props.data.id) {
-				this.loadData(this.props.data.id);
-			} else {
+ 
+const DemandDetailForm = Form.create()(React.createClass({
+    getInitialState() {
+        return {
+            visible: false,
+            loading: false,
+            auditStatus: 0,
+            textFileList: [],
+            videoFileList: [],
+            pictureUrl: [],
+        };
+    },
+    loadData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  '/api/user/demand/orgDemandDetail' ,
+            data: {
+                id: id
+            },
+            success: function (data) {
+                let thisData = data.data;
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    thisData = {};
+				};
+				let ProvinceCityArr = [];
+				let ProvinceS = thisData.locationProvince; //getprovince
+				let citys = thisData.locationCity;
+				let Areas = thisData.locationArea;
+				ProvinceCityArr.push(ProvinceS, citys, Areas);
+                this.setState({
+					ProvinceCity:ProvinceCityArr,
+                    data: thisData,
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getTagsArr(e) {
+        this.setState({ tags: e });
+    },
+    getPictureUrl(e) {
+        this.setState({ pictureUrl: e });
+    },
+    handleSubmit(e) {
+        e.preventDefault();
+        this.props.form.validateFields((err, values) => {
+			console.log(values)
+            //url转化
+            let thePictureUrl = [];
+            if (this.state.pictureUrl.length) {
+                let picArr = [];
+                this.state.pictureUrl.map(function (item) {
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
+                });
+                thePictureUrl = picArr.join(",");
+            };
+            if (!err) {
+                this.setState({
+                    loading: true
+                });
+                $.ajax({
+                    method: "POST",
+                    dataType: "json",
+                    crossDomain: false,
+                    url: this.props.data.id ? globalConfig.context + '/api/user/demand/update' : globalConfig.context + '/api/user/demand/apply',
+                    data: {
+                        id: this.props.data.id,
+                        dataCategory: Number(window.userData.type),
+                        serialNumber: this.props.data.serialNumber,
+                        name: values.name,
+                        keywords: this.state.tags,
+                        infoSources: 1,
+                        industryCategoryA: values.industryCategory ? values.industryCategory[0] : undefined,
+                        industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
+                        demandType: values.demandType,
+                        problemDes: values.problemDes,
+                        technicalRequirements: values.technicalRequirements,
+                        pictureUrl: thePictureUrl,
+                        textFileUrl: this.state.textFileUrl,
+                        videoUrl: values.videoUrl,
+                        fixedBudget: values.fixedBudget,
+                        fixedCycle: values.fixedCycle,
+                        peopleNumber: values.peopleNumber,
+                        fixedScheme: values.fixedScheme,
+                        costEscrow: values.costEscrow,
+                        budgetCost: values.budgetCost,
+                        releaseStatus: values.releaseStatus,
+                        principalId: values.principalId,
+                        validityPeriodFormattedDate: values.validityPeriod ? values.validityPeriod.format('YYYY-MM-DD') : undefined,
+                        //
+                        contacts: values.contacts,
+                        status: this.state.status,
+                        auditStatus: this.state.auditStatus
+                    }
+                }).done(function (data) {
+                    this.state.auditStatus = 0;
+                    this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success('保存成功!');
+                        this.setState({
+                            visible: false
+                        });
+                        this.props.handleOk();
+                    } else {
+                        message.warning(data.error[0].message);
+                    }
+                }.bind(this));
+            }
+        });
+	},
+	cancelFun(){
+		this.props.closeDesc();
+	},
+    componentWillMount() {
+        if (this.props.data.id) {
+            this.loadData(this.props.data.id);
+        } else {
+            this.state.data = {};
+        };
+    },
+    componentWillReceiveProps(nextProps) {
+        if (!this.props.visible && nextProps.visible) {
+            this.state.textFileList = [];
+            this.state.videoFileList = [];
+            if (nextProps.data.id) {
+                this.loadData(nextProps.data.id);
+            } else {
 				this.state.data = {};
-			}
-		},
-		componentWillReceiveProps(nextProps) {
-                this.state.textFileList = [];
-                this.state.videoFileList = [];
-				if (nextProps.data.id) {
-					this.loadData(nextProps.data.id);
-				} else {
-					this.state.data = {};
-					this.state.pictureUrl = [];
-                }
-				this.props.form.resetFields();
-		},
-		render() {
-			const theData = this.state.data || {};
-            const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = this.props.form;
-			const FormItem = Form.Item;
-			const formItemLayout = {
-				labelCol: { span: 6 },
-				wrapperCol: { span: 12 }
-			};
-			return (
-				<Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
-					<Spin spinning={this.state.loading}>
-						<div className="clearfix">
-							<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发个需求吧">
-								{getFieldDecorator('problemDes', {
-									rules: [ { required: true, message: '此项为必填项!' } ],
-									initialValue: theData.problemDes
-								})(<Input type="textarea" rows={4} placeholder="亲,发个需求吧!让技术专家主动找到您." />)}
-							</FormItem>
-							<FormItem className="half-item" {...formItemLayout} label="标题">
-								{getFieldDecorator('name', {
+				this.state.demandType=undefined; //需求类型
+				this.state.urgent=undefined;//加急需求
+				this.state.offer=undefined;//是否悬赏
+				this.state.hotDemand=undefined;
+				this.state.solve=undefined;
+                this.state.pictureUrl = [];
+            };
+            this.props.form.resetFields();
+        };
+    },
+    render() {
+        const theData = this.state.data || {};
+        const { getFieldDecorator,getFieldsValue } = this.props.form;
+        const FormItem = Form.Item
+        const formItemLayout = {
+            labelCol: { span: 6 },
+            wrapperCol: { span: 12 },
+		};
+		let demandType =(getFieldsValue(['demandType']).demandType);
+        return (
+			<div className='login'>
+			<Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
+				<Spin spinning={this.state.loading}>
+					<div className="clearfix">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发个需求吧">
+							{getFieldDecorator('problemDes', {
+								rules: [ { required: true, message: '此项为必填项!' } ],
+								initialValue: theData.problemDes
+							})(<Input type="textarea" rows={4} placeholder="亲,发个需求吧!让技术专家主动找到您." />)}
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="标题">
+							{getFieldDecorator('name', {
+								rules: [ { required: true, message: '此项为必填项!' } ],
+								initialValue: theData.name
+							})(<Input placeholder="给您的需求配个标题吧." />)}
+						</FormItem>
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="行业领域">
+						{getFieldDecorator('industryCategory', {
+							rules: [ { type: 'array', required: true, message: '此项为必填项!' } ],
+							initialValue: [ theData.industryCategoryA, theData.industryCategoryB ]
+						})(<Cascader style={{ width: 300 }} options={IndustryObject} placeholder="请选择一个行业" />)}
+					</FormItem>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="需求类型">
+							{getFieldDecorator('demandType', {
 									rules: [ { required: true, message: '此项为必填项!' } ],
-									initialValue: theData.name
-								})(<Input placeholder="给您的需求配个标题吧." />)}
-							</FormItem>
-						</div>
-						
-						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="行业领域">
-							{getFieldDecorator('industryCategory', {
-								rules: [ { type: 'array', required: true, message: '此项为必填项!' } ],
-								initialValue: [ theData.industryCategoryA, theData.industryCategoryB ]
-							})(<Cascader style={{ width: 300 }} options={IndustryObject} placeholder="请选择一个行业" />)}
+									initialValue:theData.demandType
+							})(
+								<Select style={{ width: 160 }} placeholder="请选择需求类型"
+									>
+									{this.props.demandTypeOption}
+								</Select>
+							)}
 						</FormItem>
-						<div className="clearfix">
-							<FormItem className="half-item" {...formItemLayout} label="需求类型">
-									<Select style={{ width: 160 }} placeholder="请选择需求类型"
-                                        value={this.state.demandType} onChange={(e)=>{this.setState({demandType:e})}}
-                                        >
-										<Select.Option value="0" >人才需求</Select.Option>
-                                        <Select.Option value="1" >资金需求</Select.Option>
-									</Select>
-							</FormItem>
-                            {this.state.demandType=='0'&&
-                                <FormItem className="half-item" {...formItemLayout} label="人才需求酬劳">
-								{getFieldDecorator('name', {
-									rules: [ { required: false } ],
-									initialValue: theData.namea
-								})(<Input placeholder="请输入酬劳." />)}
-							</FormItem>}
-                            {this.state.demandType=='1'&&<div className="clearfix"><FormItem className="half-item" {...formItemLayout} label="资金需求额度">
-								{getFieldDecorator('name', {
-									rules: [ { required: false } ],
-									initialValue: theData.namea
-								})(<Input placeholder="请输入资金需求额度." />)}
-							</FormItem>
-                            <FormItem className="half-item" {...formItemLayout} label="资金用途">
-								{getFieldDecorator('namea', {
-									rules: [ { required: false } ],
-									initialValue: theData.namea
-								})(
-                                    <Select placeholder="选择转让方式" style={{ width: 160 }} >
-                                        <Select.Option value="0" >完全转让</Select.Option>
-                                        <Select.Option value="1" >许可转让</Select.Option>
-                                        <Select.Option value="2" >技术入股</Select.Option>
-                                    </Select>
-                                )}
-                                </FormItem>
-                            </div>
-                            }
-						</div>
-                        <p style={{marginLeft:40,fontSize:18,marginBottom:15}}>您还可以说明</p>
-                        <div className="clearfix">
-                            <FormItem className="half-item" {...formItemLayout} label="加急">
-                                <Radio.Group value={this.state.urgent} onChange={(e)=>{this.setState({urgent:e.target.value})}}>
-                                    <Radio value={1}>加急需求</Radio>
-                                    <Radio value={0}>非加急需求</Radio>
-                                </Radio.Group>
-                            </FormItem>
-                            {this.state.urgent&&<FormItem className="half-item" {...formItemLayout} label="日期">
-								{getFieldDecorator('validitytime', {
-									initialValue: theData.validitytime ? moment(theData.validitytime) : null
-								})(<DatePicker />)}
-							</FormItem>}
-						</div>
-						<div className="clearfix">
-							<FormItem className="half-item" {...formItemLayout} label="悬赏需求">
-                                <Radio.Group value={this.state.offer} onChange={(e)=>{this.setState({offer:e.target.value})}}>
-                                    <Radio value={0}>否</Radio>
-                                    <Radio value={1}>是</Radio>
-                                </Radio.Group>
-							</FormItem>
-                            {this.state.offer>=1&&<FormItem className="half-item" {...formItemLayout} label="悬赏金额">
-								{getFieldDecorator('budgetCost', {
-									initialValue: theData.budgetCost
-								})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入金额."/>)}
-								<span style={{ marginLeft: '20px' }}>万元</span>
-							</FormItem>}
-						</div>
-                        <div className="clearfix">
-                            <FormItem className="half-item" {...formItemLayout} label="热点需求">
-                                <Radio.Group value={this.state.hotDemand} onChange={(e)=>{this.setState({hotDemand:e.target.value})}}>
-                                    <Radio value={0}>否</Radio>
-                                    <Radio value={1}>是</Radio>
-                                </Radio.Group>
-							</FormItem>
-                            <FormItem className="half-item" {...formItemLayout} label="解决">
-                                <Radio.Group value={this.state.solve} onChange={(e)=>{this.setState({solve:e.target.value})}}>
-                                    <Radio value={0}>否</Radio>
-                                    <Radio value={1}>是</Radio>
-                                </Radio.Group>
+						{demandType=='5'||theData.demandType=='5'?
+							<FormItem className="half-item" {...formItemLayout} label="人才需求酬劳">
+							{getFieldDecorator('name', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入酬劳."/>)}
+							<span style={{ marginLeft: '20px' }}>元/月</span>
+						</FormItem>:''}
+						{demandType=='3'||theData.demandType=='3'?<div className="clearfix"><FormItem className="half-item" {...formItemLayout} label="资金需求额度">
+							{getFieldDecorator('name', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入资金需求额度."/>)}
+							<span style={{ marginLeft: '20px' }}>万元</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="资金用途">
+							{getFieldDecorator('namea', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(
+								<Select placeholder="选择资金用途" style={{ width: 160 }} >
+									<Select.Option value="0" >研发</Select.Option>
+									<Select.Option value="1" >扩大再生产</Select.Option>
+								</Select>
+							)}
 							</FormItem>
-                        </div>
-                        <div className="clearfix">
-                            <FormItem
-                                className="half-item"
-                                {...formItemLayout}
-                                label="地区"
-                            >
-                                <Cascader
-                                    options={areaSelect()}
-                                    value={this.state.ProvinceCity}
-                                    placeholder="选择地区"
-                                    onChange={(e, pre) => {
-                                        this.setState({ ProvinceCity: e });
-                                    }}
-                                />
-                            </FormItem>  
-                        </div>
-                        <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图片)">
-							<PicturesWall
-								uid={theData.employerId}
-								fileList={this.getPictureUrl}
-								pictureUrl={this.state.pictureUrl}
-								visible={this.props.visible}
+						</div>:''
+						}
+					</div>
+					<p style={{marginLeft:40,fontSize:18,marginBottom:15}}>您还可以说明</p>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="加急">
+							<Radio.Group value={this.state.urgent} onChange={(e)=>{this.setState({urgent:e.target.value})}}>
+								<Radio value={1}>加急</Radio>
+								<Radio value={0}>非加急</Radio>
+							</Radio.Group>
+						</FormItem>
+						{this.state.urgent?<FormItem className="half-item" {...formItemLayout} label="日期">
+							{getFieldDecorator('validitytime', {
+								initialValue: theData.validitytime ? moment(theData.validitytime) : null
+							})(<DatePicker />)}
+						</FormItem>:''}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="悬赏需求">
+							<Radio.Group value={this.state.offer} onChange={(e)=>{this.setState({offer:e.target.value})}}>
+								<Radio value={0}>否</Radio>
+								<Radio value={1}>是</Radio>
+							</Radio.Group>
+						</FormItem>
+						{this.state.offer>=1&&<FormItem className="half-item" {...formItemLayout} label="悬赏金额">
+							{getFieldDecorator('budgetCost', {
+								initialValue: theData.budgetCost
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入金额."/>)}
+							<span style={{ marginLeft: '20px' }}>万元</span>
+						</FormItem>}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="热点需求">
+							<Radio.Group value={this.state.hotDemand} onChange={(e)=>{this.setState({hotDemand:e.target.value})}}>
+								<Radio value={0}>否</Radio>
+								<Radio value={1}>是</Radio>
+							</Radio.Group>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="解决">
+							<Radio.Group value={this.state.solve} onChange={(e)=>{this.setState({solve:e.target.value})}}>
+								<Radio value={0}>未解决</Radio>
+								<Radio value={1}>已解决</Radio>
+							</Radio.Group>
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem
+							className="half-item"
+							{...formItemLayout}
+							label="地区"
+						>
+							<Cascader
+								options={areaSelect()}
+								value={this.state.ProvinceCity}
+								placeholder="选择地区"
+								onChange={(e, pre) => {
+									this.setState({ ProvinceCity: e });
+								}}
 							/>
+						</FormItem>  
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图片)">
+						<PicturesWall
+							uid={theData.employerId}
+							fileList={this.getPictureUrl}
+							pictureUrl={this.state.pictureUrl}
+							visible={this.props.visible}
+						/>
+					</FormItem>
+					<div>
+						<FormItem className="half-item" {...formItemLayout} label="发布状态">
+							{getFieldDecorator('releaseState', {
+								rules: [ { required: false } ],
+								initialValue: theData.releaseState
+							})(
+								<Select placeholder="选择发布状态" style={{ width: 160 }} >
+									<Select.Option value="0" >草稿</Select.Option>
+									<Select.Option value="1" >发布审核</Select.Option>
+									<Select.Option value="2" >已发布</Select.Option>
+									<Select.Option value="3" >发布失败</Select.Option>
+									<Select.Option value="4" >已撤销</Select.Option>
+								</Select>
+							)}
 						</FormItem>
-                        <div>
-                            <FormItem className="half-item" {...formItemLayout} label="发布状态">
-								{getFieldDecorator('releaseState', {
-									rules: [ { required: false } ],
-									initialValue: theData.releaseState
-								})(
-                                    <Select placeholder="选择发布状态" style={{ width: 160 }} >
-                                        <Select.Option value="0" >草稿</Select.Option>
-                                        <Select.Option value="1" >发布审核</Select.Option>
-                                        <Select.Option value="2" >已发布</Select.Option>
-                                        <Select.Option value="3" >发布失败</Select.Option>
-                                        <Select.Option value="4" >已撤销</Select.Option>
-                                    </Select>
-                                )}
-                            </FormItem>
-                            <FormItem className="half-item" {...formItemLayout} label="发布时间">
-                                    {getFieldDecorator('releaseTime', {
-                                        initialValue: theData.releaseTime ? moment(theData.releaseTime) : null
-                                    })(<DatePicker />)}
-                            </FormItem>
-                        </div>
-                        <div className="clearfix">
-                            <FormItem className="full-item" 
-                                labelCol={{ span: 3 }}
-								wrapperCol={{ span: 18 }} label="发布状态">
-								{getFieldDecorator('releasePosition', {
-									rules: [ { required: false } ],
-									initialValue: theData.releasePosition
-								})(
-                                    <Checkbox.Group>
-                                        <Row>
-                                            <Col span={6}><Checkbox value="A">网站首页</Checkbox></Col>
-                                            <Col span={6}><Checkbox value="B">网站需求主页</Checkbox></Col>
-                                            <Col span={6}><Checkbox value="C">网站需求搜索页</Checkbox></Col>
-                                            <Col span={6}><Checkbox value="D">APP首页</Checkbox></Col>
-                                            <Col span={6}><Checkbox value="E">APP需求首页</Checkbox></Col>
-                                            <Col span={6}><Checkbox value="E">APP需求搜索页</Checkbox></Col>
-                                        </Row>
-                                    </Checkbox.Group>
-                                )}
-                            </FormItem>
-                        </div>
-                        <div className="clearfix">
-                            <FormItem wrapperCol={{ span: 12, offset: 3 }}>
-                                <Button className="set-submit" type="primary" htmlType="submit">
-                                    保存
-                                </Button>
-                                {this.props.data&&this.props.data.id&&<Button
-                                    className="set-submit"
-                                    type="ghost"
-                                    onClick={(e) => {
-                                        this.state.auditStatus = 1;
-                                    }}
-                                    htmlType="submit"
-                                >
-                                    提交审核
-                                </Button>}
-                                <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>
-                                    取消
-                                </Button>
-                            </FormItem>
-                        </div>
-					</Spin>
-				</Form>
-			);
-		}
-	})
-);
-export default DemandForm;
+						<FormItem className="half-item" {...formItemLayout} label="发布时间">
+								{getFieldDecorator('releaseTime', {
+									initialValue: theData.releaseTime ? moment(theData.releaseTime) : null
+								})(<DatePicker />)}
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem className="full-item" 
+							labelCol={{ span: 3 }}
+							wrapperCol={{ span: 18 }} label="发布位置">
+							{getFieldDecorator('releasePosition', {
+								rules: [ { required: false } ],
+								initialValue: theData.releasePosition
+							})(
+								<Checkbox.Group>
+									<Row>
+										<Col span={6}><Checkbox value="0">网站首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="1">网站需求主页</Checkbox></Col>
+										<Col span={6}><Checkbox value="2">网站需求搜索页</Checkbox></Col>
+										<Col span={6}><Checkbox value="3">APP首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="4">APP需求首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="5">APP需求搜索页</Checkbox></Col>
+									</Row>
+								</Checkbox.Group>
+							)}
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem wrapperCol={{ span: 12, offset: 3 }}>
+							<Button className="set-submit" type="primary" htmlType="submit">
+								保存
+							</Button>
+							{this.props.data&&this.props.data.id&&<Button
+								className="set-submit"
+								type="ghost"
+								onClick={(e) => {
+									this.state.auditStatus = 1;
+								}}
+								htmlType="submit"
+							>
+								提交审核
+							</Button>}
+							<Button className="set-submit" type="ghost" onClick={this.cancelFun}>
+								取消
+							</Button>
+						</FormItem>
+					</div>
+				</Spin>
+			</Form>    
+		</div>
+        )
+    }
+}));
+export default DemandDetailForm;
+
+
+
+

+ 18 - 26
js/component/account/demand/techDemand.jsx

@@ -6,7 +6,7 @@ import moment from 'moment';
 import './techDemand.less';
 import TechDemandDesc from './demandDesc.jsx';
 import { demandTypeList } from '../../dataDic.js';
-import { getDemandType } from '../../tools.js';
+import { getDemandType,getReleaseStateList } from '../../tools.js';
 
 const DemandList = React.createClass({
     loadData(pageNo) {
@@ -114,20 +114,7 @@ const DemandList = React.createClass({
                     title: '发布状态',
                     dataIndex: 'releaseStatus',
                     key: 'releaseStatus',
-                    render: text => {
-                        switch (text) {
-                            case "0":
-                                return <span>未提交审核(草稿)</span>;
-                            case "1":
-                                return <span>发布审核</span>;
-                            case "2":
-                                return <span>已发布</span>;
-                            case "3":
-                                return <span>发布失败</span>;
-                            case "4":
-                                return <span>已撤销</span>;
-                        }
-                    }
+                    render: text => { return getReleaseStateList(text) }
                 }, {
                     title: '发布时间',
                     dataIndex: 'demandType1',
@@ -144,11 +131,11 @@ const DemandList = React.createClass({
                     key: 'caozuo',
                     render:(text,recard) => {
                         return  <div className="btnRight">
-                                    <Button type="primary" onClick={(e)=>{e.stopPropagation;this.tableRowClick(recard)}}>编辑</Button>
-                                    <Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation;this.submission(recard)}}>提交</Button>
-                                    <Button type="danger"  onClick={(e)=>{e.stopPropagation;this.delectRow(recard)}}>删除</Button>
-                                    <Button type="success" onClick={(e)=>{e.stopPropagation;this.release(recard,1)}}>刷新发布</Button>
-                                    <Button type="primary" onClick={(e)=>{e.stopPropagation;this.release(recard,0)}}>撤销发布</Button>
+                                   <Button type="primary" onClick={(e)=>{e.stopPropagation;this.tableRowClick(recard)}}>{recard.releaseStatus=='1'||recard.releaseStatus=='2'?'查看':'编辑'}</Button>
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation;this.submission(recard)}}>提交</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="danger"  onClick={(e)=>{e.stopPropagation;this.delectRow(recard)}}>删除</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="success" onClick={(e)=>{e.stopPropagation;this.release(recard,1)}}>刷新发布</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="danger" onClick={(e)=>{e.stopPropagation;this.release(recard,0)}}>撤销发布</Button>}
                                 </div>
                     }
                 }
@@ -271,8 +258,7 @@ const DemandList = React.createClass({
         this.state.keyword = undefined;
         this.state.demandType = undefined;
         this.state.username = undefined;
-        this.state.status = undefined;
-        this.state.releaseStatus = undefined;
+        this.state.releaseStatusSearch = undefined;
         this.state.validityPeriodDate = [];
         this.state.releaseDate = [];
         this.loadData();
@@ -294,13 +280,19 @@ const DemandList = React.createClass({
         };
         const hasSelected = this.state.selectedRowKeys.length > 0;
         const { RangePicker } = DatePicker;
-        this.state.dataSource=[{key:1,serialNumber:1,id:1},{key:2,serialNumber:2,id:2}]
+        this.state.dataSource=[
+            {key:1,serialNumber:1,id:1,releaseStatus:'0'},
+            {key:2,serialNumber:2,id:24,releaseStatus:'1'},
+            {key:3,serialNumber:3,id:23,releaseStatus:'2'},
+            {key:4,serialNumber:4,id:22,releaseStatus:'3'},
+            {key:5,serialNumber:5,id:21,releaseStatus:'4'},
+        ]
         return (
             <div className="user-content" >
                 <div className="content-title">
                     <span>科技需求管理</span>
                     <div className="patent-addNew">
-                        <Button type="primary" onClick={this.addClick}>新增需求<Icon type="plus" /></Button>
+                        <Button type="primary" onClick={this.addClick}>发布需求<Icon type="plus" /></Button>
                     </div>
                 </div>
                 <div className="user-search">
@@ -314,8 +306,8 @@ const DemandList = React.createClass({
                         {this.state.demandTypeOption}
                     </Select>
                     <Select placeholder="发布状态" style={{ width: 120 }}
-                        value={this.state.status}
-                        onChange={(e) => { this.setState({ status: e }) }}>
+                        value={this.state.releaseStatusSearch}
+                        onChange={(e) => { this.setState({ releaseStatusSearch: e }) }}>
                         <Select.Option value="0" >草稿</Select.Option>
                         <Select.Option value="1" >发布审核</Select.Option>
                         <Select.Option value="2" >已发布</Select.Option>

+ 3 - 0
js/component/account/demand/techDemand.less

@@ -28,6 +28,9 @@
         }
     }
 }
+button:focus,button:active{
+    outline: none
+}
 .btnRight button{
     margin-right: 10px;
 }

+ 0 - 1
js/component/account/index/content.jsx

@@ -12,7 +12,6 @@ import ServiceList from '@/account/index/serviceList';
 import ConsultList from '@/account/index/consultList';
 import DemandList from '@/account/demand/techDemand';
 import Achievement from '@/account/achievement/techAchievement';
-
 import {hashHistory,Route,Router,IndexRedirect} from 'react-router';
 import {Layout} from 'antd';
 import '@/account/content.less'

+ 9 - 9
js/component/account/index/leftMenu.jsx

@@ -8,9 +8,9 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { menu } from '@/account/menu';
 import logo from 'img/acc-logo.png';
-
 const { Sider } = Layout;
 
+
 const LeftTab = React.createClass({
 	getInitialState() {
 		return {
@@ -24,7 +24,7 @@ const LeftTab = React.createClass({
 		$.ajax({
 			method: 'post',
 			dataType: 'json',
-			url: globalConfig.context + '/api/admin/customer/left',
+			url: globalConfig.context + '/api/admin/customer/abc',
 			data: {}
 		}).done(
 			function(data) {
@@ -45,13 +45,13 @@ const LeftTab = React.createClass({
 		window.location.hash = e.key;
 	},
 	iconFun() {
-		let menu = document.querySelector('.ant-layout-sider');
+		let menuW = document.querySelector('.ant-layout-sider');
 		if (this.state.switch) {
-			menu.style.width = '200px';
-			menu.style.flex = '0 0 200px';
+			menuW.style.width = '200px';
+			menuW.style.flex = '0 0 200px';
 		} else {
-			menu.style.width = '50px';
-			menu.style.flex = '0 0 50px';
+			menuW.style.width = '50px';
+			menuW.style.flex = '0 0 50px';
 		}
 		this.setState({
 			switch: !this.state.switch
@@ -76,7 +76,7 @@ const LeftTab = React.createClass({
 				window.location.hash = 'normal';
 				this.setState({
 					openKeys:['sub1'],
-					current:"normal"
+					current:'normal'
 				})
 			}else{
 				menu.map(item=>{
@@ -98,7 +98,7 @@ const LeftTab = React.createClass({
 			window.location.hash = 'normal';
 			this.setState({
 				openKeys:['sub1'],
-				current:"normal"
+				current:'normal'
 			})
 		}
 	},

+ 1 - 1
js/component/account/menu.jsx

@@ -38,5 +38,5 @@ module.exports = {
             { name: '科技成果列表', url: 'achievement'}
           ]
         }
-    ]
+    ],
 }

+ 31 - 20
js/component/account/setAccount/account.jsx

@@ -8,6 +8,7 @@ import React from 'react';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { Row, Col, Form, Button, Spin, message, Modal, Input } from 'antd';
+import {getStatuslist} from '@/tools.js';
 import './account.less';
 const FormItem = Form.Item;
 
@@ -29,24 +30,32 @@ class Account extends React.Component {
 			loading: true
 		});
 		$.ajax({
-			method: 'post',
+			method: 'get',
 			dataType: 'json',
 			crossDomain: false,
-			url: globalConfig.context + '/api/admin/customer/shuju',
-			data: {},
+			url: globalConfig.context + '/api/user/userBase',
 			success: function(data) {
 				if (data.error.length || data.data == '') {
 					if (data.error && data.error.length) {
 						message.warning(data.error[0].message);
 					}
 				} else {
+					console.log(data.data.createTime)
+					let time = new Date('Y-m-d',data.data.createTime);
+					console.log(time)
 					this.setState({
-						id: data.data.id,
-						name: data.data.name,
-						photo: data.data.photo,
+						uid:data.data.uid,
+						username: data.data.username, //用户注册名
+						nickname: data.data.nickname,  //用户昵称
+						identifyName: data.data.identifyName, //注册名称
 						email: data.data.email,
-						nickname: data.data.nickname,
-						accountData: data.data
+						mobile:data.data.mobile, //手机号码
+						headPortraitUrl:data.data.headPortraitUrl, //头像地址
+						type:data.data.type, //用户类型(0-个人,1-企业)
+						accountData: data.data,
+						status:data.data.status,//用户状态 0-正常,1-注销 ,2-锁定
+						authentication:data.data.authentication, //实名认证状态 0-未认证,1-个人实名认
+						createTime:data.data.createTime  
 					});
 				}
 			}.bind(this)
@@ -149,7 +158,7 @@ class Account extends React.Component {
 			crossDomain: false,
 			url: globalConfig.context + '/api/user/mobile',
 			data: {
-				id: this.state.id,
+				uid: this.state.uid,
 				name: this.state.name,
 				photo: this.state.photo,
 				email: this.state.email,
@@ -214,7 +223,7 @@ class Account extends React.Component {
 						<Row>
 							<Col span={8}>
 								<FormItem className="half-mid" {...formItemLayout} label="注册账号">
-									<span>{accountData.account}</span>
+									<span>{this.state.username}</span>
 									<Button
 										size="default"
 										onClick={this.passFun.bind(this)}
@@ -231,18 +240,18 @@ class Account extends React.Component {
 								<FormItem className="half-mid" {...formItemLayout} label="注册名称">
 									{this.state.editName ? (
 										<Input
-											value={this.state.name}
+											value={this.state.identifyName}
 											onBlur={(e) => {
 												this.saveFun(1);
 											}}
 											ref="name"
 											placeholder="请填写注册名称"
 											onChange={(e) => {
-												this.setState({ name: e.target.value });
+												this.setState({ identifyName: e.target.value });
 											}}
 										/>
 									) : (
-										<span>{this.state.name}</span>
+										<span>{this.state.identifyName}</span>
 									)}
 									{this.state.editName ? (
 										''
@@ -263,18 +272,18 @@ class Account extends React.Component {
 								<FormItem className="half-mid" {...formItemLayout} label="注册手机号">
 									{this.state.editPhoto ? (
 										<Input
-											value={this.state.photo}
+											value={this.state.mobile}
 											onBlur={(e) => {
 												this.saveFun(2);
 											}}
 											ref="photo"
 											placeholder="请填写注册手机号码"
 											onChange={(e) => {
-												this.setState({ photo: e.target.value });
+												this.setState({ mobile: e.target.value });
 											}}
 										/>
 									) : (
-										<span>{this.state.photo}</span>
+										<span>{this.state.mobile}</span>
 									)}
 									{this.state.editPhoto ? (
 										''
@@ -353,17 +362,18 @@ class Account extends React.Component {
 						<Row>
 							<Col span={8}>
 								<FormItem className="half-mid" {...formItemLayout} label="账号类型">
-									<span>{this.state.contacts}</span>
+									{this.state.type=='1'&&<span>企业</span>}
+									{this.state.type=='0'&&<span>个人</span>}
 								</FormItem>
 							</Col>
 							<Col span={8}>
 								<FormItem className="half-mid" {...formItemLayout} label="账号状态">
-									<span>{this.state.contacts}</span>
+									<span>{getStatuslist(this.state.status)}</span>
 								</FormItem>
 							</Col>
 							<Col span={8}>
 								<FormItem className="half-mid" {...formItemLayout} label="注册时间">
-									<span>{this.state.contacts}</span>
+									<span>{this.state.createTime}</span>
 								</FormItem>
 							</Col>
 						</Row>
@@ -402,7 +412,7 @@ class Account extends React.Component {
 							<Col span={16}>
 								<span className="danger">实行个人实名认证后,您将享受技淘网提供的全方位的知识产权运营服务</span>
 							</Col>
-						</Row> */}
+						</Row>
 						<Row>
 							<Col span={8}>
 								<FormItem className="half-mid" {...formItemLayout} label="科技专家认证">
@@ -421,6 +431,7 @@ class Account extends React.Component {
 								<span className="danger">实行科技专家认证后,您将成为技淘网的科技服务专家,为其他用户提供科技咨询服务</span>
 							</Col>
 						</Row>
+						 */}
 					</Spin>
 				</div>
 				<Modal

+ 51 - 91
js/component/account/setAccount/contacts.jsx

@@ -22,9 +22,9 @@ class Contancts extends React.Component {
 					edit: false,
 					name: '李霆1',
 					department: '平台事业发展',
-					post: '前端',
+					position: '前端',
 					photo: '18320746285',
-					telPhoto: '5551456',
+					mobile: '5551456',
 					qq: '265478954',
 					email: '125468@qq.com',
 					remarks: '这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字'
@@ -34,9 +34,9 @@ class Contancts extends React.Component {
 					edit: false,
 					name: '李霆2',
 					department: '平台事业发展',
-					post: '前端',
+					position: '前端',
 					photo: '18320746285',
-					telPhoto: '5551456',
+					mobile: '5551456',
 					qq: '265478954',
 					email: '125468@qq.com',
 					remarks: '这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字'
@@ -48,9 +48,9 @@ class Contancts extends React.Component {
 					edit: false,
 					name: '李霆1',
 					department: '平台事业发展',
-					post: '前端',
+					position: '前端',
 					photo: '18320746285',
-					telPhoto: '5551456',
+					mobile: '5551456',
 					qq: '265478954',
 					email: '125468@qq.com',
 					remarks: '这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字'
@@ -61,8 +61,8 @@ class Contancts extends React.Component {
 					name: '李霆2',
 					department: '平台事业发展',
 					post: '前端',
-					photo: '18320746285',
-					telPhoto: '5551456',
+					position: '18320746285',
+					mobile: '5551456',
 					qq: '265478954',
 					email: '125468@qq.com',
 					remarks: '这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字这是一段文字'
@@ -75,20 +75,34 @@ class Contancts extends React.Component {
 			loading: true
 		});
 		$.ajax({
-			method: 'post',
+			method: 'get',
 			dataType: 'json',
 			crossDomain: false,
-			url: globalConfig.context + '/api/admin/customer/shuju',
+			url: globalConfig.context + '/api/user/getUserContacts',
 			data: {},
 			success: function(data) {
+				let theData=data.data,
+					newData=[];
 				if (data.error.length || data.data == '') {
 					if (data.error && data.error.length) {
 						message.warning(data.error[0].message);
 					}
 				} else {
+					theData.map(item=>{
+						newData.push({
+							id: item.id,
+							name: item.name,
+							edit: false,
+							department:item.department,
+							position: item.position,
+							mobile:item.mobile,
+							qq: item.qq,
+							email: item.email,
+							remarks: item.remarks	
+						})
+					})
 					this.setState({
-						contactData: data.data,
-						oldData: data.data
+						contactData: newData,
 					});
 				}
 			}.bind(this)
@@ -108,9 +122,8 @@ class Contancts extends React.Component {
 			name: '',
 			edit: true,
 			department: '',
-			post: '',
-			photo: '',
-			telPhoto: '',
+			position: '',
+			mobile: '',
 			qq: '',
 			email: '',
 			remarks: ''
@@ -120,44 +133,27 @@ class Contancts extends React.Component {
 	//保存函数
 	saveFun(item, index) {
 		let contactData = this.state.contactData;
-		if(!item.name||!item.photo){
+		if(!item.name||!item.mobile){
 			message.warning('请填写带 * 号项!');
 			return;
 		}
-		if (item.id) {
-			this.state.oldData[index].id = item.id;
-			this.state.oldData[index].name = item.name;
-			this.state.oldData[index].department = item.department;
-			this.state.oldData[index].post = item.post;
-			this.state.oldData[index].photo = item.photo;
-			this.state.oldData[index].telPhoto = item.telPhoto;
-			this.state.oldData[index].qq = item.qq;
-			this.state.oldData[index].email = item.email;
-			this.state.oldData[index].remarks = item.remarks;
-		} else {
-			this.state.oldData.push({
-				id: '',
-				name: item.name,
-				department: item.department,
-				post: item.post,
-				photo: item.photo,
-				telPhoto: item.telPhoto,
-				qq: item.qq,
-				email: item.email,
-				remarks: item.remarks
-			});
-		}
-		console.log(this.state.oldData)
-		return;
+		let	api = item.id?'udpateUserContact':'/api/user/addUserContcat';
 		this.setState({
 			loading: true
 		});
 		$.ajax({
 			method: 'post',
 			dataType: 'json',
-			url: globalConfig.context + '/api/admin/customer/updatePersonalCustomer',
+			url: globalConfig.context + api,
 			data: {
-				contactData: JSON.stringify(this.state.oldData)
+				id: item.id||'',
+				name: item.name,
+				department: item.department,
+				position: item.position,
+				mobile: item.mobile,
+				qq: item.qq,
+				email: item.email,
+				remarks: item.remarks
 			}
 		}).done(
 			function(data) {
@@ -165,7 +161,7 @@ class Contancts extends React.Component {
 					loading: false
 				});
 				if (!data.error.length) {
-					message.success('保存成功!');
+					message.success('操作成功!');
 					this.loadData();
 				} else {
 					message.warning(data.error[0].message);
@@ -185,11 +181,11 @@ class Contancts extends React.Component {
 				loading: true
 			});
 			$.ajax({
-				method: 'post',
+				method: 'get',
 				dataType: 'json',
-				url: globalConfig.context + '/api/admin/customer/del',
+				url: globalConfig.context + '/api/user/deleteUserContact',
 				data: {
-					uid: item.id
+					id: item.id
 				}
 			}).done(
 				function(data) {
@@ -213,13 +209,6 @@ class Contancts extends React.Component {
 			contactData: this.state.contactData
 		});
 	}
-	//取消编辑
-	cancelFun(item,index){
-		this.state.contactData[index].edit = false;
-		this.setState({
-			contactData:this.state.contactData
-		})
-	}	
 	componentWillMount() {
 		this.loadData();
 	}
@@ -293,26 +282,26 @@ class Contancts extends React.Component {
 													<Input
 														style={{ width: '90%' }}
 														placeholder="联系人职务"
-														value={item.post}
+														value={item.position}
 														onChange={(e) => {
-															(item.post = e.target.value),
+															(item.position = e.target.value),
 																this.setState({ contactData: this.state.contactData });
 														}}
 													/>
 												) : (
-													<span>{item.post}</span>
+													<span>{item.position}</span>
 												)}
 											</FormItem>
 										</Col>
 										<Col span={6}>
-											<FormItem {...formItemLayout} label="手机号码">
+											<FormItem {...formItemLayout} label="联系电话">
 												{item.edit && (
 													<Input
 														style={{ width: '90%' }}
-														placeholder="联系人手机"
-														value={item.photo}
+														placeholder="联系人电话号码"
+														value={item.mobile}
 														onChange={(e) => {
-															(item.photo = e.target.value),
+															(item.mobile = e.target.value),
 																this.setState({ contactData: this.state.contactData });
 														}}
 													/>
@@ -320,30 +309,13 @@ class Contancts extends React.Component {
 												{item.edit ? (
 													<span className="color-red"> * </span>
 												) : (
-													<span>{item.photo}</span>
+													<span>{item.mobile}</span>
 												)}
 											</FormItem>
 										</Col>
 									</Row>
 									<Row>
 										<Col span={6}>
-											<FormItem {...formItemLayout} label="固定电话">
-												{item.edit ? (
-													<Input
-														style={{ width: '90%' }}
-														placeholder="联系人固定电话"
-														value={item.telPhoto}
-														onChange={(e) => {
-															(item.telPhoto = e.target.value),
-																this.setState({ contactData: this.state.contactData });
-														}}
-													/>
-												) : (
-													<span>{item.telPhoto}</span>
-												)}
-											</FormItem>
-										</Col>
-										<Col span={6}>
 											<FormItem {...formItemLayout} label="QQ">
 												{item.edit ? (
 													<Input
@@ -420,18 +392,6 @@ class Contancts extends React.Component {
 													保存
 												</Button>
 											)}
-											 {item.edit &&
-											item.id && (
-												<Button
-													size="large"
-													style={{ marginRight: 20 }}
-													onClick={() => {
-														this.cancelFun(item, index);
-													}}
-												>
-													暂存
-												</Button>
-											)}  
 											<Button
 												type="danger"
 												size="large"

+ 7 - 51
js/component/account/setAccount/personal.jsx

@@ -146,10 +146,7 @@ const Personal = React.createClass({
 			method: 'get',
 			dataType: 'json',
 			crossDomain: false,
-			url: globalConfig.context + '/api/admin/customer/findPersonalCustomerDetail',
-			data: {
-				uid: record
-			},
+			url: globalConfig.context + '/api/user/getUserDetail',
 			success: function(data) {
 				let thisData = data.data;
 				if (!thisData) {
@@ -170,8 +167,6 @@ const Personal = React.createClass({
 					InformationId: thisData.id,
 					InformationUid: thisData.uid,
 					identifyName: thisData.identifyName,
-					listed: thisData.listed,
-					highTechZone: thisData.highTechZone,
 					headPortraitUrl: thisData.headPortraitUrl
 						? splitUrl(thisData.headPortraitUrl, ',', globalConfig.avatarHost + '/upload')
 						: [],
@@ -183,8 +178,7 @@ const Personal = React.createClass({
 						: [],
 					dataInformation: thisData,
 					idNumber: thisData.idNumber,
-					contacts: thisData.contacts,
-					contactMobile: thisData.contactMobile,
+					mobile:thisData.mobile,
 					ProvinceCity: ProvinceCityArr[0] != null ? ProvinceCityArr : undefined,
 					industry: thisData.industry ? String(thisData.industry) : undefined,
 					societyTag: thisData.societyTag || undefined,
@@ -192,23 +186,10 @@ const Personal = React.createClass({
 					yearMonth: month,
 					postalAddress: thisData.postalAddress,
 					fixedTel: thisData.fixedTel,
-					consultationPrice: thisData.consultationPrice,
 					email: thisData.email,
 					qq: thisData.qq,
+					mobile:thisData.mobile,
 					introduction: thisData.introduction,
-					expert: thisData.expert,
-					celebrity: thisData.celebrity,
-					consultant: thisData.consultant,
-					international: thisData.international,
-					investment: thisData.investment,
-					professionalTitle: thisData.professionalTitle,
-					workUnit: thisData.workUnit,
-					education: thisData.education,
-					graduateSchool: thisData.graduateSchool,
-					majorCategory: thisData.majorCategory,
-					qualification: thisData.qualification,
-					businessAudit: thisData.businessAudit,
-					auditStatus: thisData.auditStatus ? String(thisData.auditStatus) : undefined
 				});
 			}.bind(this)
 		}).always(
@@ -299,7 +280,7 @@ const Personal = React.createClass({
 		$.ajax({
 			method: 'post',
 			dataType: 'json',
-			url: globalConfig.context + '/api/admin/customer/updatePersonalCustomer',
+			url: globalConfig.context + '/api/user/updateUserDetail',
 			data: {
 				id: this.state.InformationId,
 				uid: this.state.InformationUid,
@@ -312,32 +293,16 @@ const Personal = React.createClass({
 				city: this.state.ProvinceCity[1], //市
 				area: this.state.ProvinceCity[2], //区
 				sex: this.state.sex,
-				expert: this.state.expert,
-				celebrity: this.state.celebrity,
-				consultant: this.state.consultant,
-				international: this.state.international,
+				mobile:this.state.mobile,
 				fixedTel: this.state.fixedTel,
-				consultationPrice: this.state.consultationPrice ? this.state.consultationPrice : '',
 				qq: this.state.qq,
-				contacts: this.state.contacts,
-				contactMobile: this.state.contactMobile,
 				idNumber: this.state.idNumber,
 				email: this.state.email,
-				isMember: this.state.isMember,
 				postalAddress: this.state.postalAddress,
 				introduction: this.state.introduction,
 				positiveIdUrl: thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '',
 				oppositeIdUrl: thecompanyLogoUrls.length != 0 ? thecompanyLogoUrls : '',
 				headPortraitUrl: theorgCodeUrl.length != 0 ? theorgCodeUrl : '',
-				investment: this.state.investment,
-				professionalTitle: this.state.professionalTitle,
-				workUnit: this.state.workUnit,
-				education: this.state.education,
-				graduateSchool: this.state.graduateSchool,
-				majorCategory: this.state.majorCategory,
-				qualification: this.state.qualification,
-				businessAudit: this.state.businessAudit,
-				auditStatus: this.state.auditStatus
 			}
 		}).done(
 			function(data) {
@@ -494,22 +459,13 @@ const Personal = React.createClass({
                                 <Input
                                     style={{width:'90%'}}
                                     placeholder="手机号码"
-                                    value={this.state.photo}
+                                    value={this.state.mobile}
                                     onChange={(e) => {
-                                        this.setState({ photo: e.target.value });
+                                        this.setState({ mobile: e.target.value });
                                     }}
                                 />
                                 <span className="color-red"> * </span>
                             </FormItem>
-                            <FormItem className="half-item" {...formItemLayout} label="就业单位">
-                                <Input
-                                    placeholder="传真"
-                                    value={this.state.Fax}
-                                    onChange={(e) => {
-                                        this.setState({ Fax: e.target.value });
-                                    }}
-                                />
-                            </FormItem>
                             <FormItem className="half-item" {...formItemLayout} label="固定电话">
                                 <Input
                                     placeholder="客户固定电话"

+ 8 - 23
js/component/account/setAccount/unit.jsx

@@ -143,10 +143,7 @@ const Unit = React.createClass({
 		$.ajax({
 			method: 'get',
 			dataType: 'json',
-			url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail',
-			data: {
-				uid: record
-			},
+			url: globalConfig.context + '/api/user/getOrganizationDetail',
 			success: function(data) {
 				let thisData = data.data;
 				if (!thisData) {
@@ -174,15 +171,11 @@ const Unit = React.createClass({
 						: [],
 					dataInformation: thisData,
 					ProvinceCity: ProvinceCityArr[0] != null ? ProvinceCityArr : undefined,
-					contacts: thisData.contacts,
-					contactMobile: thisData.contactMobile,
 					industry: String(thisData.industry) == 'null' ? undefined : String(thisData.industry),
-					international: thisData.international,
 					societyTag: thisData.societyTag || undefined,
 					introduction: thisData.introduction,
 					postalAddress: thisData.postalAddress,
-					contactsFixedTel: thisData.contactsFixedTel,
-					contactsFax: thisData.contactsFax,
+					fixedTel: thisData.fixedTel,
 					registeredCapital: thisData.registeredCapital,
 					enterpriseScale: thisData.enterpriseScale,
 					legalPerson: thisData.legalPerson,
@@ -190,12 +183,7 @@ const Unit = React.createClass({
 					legalPersonTel: thisData.legalPersonTel,
 					legalPersonEmail: thisData.legalPersonEmail,
 					businessScope: thisData.businessScope,
-					orgCode: thisData.orgCode,
-					investment: thisData.investment,
-					auditStatus: thisData.auditStatus ? String(thisData.auditStatus) : undefined,
-					businessAudit: thisData.businessAudit,
-					listed: thisData.listed,
-					highTechZone: thisData.highTechZone
+					orgCode: thisData.orgCode
 				});
 			}.bind(this)
 		}).always(
@@ -288,7 +276,7 @@ const Unit = React.createClass({
 				locationCity: this.state.ProvinceCity[1], //市
 				locationArea: this.state.ProvinceCity[2], //区
 				postalAddress: this.state.postalAddress,
-				contactsFixedTel: this.state.contactsFixedTel,
+				fixedTel: this.state.fixedTel,
 				contactsFax: this.state.contactsFax,
 				registeredCapital: this.state.registeredCapital ? this.state.registeredCapital : 0,
 				enterpriseScale: this.state.enterpriseScale ? this.state.enterpriseScale : 0,
@@ -299,14 +287,11 @@ const Unit = React.createClass({
 				highTechZone: this.state.highTechZone,
 				listed: this.state.listed,
 				contacts: this.state.contacts,
-				contactMobile: this.state.contactMobile,
-				international: this.state.international,
 				orgCode: this.state.orgCode,
 				businessScope: this.state.businessScope,
 				introduction: this.state.introduction,
 				companyLogoUrl: thecompanyLogoUrl != 0 ? thecompanyLogoUrl : '',
 				orgCodeUrl: theorgCodeUrl != 0 ? theorgCodeUrl : '',
-				businessAudit: this.state.businessAudit,
 				auditStatus: this.state.auditStatus
 			}
 		}).done(
@@ -432,9 +417,9 @@ const Unit = React.createClass({
 							>
 								<Input
 									placeholder="客户固定电话"
-									value={this.state.contactsFixedTel}
+									value={this.state.fixedTel}
 									onChange={(e) => {
-										this.setState({ contactsFixedTel: e.target.value });
+										this.setState({ fixedTel: e.target.value });
 									}}
 								/>
 							</FormItem>
@@ -446,9 +431,9 @@ const Unit = React.createClass({
 							>
 								<Input
 									placeholder="客户传真"
-									value={this.state.contactsFax}
+									value={this.state.fixedTel}
 									onChange={(e) => {
-										this.setState({ contactsFax: e.target.value });
+										this.setState({ fixedTel: e.target.value });
 									}}
 								/>
 							</FormItem>

+ 356 - 0
js/component/adminDemand/DemandExamine.jsx

@@ -0,0 +1,356 @@
+import React from 'react';
+import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import moment from 'moment';
+import './techDemand.less';
+import TechDemandDesc from './demandDesc.jsx';
+import { demandTypeList } from '@/dataDic.js';
+import { getDemandType,getReleaseStateList } from '@/tools.js';
+
+const DemandList = React.createClass({
+    loadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/list",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                serialNumber: this.state.serialNumber,
+                name: this.state.name,
+                keyword: this.state.keyword,
+                demandType: this.state.demandType ? Number(this.state.demandType) : undefined,
+                status: this.state.status ? Number(this.state.status) : undefined,
+                releaseStatus: this.state.releaseStatus ? Number(this.state.releaseStatus) : undefined,
+                validityPeriodStartDate: this.state.validityPeriodDate[0],
+                validityPeriodEndDate: this.state.validityPeriodDate[1],
+                releaseDateStartDate: this.state.releaseDate[0],
+                releaseDateEndDate: this.state.releaseDate[1],
+                auditStatus: this.state.auditStatus
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            dataCategory: thisdata.dataCategory,
+                            name: thisdata.name,
+                            keyword: thisdata.keyword,
+                            releaseDate: thisdata.releaseDate,
+                            demandType: thisdata.demandType,
+                            validityPeriod: thisdata.validityPeriod,
+                            status: thisdata.status,
+                            releaseStatus: thisdata.releaseStatus,
+                            employerId: thisdata.employerId,
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
+                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
+                            auditStatus: thisdata.auditStatus
+                        });
+                    };
+                }
+                this.state.pagination.current = data.data.pageNo;
+                this.state.pagination.total = data.data.totalCount;
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            validityPeriodDate: [],
+            releaseDate: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            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: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '需求名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                },  {
+                    title: '需求类型',
+                    dataIndex: 'demandType',
+                    key: 'demandType',
+                    render: text => { return getDemandType(text); }
+                },
+                {
+                    title: '发布状态',
+                    dataIndex: 'releaseStatus',
+                    key: 'releaseStatus',
+                    render: text => { return getReleaseStateList(text) }
+                }, {
+                    title: '发布时间',
+                    dataIndex: 'demandType1',
+                    key: 'demandType1'
+                },
+                {
+                    title: '解决状态',
+                    dataIndex: 'demandType11',
+                    key: 'demandType11'
+                },
+                {
+                    title: '审核',
+                    dataIndex: 'caozuo',
+                    key: 'caozuo',
+                    render:(text,recard) => {
+                        return  <div className="btnRight">
+                                   <Button type="primary" onClick={(e)=>{e.stopPropagation;this.tableRowClick(recard)}}>{recard.releaseStatus=='1'||recard.releaseStatus=='2'?'查看':'编辑'}</Button>
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation;this.submission(recard)}}>提交</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="danger"  onClick={(e)=>{e.stopPropagation;this.delectRow(recard)}}>删除</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="success" onClick={(e)=>{e.stopPropagation;this.release(recard,1)}}>刷新发布</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="danger" onClick={(e)=>{e.stopPropagation;this.release(recard,0)}}>撤销发布</Button>}
+                                </div>
+                    }
+                }
+            ],
+            dataSource: [],
+            searchTime: [,]
+        };
+    },
+    //提交审核
+    submission(record){
+        this.setState({
+            loading:true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/deletet",
+            data: {
+                ids: deletedIds
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('成功提交审核.');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    //刷新发布
+    release(recard,index){
+        let api = index?'/api/shuaxin':'/api/chexiao';
+        this.setState({
+            loading:true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + api,
+            data: {
+                id: recard.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('操作成功');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    
+    componentWillMount() {
+        let theArr = [];
+        demandTypeList.map(function (item) {
+            theArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });
+        this.state.demandTypeOption = theArr;
+        this.loadData();
+    },
+    tableRowClick(record, index) {
+        this.state.RowData = record;
+        this.setState({
+            showDesc: true
+        });
+    },
+    delectRow(recard) {
+        this.setState({
+            loading:true
+        })
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/delete",
+            data: {
+                ids: recard.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    addClick() {
+        this.state.RowData = {};
+        this.setState({
+            showDesc: true
+        });
+    },
+    closeDesc(e, s) {
+        this.state.showDesc = e;
+        if (s) {
+            this.loadData();
+        };
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+        this.state.serialNumber = undefined;
+        this.state.auditStatus = undefined;
+        this.state.name = undefined;
+        this.state.keyword = undefined;
+        this.state.demandType = undefined;
+        this.state.username = undefined;
+        this.state.releaseStatusSearch = undefined;
+        this.state.validityPeriodDate = [];
+        this.state.releaseDate = [];
+        this.loadData();
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    render() {
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        this.state.dataSource=[
+            {key:1,serialNumber:1,id:1,releaseStatus:'0'},
+            {key:2,serialNumber:2,id:24,releaseStatus:'1'},
+            {key:3,serialNumber:3,id:23,releaseStatus:'2'},
+            {key:4,serialNumber:4,id:22,releaseStatus:'3'},
+            {key:5,serialNumber:5,id:21,releaseStatus:'4'},
+        ]
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+                    <span>科技需求管理</span>
+                    <div className="patent-addNew">
+                        <Button type="primary" onClick={this.addClick}>发布需求<Icon type="plus" /></Button>
+                    </div>
+                </div>
+                <div className="user-search">
+                    <Input placeholder="需求名称"
+                        value={this.state.name}
+                        onChange={(e) => { this.setState({ name: e.target.value }); }} />
+                    <Select placeholder="选择需求类型"
+                        style={{ width: 120 }}
+                        value={this.state.demandType}
+                        onChange={(e) => { this.setState({ demandType: e }) }}>
+                        {this.state.demandTypeOption}
+                    </Select>
+                    <Select placeholder="发布状态" style={{ width: 120 }}
+                        value={this.state.releaseStatusSearch}
+                        onChange={(e) => { this.setState({ releaseStatusSearch: e }) }}>
+                        <Select.Option value="0" >草稿</Select.Option>
+                        <Select.Option value="1" >发布审核</Select.Option>
+                        <Select.Option value="2" >已发布</Select.Option>
+                        <Select.Option value="3" >发布失败</Select.Option>
+                        <Select.Option value="4" >已撤销</Select.Option>
+                    </Select>
+                    <Select placeholder="解决状态" style={{ width: 160 }}
+                        value={this.state.auditStatus}
+                        onChange={(e) => { this.setState({ auditStatus: e }) }}>
+                        <Select.Option value="0" >未提交审核(草稿)</Select.Option>
+                        <Select.Option value="1" >提交审核</Select.Option>
+                        <Select.Option value="2" >审核中</Select.Option>
+                        <Select.Option value="3" >审核通过</Select.Option>
+                        <Select.Option value="4" >审核未通过</Select.Option>
+                    </Select>
+                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button>
+                    <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
+                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                        <span>发布时间 :</span>
+                        <RangePicker
+                            value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
+                            this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
+                            onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+                    </div>
+                </div>
+                <div className="patent-table">
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.dataSource}
+                            rowSelection={rowSelection}
+                            pagination={this.state.pagination}
+                             />
+                    </Spin>
+                </div>
+                <TechDemandDesc
+                    data={this.state.RowData}
+                    demandTypeOption={this.state.demandTypeOption}
+                    showDesc={this.state.showDesc}
+                    closeDesc={this.closeDesc} />
+            </div >
+        );
+    }
+});
+
+export default DemandList;

+ 72 - 0
js/component/adminDemand/demandDesc.jsx

@@ -0,0 +1,72 @@
+import React from 'react';
+import { Modal, Spin } from 'antd';
+import DemandForm from '@/account/demand/demandForm';
+import DemandDetaiel from '@/account/demand/demandDetaiel';
+
+class DemandDesc extends React.Component {
+	constructor(props) {
+		super(props);
+		this.state = {
+			loading: false,
+			pictureUrl: [],
+			showState:false
+		};
+	}
+	handleCancel() {
+		this.setState({
+			visible: false,
+		});
+		this.props.closeDesc(false, false);
+	}
+	handOk() {
+		this.setState({
+			visible: false,
+		});
+		this.props.closeDesc(false, true);
+	}
+	componentWillReceiveProps(nextProps) {
+		this.state.visible = nextProps.showDesc;
+
+	}
+	render() {
+		let data = this.props.data || {releaseStatus:0};
+		return (
+			<div className="patent-desc">
+				<Modal
+					maskClosable={false}
+					visible={this.state.visible}
+					onOk={this.handOk.bind(this)}
+					onCancel={this.handleCancel.bind(this)}
+					width="1000px"
+					title={!data.id ? '新建需求' : '修改需求'}
+					footer=""
+					className="admin-desc-content"
+				>
+					<div>
+						<div>
+								{data.releaseStatus=='1'||data.releaseStatus=='2'?
+									<DemandDetaiel
+									closeDesc={this.handleCancel.bind(this)}
+									data={this.props.data}
+									demandTypeOption={this.props.demandTypeOption}
+									visible={this.state.visible}
+									handOk={this.handOk.bind(this)}
+									/>
+									:
+									<DemandForm 
+										closeDesc={this.handleCancel.bind(this)}
+										data={this.props.data}
+										demandTypeOption={this.props.demandTypeOption}
+										visible={this.state.visible}
+										handOk={this.handOk.bind(this)}
+										/>
+								} 
+						</div>
+					</div>
+				</Modal>
+			</div>
+		);
+	}
+}
+
+export default DemandDesc;

+ 268 - 0
js/component/adminDemand/demandDetaiel.jsx

@@ -0,0 +1,268 @@
+import React from 'react';
+import $ from 'jquery/src/ajax';
+import {
+	Icon,
+	Tabs,
+	Table,
+	Tooltip,
+	Modal,
+	Popover,
+	message,
+	Spin,
+	Upload,
+	Input,
+	InputNumber,
+	Select,
+	DatePicker,
+	Button,
+	Radio,
+	Form,
+	Cascader,
+    Tag,
+    Checkbox,
+    Row,
+    Col
+} from 'antd';
+import { getTechField } from '@/DicTechFieldList.js';
+import {areaSelect,getProvince } from '@/NewDicProvinceList';
+import { IndustryObject, getIndustryCategory } from '@/DicIndustryList.js';
+import {  splitUrl, companySearch, getDemandType, getAchievementCategory,getReleaseStateList,getReleasePositionList } from '@/tools.js';
+
+const DemandDetail = Form.create()(React.createClass({
+    getInitialState() {
+        return {
+            visible: false,
+            loading: false,
+            auditStatus: 0,
+            textFileList: [],
+            videoFileList: [],
+            pictureUrl: [],
+        };
+    },
+    loadData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  '/api/user/demand/orgDemandDetail' ,
+            data: {
+                id: id
+            },
+            success: function (data) {
+                let thisData = data.data;
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    thisData = {};
+                };
+                let ProvinceS = thisData.locationProvince, //getprovince
+				    citys = thisData.locationCity,
+				    Areas = thisData.locationArea,
+				    ProvinceCity = getProvince(ProvinceS, citys, Areas);
+                this.setState({
+
+                    data: thisData,
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getTagsArr(e) {
+        this.setState({ tags: e });
+    },
+    getPictureUrl(e) {
+        this.setState({ pictureUrl: e });
+    },
+	cancelFun(){
+		this.props.closeDesc();
+    },
+    //刷新发布-撤销发布
+    updateFun(index){
+        this.setState({
+            loading:true
+        })
+        let api = index?'/api/shuaxin':'/api/chexiao'
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  api,
+            data: {
+                ids: this.state.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    componentWillMount() {
+        if (this.props.data.id) {
+            this.loadData(this.props.data.id);
+        } else {
+            this.state.data = {};
+        };
+    },
+    componentWillReceiveProps(nextProps) {
+        if (!this.props.visible && nextProps.visible) {
+            this.state.textFileList = [];
+            this.state.videoFileList = [];
+            if (nextProps.data.id) {
+                this.loadData(nextProps.data.id);
+            } else {
+				this.state.data = {};
+				this.state.demandType=undefined; //需求类型
+				this.state.urgent=undefined;//加急需求
+				this.state.offer=undefined;//是否悬赏
+				this.state.hotDemand=undefined;
+				this.state.solve=undefined;
+                this.state.pictureUrl = [];
+            };
+            this.props.form.resetFields();
+        };
+    },
+    render() {
+        const theData = this.state.data || {};
+        const { getFieldDecorator } = this.props.form;
+        const FormItem = Form.Item
+        const formItemLayout = {
+            labelCol: { span: 6 },
+            wrapperCol: { span: 12 },
+        };
+        return (
+			<div className='login'>
+			<Form layout="horizontal" id="demand-form">
+				<Spin spinning={this.state.loading}>
+					<div className="clearfix">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发个需求吧">
+                            <span>{theData.problemDes}</span>
+                        </FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="标题">
+                            <span>{theData.name}</span>
+						</FormItem>
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="行业领域">
+                        <span>{getIndustryCategory(theData.industryCategoryA,theData.industryCategoryB)}</span>
+                    </FormItem>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="需求类型">
+                                <span>{getDemandType(theData.demandType)}</span>
+						</FormItem>
+						{theData.demandType=='5'&&
+							<FormItem className="half-item" {...formItemLayout} label="人才需求酬劳">
+							     <span>{theData.demandType1} 元/月</span>
+						    </FormItem>}
+						{theData.demandType=='3'&&<div className="clearfix"><FormItem className="half-item" {...formItemLayout} label="资金需求额度">
+                            <span>{theData.demandType2}万元</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="资金用途">
+							<span>{theData.yongtu?'扩大再生产':'研发'}</span>
+						</FormItem>
+						</div>
+						}
+					</div>
+					<p style={{marginLeft:40,fontSize:18,marginBottom:15}}>您还可以说明</p>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="加急需求">
+                            <span>{theData.urgent?'加急':'非加急'}</span>
+						</FormItem>
+						{theData.urgent?<FormItem className="half-item" {...formItemLayout} label="日期">
+							<span>{theData.urgentTime}</span>
+						</FormItem>:''}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="悬赏需求">
+                            <span>{theData.offer?'悬赏':'未悬赏'}</span>
+						</FormItem>
+						{theData.offer>=1&&<FormItem className="half-item" {...formItemLayout} label="悬赏金额">
+							<span style={{ marginLeft: '20px' }}>{theData.budgetCost}万元</span>
+						</FormItem>}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="热点需求">
+                            <span>{theData.hotDemand?'热点':'非热点'}</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="解决">
+                            <span>{theData.solve?'已解决':'未解决'}</span>
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem
+							className="half-item"
+							{...formItemLayout}
+							label="地区"
+						>
+							{this.state.ProvinceCity}
+						</FormItem>  
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图片)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrl}                               
+                                    onPreview={(file) => {
+                                        this.setState({
+                                            previewImage: file.url || file.thumbUrl,
+                                            previewVisible: true,
+                                        });
+                                    }} >
+                                </Upload>
+                                <Modal maskClosable={false} footer={null}
+                                    visible={this.state.previewVisible}
+                                    onCancel={() => { this.setState({ previewVisible: false }) }}>
+                                    <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
+                                </Modal>
+                            </div> 
+					</FormItem>
+					<div>
+						<FormItem className="half-item" {...formItemLayout} label="发布状态">
+							<span>{getReleaseStateList(theData.releaseState)}</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="发布时间">
+                                <span>{theData.releaseTime}</span>
+						</FormItem>
+					</div>
+                    <div>
+                        <FormItem className="half-item" labelCol={{ span: 6 }}
+							wrapperCol={{ span: 18 }} label="发布位置">
+                                <span>{getReleasePositionList(theData.releasePosition)}</span>
+						</FormItem>
+                    </div>
+					<div className="clearfix">
+						{this.props.data.releaseStatus=='2'&&<FormItem wrapperCol={{ span: 12, offset: 3 }}>
+							<Button className="set-submit" type="primary"  onClick={(e)=>{this.updateFun(1)}} >
+								刷新发布
+							</Button>
+							<Button type="danger" style={{marginRight:20}} onClick={(e)=>{this.updateFun(0)}}>
+								撤销发布
+							</Button>
+							<Button className="set-submit" type="ghost" onClick={this.cancelFun}>
+								取消
+							</Button>
+						</FormItem>}
+					</div>
+				</Spin>
+			</Form>    
+		</div>
+        )
+    }
+}));
+export default DemandDetail;
+
+
+
+

+ 450 - 0
js/component/adminDemand/demandForm.jsx

@@ -0,0 +1,450 @@
+import React from 'react';
+import $ from 'jquery/src/ajax';
+import {
+	Icon,
+	Tabs,
+	Table,
+	Tooltip,
+	Modal,
+	Popover,
+	message,
+	Spin,
+	Upload,
+	Input,
+	InputNumber,
+	Select,
+	DatePicker,
+	Button,
+	Radio,
+	Form,
+	Cascader,
+    Tag,
+    Checkbox,
+    Row,
+    Col
+} from 'antd';
+import { getTechField } from '@/DicTechFieldList.js';
+import {areaSelect } from '@/NewDicProvinceList';
+import { IndustryObject, getIndustryCategory } from '@/DicIndustryList.js';
+import {  splitUrl, companySearch, getDemandType, getAchievementCategory } from '@/tools.js';
+const FormItem =Form.Item
+
+const PicturesWall = React.createClass({
+	getInitialState() {
+		return {
+			previewVisible: false,
+			previewImage: '',
+			fileList: []
+		};
+	},
+	handleCancel() {
+		this.setState({ previewVisible: false });
+	},
+	handlePreview(file) {
+		this.setState({
+			previewImage: file.url || file.thumbUrl,
+			previewVisible: true
+		});
+	},
+	handleChange(info) {
+		let fileList = info.fileList;
+		this.setState({ fileList });
+		this.props.fileList(fileList);
+	},
+	componentWillReceiveProps(nextProps) {
+		this.state.fileList = nextProps.pictureUrl;
+	},
+	render() {
+		const { previewVisible, previewImage, fileList } = this.state;
+		const uploadButton = (
+			<div>
+				<Icon type="plus" />
+				<div className="ant-upload-text">点击上传</div>
+			</div>
+		);
+		return (
+			<div className="clearfix">
+				<Upload
+					action={globalConfig.context + '/api/user/demand/uploadPicture'}
+					data={{ sign: 'demand_picture', uid: this.props.uid }}
+					listType="picture-card"
+					fileList={fileList}
+					onPreview={this.handlePreview}
+					onChange={this.handleChange}
+				>
+					{fileList.length >= 5 ? null : uploadButton}
+				</Upload>
+				<Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
+					<img alt="example" style={{ width: '100%' }} src={previewImage} />
+				</Modal>
+			</div>
+		);
+	}
+});
+ 
+const DemandDetailForm = Form.create()(React.createClass({
+    getInitialState() {
+        return {
+            visible: false,
+            loading: false,
+            auditStatus: 0,
+            textFileList: [],
+            videoFileList: [],
+            pictureUrl: [],
+        };
+    },
+    loadData(id) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +  '/api/user/demand/orgDemandDetail' ,
+            data: {
+                id: id
+            },
+            success: function (data) {
+                let thisData = data.data;
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    thisData = {};
+				};
+				let ProvinceCityArr = [];
+				let ProvinceS = thisData.locationProvince; //getprovince
+				let citys = thisData.locationCity;
+				let Areas = thisData.locationArea;
+				ProvinceCityArr.push(ProvinceS, citys, Areas);
+                this.setState({
+					ProvinceCity:ProvinceCityArr,
+                    data: thisData,
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getTagsArr(e) {
+        this.setState({ tags: e });
+    },
+    getPictureUrl(e) {
+        this.setState({ pictureUrl: e });
+    },
+    handleSubmit(e) {
+        e.preventDefault();
+        this.props.form.validateFields((err, values) => {
+			console.log(values)
+            //url转化
+            let thePictureUrl = [];
+            if (this.state.pictureUrl.length) {
+                let picArr = [];
+                this.state.pictureUrl.map(function (item) {
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
+                });
+                thePictureUrl = picArr.join(",");
+            };
+            if (!err) {
+                this.setState({
+                    loading: true
+                });
+                $.ajax({
+                    method: "POST",
+                    dataType: "json",
+                    crossDomain: false,
+                    url: this.props.data.id ? globalConfig.context + '/api/user/demand/update' : globalConfig.context + '/api/user/demand/apply',
+                    data: {
+                        id: this.props.data.id,
+                        dataCategory: Number(window.userData.type),
+                        serialNumber: this.props.data.serialNumber,
+                        name: values.name,
+                        keywords: this.state.tags,
+                        infoSources: 1,
+                        industryCategoryA: values.industryCategory ? values.industryCategory[0] : undefined,
+                        industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
+                        demandType: values.demandType,
+                        problemDes: values.problemDes,
+                        technicalRequirements: values.technicalRequirements,
+                        pictureUrl: thePictureUrl,
+                        textFileUrl: this.state.textFileUrl,
+                        videoUrl: values.videoUrl,
+                        fixedBudget: values.fixedBudget,
+                        fixedCycle: values.fixedCycle,
+                        peopleNumber: values.peopleNumber,
+                        fixedScheme: values.fixedScheme,
+                        costEscrow: values.costEscrow,
+                        budgetCost: values.budgetCost,
+                        releaseStatus: values.releaseStatus,
+                        principalId: values.principalId,
+                        validityPeriodFormattedDate: values.validityPeriod ? values.validityPeriod.format('YYYY-MM-DD') : undefined,
+                        //
+                        contacts: values.contacts,
+                        status: this.state.status,
+                        auditStatus: this.state.auditStatus
+                    }
+                }).done(function (data) {
+                    this.state.auditStatus = 0;
+                    this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success('保存成功!');
+                        this.setState({
+                            visible: false
+                        });
+                        this.props.handleOk();
+                    } else {
+                        message.warning(data.error[0].message);
+                    }
+                }.bind(this));
+            }
+        });
+	},
+	cancelFun(){
+		this.props.closeDesc();
+	},
+    componentWillMount() {
+        if (this.props.data.id) {
+            this.loadData(this.props.data.id);
+        } else {
+            this.state.data = {};
+        };
+    },
+    componentWillReceiveProps(nextProps) {
+        if (!this.props.visible && nextProps.visible) {
+            this.state.textFileList = [];
+            this.state.videoFileList = [];
+            if (nextProps.data.id) {
+                this.loadData(nextProps.data.id);
+            } else {
+				this.state.data = {};
+				this.state.demandType=undefined; //需求类型
+				this.state.urgent=undefined;//加急需求
+				this.state.offer=undefined;//是否悬赏
+				this.state.hotDemand=undefined;
+				this.state.solve=undefined;
+                this.state.pictureUrl = [];
+            };
+            this.props.form.resetFields();
+        };
+    },
+    render() {
+        const theData = this.state.data || {};
+        const { getFieldDecorator,getFieldsValue } = this.props.form;
+        const FormItem = Form.Item
+        const formItemLayout = {
+            labelCol: { span: 6 },
+            wrapperCol: { span: 12 },
+		};
+		let demandType =(getFieldsValue(['demandType']).demandType);
+        return (
+			<div className='login'>
+			<Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
+				<Spin spinning={this.state.loading}>
+					<div className="clearfix">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发个需求吧">
+							{getFieldDecorator('problemDes', {
+								rules: [ { required: true, message: '此项为必填项!' } ],
+								initialValue: theData.problemDes
+							})(<Input type="textarea" rows={4} placeholder="亲,发个需求吧!让技术专家主动找到您." />)}
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="标题">
+							{getFieldDecorator('name', {
+								rules: [ { required: true, message: '此项为必填项!' } ],
+								initialValue: theData.name
+							})(<Input placeholder="给您的需求配个标题吧." />)}
+						</FormItem>
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="行业领域">
+						{getFieldDecorator('industryCategory', {
+							rules: [ { type: 'array', required: true, message: '此项为必填项!' } ],
+							initialValue: [ theData.industryCategoryA, theData.industryCategoryB ]
+						})(<Cascader style={{ width: 300 }} options={IndustryObject} placeholder="请选择一个行业" />)}
+					</FormItem>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="需求类型">
+							{getFieldDecorator('demandType', {
+									rules: [ { required: true, message: '此项为必填项!' } ],
+									initialValue:theData.demandType
+							})(
+								<Select style={{ width: 160 }} placeholder="请选择需求类型"
+									>
+									{this.props.demandTypeOption}
+								</Select>
+							)}
+						</FormItem>
+						{demandType=='5'||theData.demandType=='5'?
+							<FormItem className="half-item" {...formItemLayout} label="人才需求酬劳">
+							{getFieldDecorator('name', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入酬劳."/>)}
+							<span style={{ marginLeft: '20px' }}>元/月</span>
+						</FormItem>:''}
+						{demandType=='3'||theData.demandType=='3'?<div className="clearfix"><FormItem className="half-item" {...formItemLayout} label="资金需求额度">
+							{getFieldDecorator('name', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入资金需求额度."/>)}
+							<span style={{ marginLeft: '20px' }}>万元</span>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="资金用途">
+							{getFieldDecorator('namea', {
+								rules: [ { required: false } ],
+								initialValue: theData.namea
+							})(
+								<Select placeholder="选择资金用途" style={{ width: 160 }} >
+									<Select.Option value="0" >研发</Select.Option>
+									<Select.Option value="1" >扩大再生产</Select.Option>
+								</Select>
+							)}
+							</FormItem>
+						</div>:''
+						}
+					</div>
+					<p style={{marginLeft:40,fontSize:18,marginBottom:15}}>您还可以说明</p>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="加急">
+							<Radio.Group value={this.state.urgent} onChange={(e)=>{this.setState({urgent:e.target.value})}}>
+								<Radio value={1}>加急</Radio>
+								<Radio value={0}>非加急</Radio>
+							</Radio.Group>
+						</FormItem>
+						{this.state.urgent?<FormItem className="half-item" {...formItemLayout} label="日期">
+							{getFieldDecorator('validitytime', {
+								initialValue: theData.validitytime ? moment(theData.validitytime) : null
+							})(<DatePicker />)}
+						</FormItem>:''}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="悬赏需求">
+							<Radio.Group value={this.state.offer} onChange={(e)=>{this.setState({offer:e.target.value})}}>
+								<Radio value={0}>否</Radio>
+								<Radio value={1}>是</Radio>
+							</Radio.Group>
+						</FormItem>
+						{this.state.offer>=1&&<FormItem className="half-item" {...formItemLayout} label="悬赏金额">
+							{getFieldDecorator('budgetCost', {
+								initialValue: theData.budgetCost
+							})(<InputNumber min={0} max={999999} step={0.01} placeholder="输入金额."/>)}
+							<span style={{ marginLeft: '20px' }}>万元</span>
+						</FormItem>}
+					</div>
+					<div className="clearfix">
+						<FormItem className="half-item" {...formItemLayout} label="热点需求">
+							<Radio.Group value={this.state.hotDemand} onChange={(e)=>{this.setState({hotDemand:e.target.value})}}>
+								<Radio value={0}>否</Radio>
+								<Radio value={1}>是</Radio>
+							</Radio.Group>
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="解决">
+							<Radio.Group value={this.state.solve} onChange={(e)=>{this.setState({solve:e.target.value})}}>
+								<Radio value={0}>未解决</Radio>
+								<Radio value={1}>已解决</Radio>
+							</Radio.Group>
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem
+							className="half-item"
+							{...formItemLayout}
+							label="地区"
+						>
+							<Cascader
+								options={areaSelect()}
+								value={this.state.ProvinceCity}
+								placeholder="选择地区"
+								onChange={(e, pre) => {
+									this.setState({ ProvinceCity: e });
+								}}
+							/>
+						</FormItem>  
+					</div>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图片)">
+						<PicturesWall
+							uid={theData.employerId}
+							fileList={this.getPictureUrl}
+							pictureUrl={this.state.pictureUrl}
+							visible={this.props.visible}
+						/>
+					</FormItem>
+					<div>
+						<FormItem className="half-item" {...formItemLayout} label="发布状态">
+							{getFieldDecorator('releaseState', {
+								rules: [ { required: false } ],
+								initialValue: theData.releaseState
+							})(
+								<Select placeholder="选择发布状态" style={{ width: 160 }} >
+									<Select.Option value="0" >草稿</Select.Option>
+									<Select.Option value="1" >发布审核</Select.Option>
+									<Select.Option value="2" >已发布</Select.Option>
+									<Select.Option value="3" >发布失败</Select.Option>
+									<Select.Option value="4" >已撤销</Select.Option>
+								</Select>
+							)}
+						</FormItem>
+						<FormItem className="half-item" {...formItemLayout} label="发布时间">
+								{getFieldDecorator('releaseTime', {
+									initialValue: theData.releaseTime ? moment(theData.releaseTime) : null
+								})(<DatePicker />)}
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem className="full-item" 
+							labelCol={{ span: 3 }}
+							wrapperCol={{ span: 18 }} label="发布位置">
+							{getFieldDecorator('releasePosition', {
+								rules: [ { required: false } ],
+								initialValue: theData.releasePosition
+							})(
+								<Checkbox.Group>
+									<Row>
+										<Col span={6}><Checkbox value="0">网站首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="1">网站需求主页</Checkbox></Col>
+										<Col span={6}><Checkbox value="2">网站需求搜索页</Checkbox></Col>
+										<Col span={6}><Checkbox value="3">APP首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="4">APP需求首页</Checkbox></Col>
+										<Col span={6}><Checkbox value="5">APP需求搜索页</Checkbox></Col>
+									</Row>
+								</Checkbox.Group>
+							)}
+						</FormItem>
+					</div>
+					<div className="clearfix">
+						<FormItem wrapperCol={{ span: 12, offset: 3 }}>
+							<Button className="set-submit" type="primary" htmlType="submit">
+								保存
+							</Button>
+							{this.props.data&&this.props.data.id&&<Button
+								className="set-submit"
+								type="ghost"
+								onClick={(e) => {
+									this.state.auditStatus = 1;
+								}}
+								htmlType="submit"
+							>
+								提交审核
+							</Button>}
+							<Button className="set-submit" type="ghost" onClick={this.cancelFun}>
+								取消
+							</Button>
+						</FormItem>
+					</div>
+				</Spin>
+			</Form>    
+		</div>
+        )
+    }
+}));
+export default DemandDetailForm;
+
+
+
+

+ 356 - 0
js/component/adminDemand/techDemand.jsx

@@ -0,0 +1,356 @@
+import React from 'react';
+import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal } from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import moment from 'moment';
+import './techDemand.less';
+import TechDemandDesc from './demandDesc.jsx';
+import { demandTypeList } from '@/dataDic.js';
+import { getDemandType,getReleaseStateList } from '@/tools.js';
+
+const DemandList = React.createClass({
+    loadData(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/list",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                serialNumber: this.state.serialNumber,
+                name: this.state.name,
+                keyword: this.state.keyword,
+                demandType: this.state.demandType ? Number(this.state.demandType) : undefined,
+                status: this.state.status ? Number(this.state.status) : undefined,
+                releaseStatus: this.state.releaseStatus ? Number(this.state.releaseStatus) : undefined,
+                validityPeriodStartDate: this.state.validityPeriodDate[0],
+                validityPeriodEndDate: this.state.validityPeriodDate[1],
+                releaseDateStartDate: this.state.releaseDate[0],
+                releaseDateEndDate: this.state.releaseDate[1],
+                auditStatus: this.state.auditStatus
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,
+                            serialNumber: thisdata.serialNumber,
+                            dataCategory: thisdata.dataCategory,
+                            name: thisdata.name,
+                            keyword: thisdata.keyword,
+                            releaseDate: thisdata.releaseDate,
+                            demandType: thisdata.demandType,
+                            validityPeriod: thisdata.validityPeriod,
+                            status: thisdata.status,
+                            releaseStatus: thisdata.releaseStatus,
+                            employerId: thisdata.employerId,
+                            releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
+                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
+                            auditStatus: thisdata.auditStatus
+                        });
+                    };
+                }
+                this.state.pagination.current = data.data.pageNo;
+                this.state.pagination.total = data.data.totalCount;
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            validityPeriodDate: [],
+            releaseDate: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            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: 'serialNumber',
+                    key: 'serialNumber',
+                }, {
+                    title: '需求名称',
+                    dataIndex: 'name',
+                    key: 'name',
+                },  {
+                    title: '需求类型',
+                    dataIndex: 'demandType',
+                    key: 'demandType',
+                    render: text => { return getDemandType(text); }
+                },
+                {
+                    title: '发布状态',
+                    dataIndex: 'releaseStatus',
+                    key: 'releaseStatus',
+                    render: text => { return getReleaseStateList(text) }
+                }, {
+                    title: '发布时间',
+                    dataIndex: 'demandType1',
+                    key: 'demandType1'
+                },
+                {
+                    title: '解决状态',
+                    dataIndex: 'demandType11',
+                    key: 'demandType11'
+                },
+                {
+                    title: '审核',
+                    dataIndex: 'caozuo',
+                    key: 'caozuo',
+                    render:(text,recard) => {
+                        return  <div className="btnRight">
+                                   <Button type="primary" onClick={(e)=>{e.stopPropagation;this.tableRowClick(recard)}}>{recard.releaseStatus=='1'||recard.releaseStatus=='2'?'查看':'编辑'}</Button>
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation;this.submission(recard)}}>提交</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus!='2'&&<Button type="danger"  onClick={(e)=>{e.stopPropagation;this.delectRow(recard)}}>删除</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="success" onClick={(e)=>{e.stopPropagation;this.release(recard,1)}}>刷新发布</Button>}
+                                   {recard.releaseStatus!='1'&&recard.releaseStatus=='2'&&<Button type="danger" onClick={(e)=>{e.stopPropagation;this.release(recard,0)}}>撤销发布</Button>}
+                                </div>
+                    }
+                }
+            ],
+            dataSource: [],
+            searchTime: [,]
+        };
+    },
+    //提交审核
+    submission(record){
+        this.setState({
+            loading:true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/deletet",
+            data: {
+                ids: deletedIds
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('成功提交审核.');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    //刷新发布
+    release(recard,index){
+        let api = index?'/api/shuaxin':'/api/chexiao';
+        this.setState({
+            loading:true
+        });
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + api,
+            data: {
+                id: recard.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('操作成功');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    
+    componentWillMount() {
+        let theArr = [];
+        demandTypeList.map(function (item) {
+            theArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });
+        this.state.demandTypeOption = theArr;
+        this.loadData();
+    },
+    tableRowClick(record, index) {
+        this.state.RowData = record;
+        this.setState({
+            showDesc: true
+        });
+    },
+    delectRow(recard) {
+        this.setState({
+            loading:true
+        })
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/user/demand/delete",
+            data: {
+                ids: recard.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.loadData();
+        }.bind(this));
+    },
+    addClick() {
+        this.state.RowData = {};
+        this.setState({
+            showDesc: true
+        });
+    },
+    closeDesc(e, s) {
+        this.state.showDesc = e;
+        if (s) {
+            this.loadData();
+        };
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+        this.state.serialNumber = undefined;
+        this.state.auditStatus = undefined;
+        this.state.name = undefined;
+        this.state.keyword = undefined;
+        this.state.demandType = undefined;
+        this.state.username = undefined;
+        this.state.releaseStatusSearch = undefined;
+        this.state.validityPeriodDate = [];
+        this.state.releaseDate = [];
+        this.loadData();
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    render() {
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        this.state.dataSource=[
+            {key:1,serialNumber:1,id:1,releaseStatus:'0'},
+            {key:2,serialNumber:2,id:24,releaseStatus:'1'},
+            {key:3,serialNumber:3,id:23,releaseStatus:'2'},
+            {key:4,serialNumber:4,id:22,releaseStatus:'3'},
+            {key:5,serialNumber:5,id:21,releaseStatus:'4'},
+        ]
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+                    <span>科技需求管理</span>
+                    <div className="patent-addNew">
+                        <Button type="primary" onClick={this.addClick}>发布需求<Icon type="plus" /></Button>
+                    </div>
+                </div>
+                <div className="user-search">
+                    <Input placeholder="需求名称"
+                        value={this.state.name}
+                        onChange={(e) => { this.setState({ name: e.target.value }); }} />
+                    <Select placeholder="选择需求类型"
+                        style={{ width: 120 }}
+                        value={this.state.demandType}
+                        onChange={(e) => { this.setState({ demandType: e }) }}>
+                        {this.state.demandTypeOption}
+                    </Select>
+                    <Select placeholder="发布状态" style={{ width: 120 }}
+                        value={this.state.releaseStatusSearch}
+                        onChange={(e) => { this.setState({ releaseStatusSearch: e }) }}>
+                        <Select.Option value="0" >草稿</Select.Option>
+                        <Select.Option value="1" >发布审核</Select.Option>
+                        <Select.Option value="2" >已发布</Select.Option>
+                        <Select.Option value="3" >发布失败</Select.Option>
+                        <Select.Option value="4" >已撤销</Select.Option>
+                    </Select>
+                    <Select placeholder="解决状态" style={{ width: 160 }}
+                        value={this.state.auditStatus}
+                        onChange={(e) => { this.setState({ auditStatus: e }) }}>
+                        <Select.Option value="0" >未提交审核(草稿)</Select.Option>
+                        <Select.Option value="1" >提交审核</Select.Option>
+                        <Select.Option value="2" >审核中</Select.Option>
+                        <Select.Option value="3" >审核通过</Select.Option>
+                        <Select.Option value="4" >审核未通过</Select.Option>
+                    </Select>
+                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button>
+                    <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
+                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                        <span>发布时间 :</span>
+                        <RangePicker
+                            value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
+                            this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
+                            onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+                    </div>
+                </div>
+                <div className="patent-table">
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.dataSource}
+                            rowSelection={rowSelection}
+                            pagination={this.state.pagination}
+                             />
+                    </Spin>
+                </div>
+                <TechDemandDesc
+                    data={this.state.RowData}
+                    demandTypeOption={this.state.demandTypeOption}
+                    showDesc={this.state.showDesc}
+                    closeDesc={this.closeDesc} />
+            </div >
+        );
+    }
+});
+
+export default DemandList;

+ 98 - 0
js/component/adminDemand/techDemand.less

@@ -0,0 +1,98 @@
+.user-content {
+    background: #fff;
+    padding: 20px;
+    .content-title {
+        color: #333;
+        font-size: 16px;
+    }
+    .user-search {
+        margin-bottom: 10px;
+        >input {
+            width: 140px;
+        }
+        >input,
+        >button,
+        .ant-select {
+            margin-right: 10px;
+            margin-top: 10px;
+        }
+        .ant-switch {
+            margin-left: 10px;
+        }
+        
+        .search-more {
+            margin: 10px 0;
+            span {
+                margin-right: 10px
+            }
+        }
+    }
+}
+button:focus,button:active{
+    outline: none
+}
+.btnRight button{
+    margin-right: 10px;
+}
+.patent-addNew {
+    float: right;
+    margin-left: 20px;
+    button {
+        background: #ea0862;
+        color: #fff;
+        border: none;
+        border-radius: 4px;
+        padding: 6px 10px;
+        margin-left: 20px;
+    }
+    button:hover {
+        background: #ea0862;
+    }
+}
+
+#demand-form {
+    .half-item {
+        float: left;
+        width: 50%;
+        margin-bottom: 10px;
+    }
+    .item-title {
+        line-height: 30px;
+        font-size: 14px;
+        color: #666;
+    }
+    .form-title {
+        font-size: 16px;
+        color: #333;
+    }
+    .keyWord-tips {
+        >button {
+            vertical-align: middle;
+        }
+    }
+    .set-submit {
+        margin-right: 20px;
+    }
+    .demandDetailShow-upload {
+        .anticon-eye-o {
+            margin-left: -8px;
+        }
+        .anticon-delete {
+            display: none
+        }
+    }
+}
+
+.ant-modal-content {
+    .modal-submit {
+        margin-left: 20px;
+    }
+}
+
+.ant-table-thead {
+    .ant-table-selection-column {
+        .ant-checkbox-wrapper {
+            display: none;
+        }
+    }
+}

+ 46 - 5
js/component/dataDic.js

@@ -761,19 +761,19 @@ module.exports = {
     demandTypeList:[
         {
             value: "0",
-            key: "技术购买型需求"
+            key: "企业技术需求"
         }, {
             value: "1",
             key: "技术设备类需求"
         }, {
             value: "2",
-            key: "技术方案型需求"
+            key: "产学研合作需求"
         }, {
             value: "3",
-            key: "技术攻关型需求"
+            key: "研产资金需求"
         }, {
             value: "4",
-            key: "技术咨询型需求"
+            key: "地区产业需求"
         }, {
             value: "5",
             key: "技术人才型需求"
@@ -2161,5 +2161,46 @@ module.exports = {
 	        key: "其他"
 	    }
     ],
-    
+    /* 个人中心开发 */
+    //发布状态
+    releaseStateList:[
+        {
+	        value: "0",
+	        key: "草稿"
+	    },{
+	        value: "1",
+	        key: "发布审核"
+	    }, {
+	        value: "2",
+	        key: "已发布"
+	    },{
+	        value: "3",
+	        key: "发布失败"
+	    },{
+	        value: "4",
+	        key: "已撤销"
+	    }, 
+    ],
+     //发布位置
+     releasePosition:[
+        {
+	        value: "0",
+	        key: "网站首页"
+	    },{
+	        value: "1",
+	        key: "网站需求主页"
+	    }, {
+	        value: "2",
+	        key: "网站需求搜索页"
+	    },{
+	        value: "3",
+	        key: "APP首页"
+	    },{
+	        value: "4",
+	        key: "APP需求首页"
+	    }, {
+	        value: "5",
+	        key: "APP需求搜索页"
+	    }
+    ]
 };

+ 32 - 2
js/component/tools.js

@@ -73,7 +73,9 @@ import {
     publishStatus,
     changeState,
     distributeState,
-    customerSource
+    customerSource,
+    releaseStateList,
+    releasePosition
 } from './dataDic.js';
 
 import { provinceList} from './NewDicProvinceList.js';
@@ -1369,5 +1371,33 @@ module.exports = {
             });
             return theType;
         }
-	}
+    },
+    /* g个人中心开发 */
+    //发布状态
+    getReleaseStateList:function(e){
+        if (e||e==0) {
+            let str=e.toString()
+         let theType = '';
+         releaseStateList.map(function (item) {
+             if (item.value == str) {
+                 theType = item.key;
+             };
+         });
+         return theType;
+        }
+     },
+     //发布位置;
+     getReleasePositionList:function(e){
+        if (e) {
+            let theType = [];
+            e.map((item)=>{
+                releasePosition.map(function (atem) {
+                    if (atem.value == item) {
+                        theType.push(atem.key);
+                    };
+                });
+            })
+         return theType.join(' - ');
+        }
+     }
 }

+ 16 - 0
js/user/adminLogin.js

@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import '../../css/base.less';
+import '../../css/login.less';
+import LoginContent from '@/login/adminLogin.jsx';
+import LoginTop from '@/login/loginTop.jsx';
+import LoginFooter from '@/login/loginFooter.jsx';
+
+ReactDOM.render(
+    <div className="wrap clearfix">
+        <LoginTop />
+        <LoginContent />
+        <LoginFooter />
+    </div>,
+    document.getElementById('root')
+)

+ 2 - 2
package.json

@@ -5,7 +5,7 @@
   "main": "index.js",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
-    "dlldev": "webpack --progress --colors --config ./webpack-dll.config.js --env.deploy dev --env.host 'http://127.0.0.1:8888'",
+    "dlldev": "webpack --progress --colors --config ./webpack-dll.config.js --env.deploy dev --env.host 'http://127.0.0.1'",
     "dlltest": "webpack --progress --colors --config ./webpack-dll.config.js --env.deploy test --env.host 'http://statics.jishutao.com'",
     "dllstage": "webpack --progress --colors --config ./webpack-dll.config.js --env.deploy stage --env.host 'http://aftts.hnzhiming.com'",
     "dllpro": "webpack --progress --colors --config ./webpack-dll.config.js --env.deploy prod --env.host 'http://ss.jishutao.com'",
@@ -13,7 +13,7 @@
     "buildtest": "node bin/clean.js && webpack --progress --colors --env.deploy test",
     "buildstage": "node bin/clean.js && webpack --progress --colors --env.deploy stage",
     "pro": "node bin/clean.js && webpack --progress --colors --env.deploy prod",
-    "dev": "webpack-dev-server --port 8888 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
+    "dev": "webpack-dev-server --port 80  --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
   },
   "repository": {
     "type": "git",

+ 1 - 1
webpack-dll.config.js

@@ -10,7 +10,7 @@ let theme = {
   '@link-color': '#58a3ff'
 };
 module.exports = (function () {
-	let staticHost = 'http://127.0.0.1:8888';    
+	let staticHost = 'http://127.0.0.1';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';

+ 19 - 4
webpack.config.js

@@ -85,7 +85,20 @@ module.exports = (function () {
             template: './template/template.html',
             chunks: ['user/account/index', 'vendors']
         }),
-      
+       //管理员模块
+        new HtmlWebpackPlugin({
+            title: '管理员-登录',
+            filename: 'admin/login.html',
+            template: './template/template.html',
+            chunks: ['admin/login', 'vendors']
+        }),
+        new HtmlWebpackPlugin({
+            title: '管理员-首页',
+            filename: 'admin/index.html',
+            template: './template/template.html',
+            chunks: ['admin/index', 'vendors']
+        })
+        
     ];
     if (!isDev) {
         //这个使用uglifyJs压缩你的js代码
@@ -102,7 +115,7 @@ module.exports = (function () {
         }));
     }
 
-    let staticHost = 'http://127.0.0.1:8888';    
+    let staticHost = 'http://127.0.0.1';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';
@@ -128,8 +141,10 @@ module.exports = (function () {
         resolve: {
         	alias:{
                 '@':__dirname+'/js/component',
-                'img':__dirname+'/image'
-          },
+                'img':__dirname+'/image',
+                '@css':__dirname+'css',
+                'js':__dirname+'js'
+            },
         		
             extensions: ['.js', '.jsx']
            

+ 17 - 5
webpack/entry.config.js

@@ -4,24 +4,36 @@ module.exports = {
     'user/index': './js/user/index.js',
     'user/login': './js/user/login.js',
     'user/signIn': './js/user/signIn.js',
-    'user/account/index': './js/user/account/index.js'
+    'user/account/index': './js/user/account/index.js',
+    //admin
+    'admin/login': './js/user/adminLogin.js',
+    'admin/index': './js/admin/index.js',
   },
   watch: {
-    'user/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/index': ['webpack-dev-server/client?http://127.0.0.1', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/index.js'
     ],
-    'user/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/login': ['webpack-dev-server/client?http://127.0.0.1', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/login.js'
     ],
-    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/signIn.js'
     ],
-    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/index.js'
+    ],
+    //admin
+    'admin/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'webpack/hot/only-dev-server',
+    './js/user/adminLogin.js'
+    ],
+    'admin/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+      'webpack/hot/only-dev-server',
+      './js/admin/index.js'
     ]
   }
 }