3 Commits feade6e17a ... 42651fe26e

Autor SHA1 Mensaje Fecha
  cl 42651fe26e 修改代码 hace 4 años
  cl d3514c15af Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/boniuApi hace 4 años
  cl 5723bbef9a 修改部分代码 hace 4 años

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 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 - 13
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,19 +19,10 @@ class NavBar extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      userInfo: {}
+      userInfo: {},
+      opensubmenu: ["overview"]
     };
   }
-  clickHandler = (arr) => {
-    const stocks = stocksApiList[0]
-    const index = indexApiList[0]
-    console.log(arr)
-    if (arr.includes('stocks')) {
-      this.props.history.push({pathname: stocks.url, state: stocks})
-    } else if (arr.includes('indexApi')) {
-      this.props.history.push({pathname: index.url, state: index})
-    }
-  }
   render() {
     // let { match } = this.props;
     const pathNames = this.props.history.location.pathname;
@@ -44,12 +35,31 @@ class NavBar extends Component {
         <Layout>
           <Sider width={200} className="site-layout-background">
             <Menu
-              onOpenChange={ (arr) => this.clickHandler(arr) }
               mode="inline"
               defaultSelectedKeys={["overview"]}
               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>

+ 31 - 2
boniu/src/components/indexBasicInfo/indexBasicInfo.css

@@ -12,6 +12,35 @@
   border-radius: 3px;
   background-color: #00c0ff;
 }
-.ant-typography {
-  display: block;
+.ant-table-cell {
+  padding-left: 25px !important;
+}
+
+.no-tab .ant-table-cell {
+  padding-left: 0 !important;
+}
+
+.ant-table-thead .ant-table-cell:nth-child(1) {
+  padding-left: 25px !important;
+}
+.first-table tr {
+  display: flex;
+}
+.first-table .ant-table-cell:nth-child(1) {
+  flex: 2;
+}
+.first-table .ant-table-cell:nth-child(2) {
+  flex: 1;
+}
+.second-table tr {
+  display: flex;
+}
+.second-table .ant-table-cell {
+  flex: 1;
+}
+.indent-level-1 {
+  padding-left: 0 !important;
+}
+h4.ant-typography {
+  font-size: 24px !important;
 }

+ 15 - 5
boniu/src/components/indexBasicInfo/indexBasicInfo.jsx

@@ -3,14 +3,23 @@ import "./indexBasicInfo.css";
 import { Typography, Table, Button } from "antd";
 
 const { Text, Title, Link } = Typography;
-
+function hasClass(para) {
+  let flag = false;
+  para.forEach((item) => {
+    if (item.children) {
+      flag = true;
+    }
+  });
+  return flag;
+}
 class indexBasicInfo extends React.Component {
   constructor(props) {
     super(props);
     // this.title = title[props.location.pathname];
   }
   render() {
-    const apiUrl = this.props.location.state.apiurl;
+    const sdkurl = this.props.location.state.sdk_url;
+    const apiurl = this.props.location.state.apiurl;
     const inputPara = this.props.location.state.inputpara.map((item, index) => {
       return <Text key={index}>{item}</Text>;
     });
@@ -32,6 +41,7 @@ class indexBasicInfo extends React.Component {
             输出结果:
           </Title>
           <Table
+            className={{ "no-tab": hasClass(outPutList), "first-table": true }}
             columns={columns}
             dataSource={outPutList}
             pagination={false}
@@ -39,7 +49,7 @@ class indexBasicInfo extends React.Component {
           />
         </div>
         <div>
-          <Title className="stocks-title" level={5}>
+          <Title className={"stocks-title"} level={5}>
             输出结果异常:
           </Title>
           <Table
@@ -55,7 +65,7 @@ class indexBasicInfo extends React.Component {
             测试地址:
           </Title>
           <Button type="primary" className="stocks-button">
-            <a href={apiUrl} target="_blank">
+            <a href={apiurl} target="_blank">
               API测试工具
             </a>
           </Button>
@@ -64,7 +74,7 @@ class indexBasicInfo extends React.Component {
           <Title className="stocks-title" level={5}>
             SDK包:
           </Title>
-          <Link href="http://boniu.xazhima.com/sdk/index_any_day.sdk">php程序包下载</Link>
+          <Link href={sdkurl}>php程序包下载</Link>
         </div>
       </div>
     );