topTab.jsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import React from 'react';
  2. import { Row, Col } from 'antd';
  3. import './topTab.less';
  4. import ajax from 'jquery/src/ajax/xhr.js'
  5. import $ from 'jquery/src/ajax';
  6. import logo from '../../../image/acc-logo.png';
  7. const TopTab = React.createClass({
  8. getInitialState() {
  9. return {
  10. username: 'username',
  11. };
  12. },
  13. logOut() {
  14. let theActive = this.props.active;
  15. $.ajax({
  16. method: "get",
  17. dataType: "json",
  18. url: globalConfig.context + "/login",
  19. }).done(function (data) {
  20. window.location.href = globalConfig.context + "/admin/login.html"
  21. });
  22. },
  23. render() {
  24. return (
  25. <div className="account-top" >
  26. <div className="acc-top-user">
  27. <span className="acc-top-user-name">欢迎您, {adminData.name || adminData.mobile || this.state.username} <a onClick={this.logOut}>[ 退出 ]</a></span>
  28. <span className="acc-top-user-toindex"><a href={globalConfig.context + "/admin/index.html"}>返回首页</a></span>
  29. </div>
  30. <div className="acc-index">
  31. <div className="acc-index-imgbox">
  32. <img src={logo} alt="" />
  33. </div>
  34. <span><a href={globalConfig.context + "/admin/index.html"}>管理中心首页</a></span>
  35. </div>
  36. <div className="acc-top-tab">
  37. <Row>
  38. <Col style={{ display: window.showUserManage ? 'block' : 'none' }} className={this.props.active === 'userManage' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/userManage.html"}>用户管理</a></Col>
  39. <Col style={{ display: window.showServices ? 'block' : 'none' }} className={this.props.active === 'services' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/servicesManage/patent.html"}>科技服务管理</a></Col>
  40. <Col style={{ display: window.showAchievement ? 'block' : 'none' }} className={this.props.active === 'achievement' ? 'active' : ''} span={3}><a href="">科技成果管理</a></Col>
  41. <Col style={{ display: window.showDemand ? 'block' : 'none' }} className={this.props.active === 'demand' ? 'active' : ''} span={3}><a href="">科技需求管理</a></Col>
  42. <Col style={{ display: window.showIdea ? 'block' : 'none' }} className={this.props.active === 'idea' ? 'active' : ''} span={3}><a href="">科技思想管理</a></Col>
  43. <Col style={{ display: window.showSystem ? 'block' : 'none' }} className={this.props.active === 'system' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/set.html"}>系统设置</a></Col>
  44. </Row>
  45. </div>
  46. </div >
  47. )
  48. }
  49. });
  50. export default TopTab;