瀏覽代碼

修改代码

cl 4 年之前
父節點
當前提交
42651fe26e

+ 27 - 5
boniu/src/components/indexBasicInfo/indexBasicInfo.css

@@ -12,13 +12,35 @@
   border-radius: 3px;
   background-color: #00c0ff;
 }
-.ant-typography {
-  display: block;
+.ant-table-cell {
+  padding-left: 25px !important;
 }
-.indent-level-1 {
+
+.no-tab .ant-table-cell {
   padding-left: 0 !important;
 }
 
-.h4 .ant-typography {
-  font-size: 24px;
+.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>
     );