123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import React, { Component } from 'react';
- import '../content.less';
- import LeftTab from './leftTab';
- import TechAchievement from './myClient';
- import PublicCustomer from './publicCustomer';
- import CompanyCustomer from './companyCustomer';
- import Teamcustomer from './teamCustomer';
- class Content extends Component {
- constructor() {
- super();
- this.state = {
- loading: false,
- component: 'div'
- };
- }
- componentWillMount() {
- if (window.location.hash) {
- this.getKey(window.location.hash.substr(1));
- } else {
- this.getKey("myClient");
- };
- }
- getKey(key) {
- switch (key) {
- case 'myClient':
- require.ensure([], () => {
- const TechAchievement = require('./myClient').default;
- this.setState({
- component: TechAchievement ,
- detailApiUrl: '/api/admin/customer/findCustomerUserDetails'
- });
- });
- break;
- case 'publicCustomer':
- require.ensure([], () => {
- const publicCustomer = require('./publicCustomer').default;
- this.setState({
- component:publicCustomer,
- detailApiUrl: '/api/admin/customer/orgDetail'
- });
- });
- break;
- case 'companyCustomer':
- require.ensure([], () => {
- const companyCustomer = require('./companyCustomer').default;
- this.setState({
- component:companyCustomer,
- detailApiUrl: '/api/admin/customer/listCompanyCustomer'
- });
- });
- break;
- case 'teamCustomer':
- require.ensure([], () => {
- const teamCustomer = require('./teamCustomer').default;
- this.setState({
- component:teamCustomer,
- detailApiUrl: '/api/admin/customer/listTeamCustomer'
- });
- });
- break;
- };
- window.location.hash = key;
- }
- render() {
- return (
- <div className="manage-content">
- <LeftTab handlekey={this.getKey.bind(this)} />
- <div className="content-right">
- <this.state.component
- data-listApiUrl={this.state.listApiUrl}
- data-detailApiUrl={this.state.detailApiUrl} />
- </div>
- </div>
- )
- }
- }
- export default Content;
|