WechatService.jsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React, {Component} from 'react';
  2. import {Layout, Menu} from 'antd';
  3. import WechatConfig from "./wechatConfig/WechatConfig";
  4. import Deploy from "../common/deploy/Deploy";
  5. import WechatManage from "./wechatManage/WechatManage";
  6. const { Content } = Layout;
  7. class WechatService extends Component {
  8. constructor() {
  9. super();
  10. this.state = {
  11. menuLevel3: "wechat-config",
  12. }
  13. }
  14. switchMenu = (menuName, e) => {
  15. // console.log('menuName', menuName, 'e', e);
  16. this.setState({
  17. [menuName]: e.key,
  18. });
  19. };
  20. render() {
  21. return (
  22. <div>
  23. <Menu
  24. mode="horizontal"
  25. defaultSelectedKeys={['wechat-config']}
  26. style={{padding: '0 24px', position: 'fixed', width: '100%', zIndex: '1',lineHeight:'50px',fontWeight:600}}
  27. onClick={(e) => this.switchMenu('menuLevel3', e)}
  28. selectedKeys={[this.state.menuLevel3]}
  29. >
  30. <Menu.Item key="wechat-config">config settings</Menu.Item>
  31. <Menu.Item key="wechat-deploy">deploy settings</Menu.Item>
  32. <Menu.Item key="wechat-manage">manage</Menu.Item>
  33. </Menu>
  34. <Layout style={{ padding: '24px', zIndex: '0'}}>
  35. <Content style={{ padding: '24px', minHeight: 280, background: '#fff',marginTop: '48px' }}>
  36. {(() => {
  37. switch (this.state.menuLevel3) {
  38. case 'wechat-config':
  39. return <WechatConfig />;
  40. case 'wechat-deploy':
  41. return <Deploy />;
  42. case 'wechat-manage':
  43. return <WechatManage />;
  44. default:
  45. return <WechatConfig />
  46. }
  47. })()}
  48. </Content>
  49. </Layout>
  50. </div>
  51. )
  52. }
  53. }
  54. export default WechatService;