Browse Source

修改部分代码

cl 4 years ago
parent
commit
5723bbef9a

File diff suppressed because it is too large
+ 1 - 1
boniu/.eslintcache


+ 1 - 0
boniu/debug.log

@@ -2,3 +2,4 @@
 [0125/192439.680:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [0126/021042.433:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [0127/055324.038:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
+[0128/055324.054:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 23 - 2
boniu/src/components/Navbar/navbar.jsx

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import { Route, Switch, Link, withRouter } from "react-router-dom";
 import Overview from "../../components/Overview/overview";
 import indexBasicInfo from "../../components/indexBasicInfo/indexBasicInfo";
-import stocksInfo from '../../components/StocksInfo/stocksInfo'
+import stocksInfo from "../../components/StocksInfo/stocksInfo";
 import stocksApiList from "../../StocksApiList";
 import indexApiList from "../../IndexApiList";
 import "antd/dist/antd.css";
@@ -19,7 +19,8 @@ class NavBar extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      userInfo: {}
+      userInfo: {},
+      opensubmenu: ["overview"]
     };
   }
   render() {
@@ -39,6 +40,26 @@ class NavBar extends Component {
               defaultOpenKeys={["overview"]}
               style={{ height: "100%", borderRight: 0 }}
               selectedKeys={pathNames}
+              onOpenChange={(item) => {
+                if (item.length < this.state.opensubmenu.length) {
+                  this.setState({
+                    opensubmenu: item
+                  });
+                  return;
+                }
+                this.setState({
+                  opensubmenu: item
+                });
+                item.slice(-1)[0] === "indexApi"
+                  ? this.props.history.push({
+                      pathname: indexApiList[0].url,
+                      state: indexApiList[0]
+                    })
+                  : this.props.history.push({
+                      pathname: stocksApiList[0].url,
+                      state: stocksApiList[0]
+                    });
+              }}
             >
               <Menu.Item key="overview" icon={<UserOutlined />}>
                 <Link to="/overview">总体说明</Link>

+ 7 - 0
boniu/src/components/indexBasicInfo/indexBasicInfo.css

@@ -15,3 +15,10 @@
 .ant-typography {
   display: block;
 }
+.indent-level-1 {
+  padding-left: 0 !important;
+}
+
+.h4 .ant-typography {
+  font-size: 24px;
+}