|
|
@@ -1,79 +1,92 @@
|
|
|
-import React, {Component} from 'react';
|
|
|
-import { Route, Switch } from 'react-router-dom'
|
|
|
-import Overview from '../../components/Overview/overview'
|
|
|
-import Stocks from '../../components/StocksApi/stocks'
|
|
|
-import IndexApi from '../../components/IndexApi/indexApi'
|
|
|
-import { Link } from 'react-router-dom'
|
|
|
-import stocksApiList from '../../StocksApiList'
|
|
|
-import indexApiList from '../../IndexApiList'
|
|
|
-import 'antd/dist/antd.css';
|
|
|
-import './navbar.css';
|
|
|
-import { Layout, Menu } from 'antd';
|
|
|
-import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons';
|
|
|
+import React, { Component } from "react";
|
|
|
+import { Route, Switch } from "react-router-dom";
|
|
|
+import Overview from "../../components/Overview/overview";
|
|
|
+import Stocks from "../../components/StocksApi/stocks";
|
|
|
+import IndexApi from "../../components/IndexApi/indexApi";
|
|
|
+import { Link } from "react-router-dom";
|
|
|
+import stocksApiList from "../../StocksApiList";
|
|
|
+import indexApiList from "../../IndexApiList";
|
|
|
+import "antd/dist/antd.css";
|
|
|
+import "./navbar.css";
|
|
|
+import { Layout, Menu } from "antd";
|
|
|
+import {
|
|
|
+ UserOutlined,
|
|
|
+ LaptopOutlined,
|
|
|
+ NotificationOutlined,
|
|
|
+} from "@ant-design/icons";
|
|
|
const { SubMenu } = Menu;
|
|
|
const { Header, Content, Sider } = Layout;
|
|
|
export default class NavBar extends Component {
|
|
|
- constructor(props) {
|
|
|
- super(props);
|
|
|
- this.state = {
|
|
|
- userInfo: {}
|
|
|
- };
|
|
|
- }
|
|
|
- render() {
|
|
|
- // let { match } = this.props;
|
|
|
- return (
|
|
|
- <Layout style={{ minHeight: '100vh' }}>
|
|
|
- <Header className="header">
|
|
|
- </Header>
|
|
|
- <Layout>
|
|
|
- <Sider width={200} className="site-layout-background">
|
|
|
- <Menu
|
|
|
- mode="inline"
|
|
|
- defaultSelectedKeys={['overview']}
|
|
|
- defaultOpenKeys={['overview']}
|
|
|
- style={{ height: '100%', borderRight: 0 }}
|
|
|
- >
|
|
|
-
|
|
|
- <Menu.Item key="overview" icon={<UserOutlined />}>
|
|
|
- <Link to='/overview'>总体说明</Link>
|
|
|
- </Menu.Item>
|
|
|
- <SubMenu key="sub2" icon={<LaptopOutlined />} title="股票接口" onClick={this.go}>
|
|
|
- {stocksApiList.map((item)=>{
|
|
|
- return <Menu.Item key={item.url}>
|
|
|
- <Link to='/stocks'>{item.name}</Link>
|
|
|
- </Menu.Item>
|
|
|
- })}
|
|
|
- </SubMenu>
|
|
|
- <SubMenu key="sub3" icon={<NotificationOutlined />} title="指数接口" onClick={this.go}>
|
|
|
- {indexApiList.map((item)=>{
|
|
|
- return <Menu.Item key={item.url}>
|
|
|
- <Link to='/indexApi'>{item.name}</Link>
|
|
|
- </Menu.Item>
|
|
|
- })}
|
|
|
- </SubMenu>
|
|
|
- </Menu>
|
|
|
- </Sider>
|
|
|
- <Layout style={{ padding: '0 24px 24px' }}>
|
|
|
- <Content
|
|
|
- style={{
|
|
|
- background: '#fff',
|
|
|
- padding: 24,
|
|
|
- margin: 0,
|
|
|
- minHeight: 280,
|
|
|
- }}
|
|
|
- >
|
|
|
- <Switch>
|
|
|
- <Route exact path="/overview" component={Overview} />
|
|
|
- <Route path="/stocks" component={Stocks} />
|
|
|
- <Route path="/indexApi" component={IndexApi}/>
|
|
|
- </Switch>
|
|
|
- </Content>
|
|
|
- </Layout>
|
|
|
- </Layout>
|
|
|
- </Layout>
|
|
|
-
|
|
|
- )
|
|
|
- }
|
|
|
-
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
+ this.state = {
|
|
|
+ userInfo: {},
|
|
|
+ };
|
|
|
+ }
|
|
|
+ render() {
|
|
|
+ // let { match } = this.props;
|
|
|
+ return (
|
|
|
+ <Layout style={{ minHeight: "100vh" }}>
|
|
|
+ <Header className="header"></Header>
|
|
|
+ <Layout>
|
|
|
+ <Sider width={200} className="site-layout-background">
|
|
|
+ <Menu
|
|
|
+ mode="inline"
|
|
|
+ defaultSelectedKeys={["overview"]}
|
|
|
+ defaultOpenKeys={["overview"]}
|
|
|
+ style={{ height: "100%", borderRight: 0 }}
|
|
|
+ >
|
|
|
+ <Menu.Item key="overview" icon={<UserOutlined />}>
|
|
|
+ <Link to="/overview">总体说明</Link>
|
|
|
+ </Menu.Item>
|
|
|
+ <SubMenu
|
|
|
+ key="sub2"
|
|
|
+ icon={<LaptopOutlined />}
|
|
|
+ title="股票接口"
|
|
|
+ onClick={this.go}
|
|
|
+ >
|
|
|
+ {stocksApiList.map((item) => {
|
|
|
+ return (
|
|
|
+ <Menu.Item key={item.url}>
|
|
|
+ <Link to="/stocks">{item.name}</Link>
|
|
|
+ </Menu.Item>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </SubMenu>
|
|
|
+ <SubMenu
|
|
|
+ key="sub3"
|
|
|
+ icon={<NotificationOutlined />}
|
|
|
+ title="指数接口"
|
|
|
+ onClick={this.go}
|
|
|
+ >
|
|
|
+ {indexApiList.map((item) => {
|
|
|
+ return (
|
|
|
+ <Menu.Item key={item.url}>
|
|
|
+ <Link to="/indexApi">{item.name}</Link>
|
|
|
+ </Menu.Item>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </SubMenu>
|
|
|
+ </Menu>
|
|
|
+ </Sider>
|
|
|
+ <Layout style={{ padding: "0 24px 24px" }}>
|
|
|
+ <Content
|
|
|
+ style={{
|
|
|
+ background: "#fff",
|
|
|
+ padding: 24,
|
|
|
+ margin: 0,
|
|
|
+ minHeight: 280,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Switch>
|
|
|
+ <Route exact path="/overview" component={Overview} />
|
|
|
+ <Route path="/stocks" component={Stocks} />
|
|
|
+ <Route path="/indexApi" component={IndexApi} />
|
|
|
+ </Switch>
|
|
|
+ </Content>
|
|
|
+ </Layout>
|
|
|
+ </Layout>
|
|
|
+ </Layout>
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
-
|