WxTrialCase.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import React, {Component} from 'react';
  2. import {Layout, Menu} from 'antd';
  3. import WxConfig from "./wxConfig/WxConfig";
  4. import WxDeploy from "../common/deploy/Deploy";
  5. import WxResult from './wxResult/WxResult';
  6. import Schema from "../graphqlService/component/schema/Schema";
  7. const {Content} = Layout;
  8. class WxTrialCase extends Component {
  9. constructor() {
  10. super();
  11. this.state = {
  12. menuLevel3: "wechat-config",
  13. }
  14. }
  15. switchMenu = (menuName, 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={{
  27. padding: '0 24px',
  28. position: 'fixed',
  29. width: '100%',
  30. zIndex: '1',
  31. lineHeight: '50px',
  32. fontWeight: 600
  33. }}
  34. onClick={(e) => this.switchMenu('menuLevel3', e)}
  35. selectedKeys={[this.state.menuLevel3]}
  36. >
  37. <Menu.Item key="wechat-config">config settings</Menu.Item>
  38. <Menu.Item key="wechat-deploy">deploy settings</Menu.Item>
  39. <Menu.Item key="wechat-result">result</Menu.Item>
  40. </Menu>
  41. <Layout style={{padding: '24px', zIndex: '0'}}>
  42. <Content style={{padding: '24px', minHeight: 280, background: '#fff', marginTop: '48px'}}>
  43. {(() => {
  44. switch (this.state.menuLevel3) {
  45. case 'wechat-config':
  46. return <WxConfig defaultAppName={'ec... whatever'} defaultConfigID={'wxConfig_1543997888848_62199988'} trialcase={true} history={this.props.history} location={this.props.location}/>;
  47. case 'wechat-deploy':
  48. return <WxDeploy/>;
  49. case 'wechat-result':
  50. return <WxResult/>;
  51. default:
  52. return <WxConfig/>
  53. }
  54. })()}
  55. </Content>
  56. </Layout>
  57. </div>
  58. )
  59. }
  60. }
  61. export default WxTrialCase;