|
@@ -5,16 +5,12 @@ import {BrowserRouter as Router, Route, Link, Switch, Redirect} from "react-rout
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
import 'moment/locale/zh-cn';
|
|
import 'moment/locale/zh-cn';
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
+import zhCN from 'antd/lib/locale-provider/zh_CN';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-import CloudFunction from '../cloudFunction/CloudFunction';
|
|
|
|
|
-import MonitorNotify from '../monitorNotify/MonitorNotify';
|
|
|
|
|
-import DataAnalysis from '../dataAnalysis/DataAnalysis';
|
|
|
|
|
-import DataStorage from '../dataStorage/DataStorage';
|
|
|
|
|
|
|
+import WechatService from "../wechatService/WechatService";
|
|
|
|
|
+import QuantService from "../quantService/QuantService";
|
|
|
import TrialCase from "../trialCase/TrialCase";
|
|
import TrialCase from "../trialCase/TrialCase";
|
|
|
import Login from "../login/login";
|
|
import Login from "../login/login";
|
|
|
-
|
|
|
|
|
-import zhCN from 'antd/lib/locale-provider/zh_CN';
|
|
|
|
|
import '../common/graphql/index.css';
|
|
import '../common/graphql/index.css';
|
|
|
import './index.css'
|
|
import './index.css'
|
|
|
|
|
|
|
@@ -89,17 +85,14 @@ class App extends Component {
|
|
|
style={{lineHeight: '64px'}}
|
|
style={{lineHeight: '64px'}}
|
|
|
onClick={(e) => this.switchMenu('menuLevel1', e)}
|
|
onClick={(e) => this.switchMenu('menuLevel1', e)}
|
|
|
>
|
|
>
|
|
|
- <Menu.Item key="cloud-function">
|
|
|
|
|
- <Link to="/cloud-function"><FormattedMessage id="Cloud Function"/></Link>
|
|
|
|
|
|
|
+ <Menu.Item key="graphql-service">
|
|
|
|
|
+ <Link to="/"><FormattedMessage id="Graphql Service"/></Link>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
- <Menu.Item key="data-storage">
|
|
|
|
|
- <Link to="/data-storage/"><FormattedMessage id="Data Storage"/></Link>
|
|
|
|
|
|
|
+ <Menu.Item key="wechat-service">
|
|
|
|
|
+ <Link to="/wechat-service/trial-case/wechat case"><FormattedMessage id="Wechat Service"/></Link>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
- <Menu.Item key="data-analysis">
|
|
|
|
|
- <Link to="/data-analysis/"><FormattedMessage id="Data Analysis"/></Link>
|
|
|
|
|
- </Menu.Item>
|
|
|
|
|
- <Menu.Item key="monitor-notification">
|
|
|
|
|
- <Link to="/monitor-notification/"><FormattedMessage id="Monitor Notification"/></Link>
|
|
|
|
|
|
|
+ <Menu.Item key="quantization-service">
|
|
|
|
|
+ <Link to="/quant-service/"><FormattedMessage id="Quantization Service"/></Link>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
</Menu>
|
|
</Menu>
|
|
|
|
|
|
|
@@ -117,92 +110,134 @@ class App extends Component {
|
|
|
collapsed={this.state.collapsed}
|
|
collapsed={this.state.collapsed}
|
|
|
onCollapse={this.onCollapse}
|
|
onCollapse={this.onCollapse}
|
|
|
>
|
|
>
|
|
|
- <Menu
|
|
|
|
|
- theme="dark"
|
|
|
|
|
- mode="inline"
|
|
|
|
|
- inlineCollapsed={this.state.inlineCollapsed}
|
|
|
|
|
- defaultSelectedKeys={['e-commerce']}
|
|
|
|
|
- defaultOpenKeys={['trial-case']}
|
|
|
|
|
- // openKeys={['cloud-function']}
|
|
|
|
|
- onClick={(e) => this.switchMenu('sideBar', e)}
|
|
|
|
|
- selectedKeys={[this.state.sideBar]}
|
|
|
|
|
- style={{
|
|
|
|
|
- borderRight: 0,
|
|
|
|
|
- overflow: 'auto',
|
|
|
|
|
- height: '100vh',
|
|
|
|
|
- left: '0',
|
|
|
|
|
- width: '200px',
|
|
|
|
|
- position: 'fixed'
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Trial Case</span></span>}>
|
|
|
|
|
- <Menu.Item key="e-commerce"><Link to="/">e-commerce</Link></Menu.Item>
|
|
|
|
|
- <Menu.Item key="keep accounts"><Link to="/">keep accounts</Link></Menu.Item>
|
|
|
|
|
- <Menu.Item key="appointment"><Link to="/">appointment</Link></Menu.Item>
|
|
|
|
|
- </SubMenu>
|
|
|
|
|
-
|
|
|
|
|
- {(() => {
|
|
|
|
|
- switch (this.state.menuLevel1) {
|
|
|
|
|
- case 'cloud-function':
|
|
|
|
|
- return (
|
|
|
|
|
- <SubMenu
|
|
|
|
|
- key="cloud-function"
|
|
|
|
|
- title={<span><Icon type="cloud"
|
|
|
|
|
- theme="twoTone"/><span>Cloud Function</span></span>}>
|
|
|
|
|
- <Menu.Item key="wechat-service">wechat-service</Menu.Item>
|
|
|
|
|
- <Menu.Item key="graphql-service">graphql-service</Menu.Item>
|
|
|
|
|
- <Menu.Item
|
|
|
|
|
- key="quantization-service">quantization-service</Menu.Item>
|
|
|
|
|
|
|
+ {(() => {
|
|
|
|
|
+ switch (this.state.menuLevel1) {
|
|
|
|
|
+ case 'graphql-service':
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Menu
|
|
|
|
|
+ theme="dark"
|
|
|
|
|
+ mode="inline"
|
|
|
|
|
+ inlineCollapsed={this.state.inlineCollapsed}
|
|
|
|
|
+ defaultSelectedKeys={['e-commerce']}
|
|
|
|
|
+ defaultOpenKeys={['trial-case']}
|
|
|
|
|
+ // openKeys={['cloud-function']}
|
|
|
|
|
+ onClick={(e) => this.switchMenu('sideBar', e)}
|
|
|
|
|
+ selectedKeys={[this.state.sideBar]}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ borderRight: 0,
|
|
|
|
|
+ overflow: 'auto',
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ left: '0',
|
|
|
|
|
+ width: '200px',
|
|
|
|
|
+ position: 'fixed'
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Trial Case</span></span>}>
|
|
|
|
|
+ <Menu.Item key="e-commerce"><Link to="/graphql-service/trial-case/e-commerce">e-commerce</Link></Menu.Item>
|
|
|
|
|
+ <Menu.Item key="keep accounts"><Link to="/graphql-service/trial-case/keep accounts">keep accounts</Link></Menu.Item>
|
|
|
|
|
+ <Menu.Item key="appointment"><Link to="/graphql-service/trial-case/appointment">appointment</Link></Menu.Item>
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
|
- );
|
|
|
|
|
- case 'data-storage':
|
|
|
|
|
- return (
|
|
|
|
|
- <SubMenu
|
|
|
|
|
- key="data-storage"
|
|
|
|
|
- title={<span><Icon type="database"
|
|
|
|
|
- theme="twoTone"/><span>Data Storage</span></span>}>
|
|
|
|
|
- <Menu.Item key="snbl-mongo">snbl-mongo</Menu.Item>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <SubMenu key="my-create"
|
|
|
|
|
+ title={<span><Icon type="user" theme="outlined"/><span>My Create</span></span>}>
|
|
|
|
|
+ <Menu.Item key="my graphql"><Link to="/graphql-service/my-create/my graphql">my graphql</Link></Menu.Item>
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
|
- );
|
|
|
|
|
- case 'data-analysis':
|
|
|
|
|
- return (
|
|
|
|
|
- <SubMenu
|
|
|
|
|
- key="data-analysis"
|
|
|
|
|
- title={<span><Icon type="fund"
|
|
|
|
|
- theme="twoTone"/><span>data Analysis</span></span>}>
|
|
|
|
|
- <Menu.Item key="metabase">metabase</Menu.Item>
|
|
|
|
|
|
|
+ </Menu>
|
|
|
|
|
+ );
|
|
|
|
|
+ case 'wechat-service':
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Menu
|
|
|
|
|
+ theme="dark"
|
|
|
|
|
+ mode="inline"
|
|
|
|
|
+ inlineCollapsed={this.state.inlineCollapsed}
|
|
|
|
|
+ defaultSelectedKeys={['e-commerce']}
|
|
|
|
|
+ defaultOpenKeys={['trial-case']}
|
|
|
|
|
+ // openKeys={['cloud-function']}
|
|
|
|
|
+ onClick={(e) => this.switchMenu('sideBar', e)}
|
|
|
|
|
+ selectedKeys={[this.state.sideBar]}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ borderRight: 0,
|
|
|
|
|
+ overflow: 'auto',
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ left: '0',
|
|
|
|
|
+ width: '200px',
|
|
|
|
|
+ position: 'fixed'
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Trial Case</span></span>}>
|
|
|
|
|
+ <Menu.Item key="wechat"><Link to="/wechat-service/trial-case/wechat case">wechat case</Link></Menu.Item>
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
|
- );
|
|
|
|
|
- case 'monitor-notification':
|
|
|
|
|
- return (
|
|
|
|
|
- <SubMenu
|
|
|
|
|
- key="monitor-notification"
|
|
|
|
|
- title={<span><Icon type="alert" theme="twoTone"/><span>Monitor Notification</span></span>}>
|
|
|
|
|
- <Menu.Item key="monitor">monitor</Menu.Item>
|
|
|
|
|
- <Menu.Item key="graphql-events">graphql-events</Menu.Item>
|
|
|
|
|
- <Menu.Item key="stock-signal">stock-signal</Menu.Item>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <SubMenu key="my-create"
|
|
|
|
|
+ title={<span><Icon type="user" theme="outlined"/><span>My Create</span></span>}>
|
|
|
|
|
+ <Menu.Item key="my wechat"><Link to="/wechat-service/my-create/my wechat">my wechat</Link></Menu.Item>
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
|
- );
|
|
|
|
|
- default:
|
|
|
|
|
- return (
|
|
|
|
|
- <SubMenu
|
|
|
|
|
- key="cloud-function"
|
|
|
|
|
- title={<span><Icon type="cloud"
|
|
|
|
|
- theme="twoTone"/><span>Cloud Function</span></span>}>
|
|
|
|
|
- <Menu.Item key="wechat-service">wechat-service</Menu.Item>
|
|
|
|
|
- <Menu.Item key="graphql-service">graphql-service</Menu.Item>
|
|
|
|
|
- <Menu.Item
|
|
|
|
|
- key="quantization-service">quantization-service</Menu.Item>
|
|
|
|
|
|
|
+ </Menu>
|
|
|
|
|
+ );
|
|
|
|
|
+ case 'quantization-service':
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Menu
|
|
|
|
|
+ theme="dark"
|
|
|
|
|
+ mode="inline"
|
|
|
|
|
+ inlineCollapsed={this.state.inlineCollapsed}
|
|
|
|
|
+ defaultSelectedKeys={['e-commerce']}
|
|
|
|
|
+ defaultOpenKeys={['trial-case']}
|
|
|
|
|
+ // openKeys={['cloud-function']}
|
|
|
|
|
+ onClick={(e) => this.switchMenu('sideBar', e)}
|
|
|
|
|
+ selectedKeys={[this.state.sideBar]}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ borderRight: 0,
|
|
|
|
|
+ overflow: 'auto',
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ left: '0',
|
|
|
|
|
+ width: '200px',
|
|
|
|
|
+ position: 'fixed'
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Trial Case</span></span>}>
|
|
|
|
|
+ <Menu.Item key="quant-service"><Link to="/quant-service/">quant case</Link></Menu.Item>
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- })()}
|
|
|
|
|
- <SubMenu key="my-create"
|
|
|
|
|
- title={<span><Icon type="user"
|
|
|
|
|
- theme="outlined"/><span>My Create</span></span>}>
|
|
|
|
|
- <Menu.Item key="8">option9</Menu.Item>
|
|
|
|
|
- </SubMenu>
|
|
|
|
|
- </Menu>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <SubMenu key="my-create"
|
|
|
|
|
+ title={<span><Icon type="user" theme="outlined"/><span>My Create</span></span>}>
|
|
|
|
|
+ <Menu.Item key="my quant"><Link to="/quant-service/">my quant</Link></Menu.Item>
|
|
|
|
|
+ </SubMenu>
|
|
|
|
|
+ </Menu>
|
|
|
|
|
+ );
|
|
|
|
|
+ default:
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Menu
|
|
|
|
|
+ theme="dark"
|
|
|
|
|
+ mode="inline"
|
|
|
|
|
+ inlineCollapsed={this.state.inlineCollapsed}
|
|
|
|
|
+ defaultSelectedKeys={['e-commerce']}
|
|
|
|
|
+ defaultOpenKeys={['trial-case']}
|
|
|
|
|
+ // openKeys={['cloud-function']}
|
|
|
|
|
+ onClick={(e) => this.switchMenu('sideBar', e)}
|
|
|
|
|
+ selectedKeys={[this.state.sideBar]}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ borderRight: 0,
|
|
|
|
|
+ overflow: 'auto',
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ left: '0',
|
|
|
|
|
+ width: '200px',
|
|
|
|
|
+ position: 'fixed'
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Trial Case</span></span>}>
|
|
|
|
|
+ <Menu.Item key="e-commerce"><Link to="/graphql-service/trial-case/e-commerce">e-commerce</Link></Menu.Item>
|
|
|
|
|
+ <Menu.Item key="keep accounts"><Link to="/graphql-service/trial-case/keep accounts">keep accounts</Link></Menu.Item>
|
|
|
|
|
+ <Menu.Item key="appointment"><Link to="/graphql-service/trial-case/appointment">appointment</Link></Menu.Item>
|
|
|
|
|
+ </SubMenu>
|
|
|
|
|
+
|
|
|
|
|
+ <SubMenu key="my-create"
|
|
|
|
|
+ title={<span><Icon type="user" theme="outlined"/><span>My Create</span></span>}>
|
|
|
|
|
+ <Menu.Item key="my graphql"><Link to="/graphql-service/my-create/my graphql">my graphql</Link></Menu.Item>
|
|
|
|
|
+ </SubMenu>
|
|
|
|
|
+ </Menu>
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ })()}
|
|
|
</Sider>
|
|
</Sider>
|
|
|
{
|
|
{
|
|
|
// todo: 路由如何传值是个问题,包括schema_id, user_id
|
|
// todo: 路由如何传值是个问题,包括schema_id, user_id
|
|
@@ -211,10 +246,9 @@ class App extends Component {
|
|
|
<Layout style={{marginTop: '64px', zIndex: '0'}} key={locale ? locale.locale : 'en'/* Have to refresh for production environment */} >
|
|
<Layout style={{marginTop: '64px', zIndex: '0'}} key={locale ? locale.locale : 'en'/* Have to refresh for production environment */} >
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Route path="/" exact component={TrialCase}/>
|
|
<Route path="/" exact component={TrialCase}/>
|
|
|
- <Route path="/cloud-function" component={CloudFunction}/>
|
|
|
|
|
- <Route path="/data-storage/" component={DataStorage}/>
|
|
|
|
|
- <Route path="/data-analysis/" component={DataAnalysis}/>
|
|
|
|
|
- <Route path="/monitor-notification/" component={MonitorNotify}/>
|
|
|
|
|
|
|
+ <Route path="/graphql-service/:sidebar/:caseId" component={TrialCase}/>
|
|
|
|
|
+ <Route path="/wechat-service/:sidebar/:caseId" component={WechatService}/>
|
|
|
|
|
+ <Route path="/quant-service/" component={QuantService}/>
|
|
|
<Route path="/login" component={Login}/>
|
|
<Route path="/login" component={Login}/>
|
|
|
<Redirect path="*" to="/"/>
|
|
<Redirect path="*" to="/"/>
|
|
|
</Switch>
|
|
</Switch>
|