12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import React from 'react';
- import '../../content.less';
- import LeftTab from '../leftTab.jsx';
- import ProjectOrder from './orderOrder/projectOrder.jsx';
- import ProjectManage from './projectManagement/projectManage.jsx';
- import ProjectOrderNew from './projectManagement/projectManageNew.jsx';
- import MyTask from './myTask/projectManage.jsx';
- import TaskManagement from './taskManagement/projectManage.jsx';
- import Business from '../projectBusiness/business';
- import Module from '../../module.jsx';
- const Content = React.createClass({
- getInitialState() {
- return {
- loading: false,
- leftKey: 'myProject',
- };
- },
- handlekey(key) {
- this.setState({
- leftKey: key,
- });
- window.location.hash = key;
- },
- componentWillMount(){
- if ( window.location.hash ) {
- this.handlekey(window.location.hash.substr(1));
- };
- },
- render() {
- return (
- <div className="manage-content">
- <LeftTab handlekey={this.handlekey} />
- <div className="content-right">
- {(() => {
- switch (this.state.leftKey) {
- case 'myProject':
- return <ProjectOrder />;
- case 'projectManage':
- return <ProjectManage queryProject={0}/>;
- case 'projectQuery':
- return <ProjectManage queryProject={1}/>;
- case 'ProjectOrderNew':
- return <ProjectOrderNew queryProject={1}/>;
- case 'myTask':
- return <MyTask />;
- case 'taskManagement':
- return <TaskManagement />;
- case 'addBusiness':
- return <Business />;
- default:
- return <Module />;
- };
- })()}
- </div>
- </div>
- )
- }
- });
- export default Content;
|