123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- import React, { Component } from 'react';
- import '../content.less';
- import './content.less';
- import LeftTab from '../leftTab';
- import {getMenu} from '../publicMenu.js'
- class Content extends Component {
- constructor() {
- super();
- this.state = {
- loading: false,
- component: <div></div>,
- };
- }
- componentWillMount() {
- var ids=window.location.href.indexOf('rid=');
- var idk=window.location.href.substr(ids+4);
- var rid=idk.split('#');
- let menu=getMenu(rid);
- let curry;
- if(menu[0].subMenus.length>0){
- curry=menu[0].subMenus[0].url.split('#');
- }else{
- curry=menu[0].url.split('#');
- };
- if (window.location.hash) {
- this.getKey(window.location.hash.substr(1));
- } else {
- this.getKey(curry[1]);
- };
- }
- getKey(key) {
- switch (key) {
- // case 'star':
- // require.ensure([], () => {
- // const Star = require('./bigShot/star').default;
- // this.setState({
- // component: <Star />
- // });
- // });
- // break;
- // case 'lecture':
- // require.ensure([], () => {
- // const Lecture = require('./bigShot/lecture').default;
- // this.setState({
- // component: <Lecture />
- // });
- // });
- // break;
- // case 'banner':
- // require.ensure([], () => {
- // const Banner = require('./bannerManage/bannerManage').default;
- // this.setState({
- // component: <Banner />
- // });
- // });
- // break;
- // case 'flash':
- // require.ensure([], () => {
- // const News = require('./news/news').default;
- // this.setState({
- // component: <News newsType={1} />
- // });
- // });
- // break;
- // case 'nationalPolicy':
- // require.ensure([], () => {
- // const News = require('./news/news').default;
- // this.setState({
- // component: <News newsType={4} />
- // });
- // });
- // break;
- // case 'localPolicy':
- // require.ensure([], () => {
- // const News = require('./news/news').default;
- // this.setState({
- // component: <News newsType={5} />
- // });
- // });
- // break;
- // case 'jitao':
- // require.ensure([], () => {
- // const News = require('./news/news').default;
- // this.setState({
- // component: <News newsType={3} />
- // });
- // });
- // break;
- // case 'contact':
- // require.ensure([], () => {
- // const News = require('./news/news').default;
- // this.setState({
- // component: <News newsType={2} />
- // });
- // });
- // break;
- // case 'activity':
- // require.ensure([], () => {
- // const Activity = require('./activity/activity').default;
- // this.setState({
- // component: <Activity />
- // });
- // });
- // break;
- // case 'activityUserList':
- // require.ensure([], () => {
- // const ActivityUserList = require('./activity/activityUserList').default;
- // this.setState({
- // component: <ActivityUserList />
- // });
- // });
- // break;
-
- case 'techPolicyManage': //科技政策管理1
- require.ensure([], () => {
- const Manage = require('./policy/manage').default;
- this.setState({
- component: <Manage />,
- });
- });
- break;
- case 'techPolicyPublish': //科技政策发布1
- require.ensure([], () => {
- const TechPolicyPublishs = require('./policy/techPolicyPublishs').default;
- this.setState({
- component: <TechPolicyPublishs />,
- });
- });
- break;
- case 'techPolicyQuery': //科技政策查询1
- require.ensure([], () => {
- const Inquiry = require('./policy/inquiry').default;
- this.setState({
- component: <Inquiry />,
- });
- });
- break;
- case 'techPolicyAudit': //科技政策审核1
- require.ensure([], () => {
- const TechPolicyAudits = require('./policy/techPolicyAudits').default;
- this.setState({
- component: <TechPolicyAudits />,
- });
- });
- break;
-
- case 'techActivityManage':
- require.ensure([], () => {
- const Module = require('../module').default;
- this.setState({
- component: <Module />,
- });
- });
- break;
- case 'techActivityAudit':
- require.ensure([], () => {
- const Module = require('../module').default;
- this.setState({
- component: <Module />,
- });
- });
- break;
- case 'techActivityPublish':
- require.ensure([], () => {
- const Module = require('../module').default;
- this.setState({
- component: <Module />,
- });
- });
- break;
- case 'techActivityQuery': //科技政策查询
- require.ensure([], () => {
- const Module = require('../module').default;
- this.setState({
- component: <Module />,
- });
- });
- break;
- default:
- require.ensure([], () => {
- const Module = require('../module').default;
- this.setState({
- component:<Module />
- });
- });
- };
- window.location.hash = key;
- }
- render() {
- return (
- <div className="manage-content">
- <LeftTab handlekey={this.getKey.bind(this)} />
- <div className="content-right">
- {this.state.component}
- </div>
- </div>
- )
- }
- }
- export default Content;
|