3 次代码提交 5efbba5737 ... 33c172f8d1

作者 SHA1 备注 提交日期
  cl 33c172f8d1 修改子表以及参数说明 4 年之前
  cl 5a877ba887 Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/boniuApi 4 年之前
  cl 9c6781dbc9 拉取代码 4 年之前

文件差异内容过多而无法显示
+ 1 - 1
boniu/.eslintcache


+ 1 - 1
boniu/debug.log

@@ -1,3 +1,3 @@
 [0123/123906.155:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [0125/192439.680:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
-[0126/113710.760:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
+[0126/021042.433:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 159 - 3
boniu/src/IndexApiList.jsx

@@ -1,6 +1,7 @@
 const indexApiList = [
   {
     name: "指数基本信息",
+    inputpara: ["method=stock_info&code=股票代码&timestamp=时间戳&sign=签名值"],
     url: "/indexApi/indexBasicInfo",
     key: "indexBasic",
     data: {
@@ -66,6 +67,10 @@ const indexApiList = [
   },
   {
     name: "指数当天信息",
+    inputpara: [
+      "method=index_current_day&timestamp=时间戳&code=指数代码&sign=签名值",
+      "参数说明:如果取日期时间不是交易日,则使用这个日期之前的最近一个交易日"
+    ],
     url: "/indexApi/indexNow",
     key: "indexNow",
     data: {
@@ -166,6 +171,9 @@ const indexApiList = [
   },
   {
     name: "时间段信息(指数代码+起止日期)",
+    inputpara: [
+      "method=index_day_k&timestamp=时间戳&code=指数代码&sign=签名值&start_date=开始日期&end_date=结束日期&order=列表正序/倒序"
+    ],
     url: "/indexApi/indexQuant",
     key: "indexQuant",
     data: {
@@ -203,7 +211,64 @@ const indexApiList = [
         {
           key: "7",
           name: "list",
-          desc: ""
+          desc: "",
+          children: [
+            {
+              key: "3",
+              name: "code",
+              desc: "指数代码"
+            },
+            {
+              key: "4",
+              name: "name",
+              desc: "指数名称"
+            },
+            {
+              key: "5",
+              name: "date",
+              desc: "交易日期"
+            },
+            {
+              key: "6",
+              name: "open_price",
+              desc: "开盘价"
+            },
+            {
+              key: "7",
+              name: "close_price",
+              desc: "收盘价"
+            },
+            {
+              key: "8",
+              name: "highest_price",
+              desc: "最高价"
+            },
+            {
+              key: "9",
+              name: "lowest_price",
+              desc: "最低价"
+            },
+            {
+              key: "10",
+              name: "amount",
+              desc: "成交量"
+            },
+            {
+              key: "11",
+              name: "value",
+              desc: "成交金额"
+            },
+            {
+              key: "12",
+              name: "increase_ratio",
+              desc: "涨跌幅"
+            },
+            {
+              key: "13",
+              name: "increase_price",
+              desc: "涨跌额"
+            }
+          ]
         }
       ],
 
@@ -237,6 +302,10 @@ const indexApiList = [
   },
   {
     name: "指数回溯",
+    inputpara: [
+      "method=ndex_recent_days&timestamp=时间戳&code=指数代码&sign=签名值&start_date=开始日期&traceback_days=回溯天数&order=列表正序/倒序",
+      "参数说明:回溯天数,取交易日"
+    ],
     url: "/indexApi/indexBack",
     key: "indexBack",
     data: {
@@ -274,7 +343,64 @@ const indexApiList = [
         {
           key: "7",
           name: "list",
-          desc: ""
+          desc: "",
+          children: [
+            {
+              key: "3",
+              name: "code",
+              desc: "指数代码"
+            },
+            {
+              key: "4",
+              name: "name",
+              desc: "指数名称"
+            },
+            {
+              key: "5",
+              name: "date",
+              desc: "交易日期"
+            },
+            {
+              key: "6",
+              name: "open_price",
+              desc: "开盘价"
+            },
+            {
+              key: "7",
+              name: "close_price",
+              desc: "收盘价"
+            },
+            {
+              key: "8",
+              name: "highest_price",
+              desc: "最高价"
+            },
+            {
+              key: "9",
+              name: "lowest_price",
+              desc: "最低价"
+            },
+            {
+              key: "10",
+              name: "amount",
+              desc: "成交量"
+            },
+            {
+              key: "11",
+              name: "value",
+              desc: "成交金额"
+            },
+            {
+              key: "12",
+              name: "increase_ratio",
+              desc: "涨跌幅"
+            },
+            {
+              key: "13",
+              name: "increase_price",
+              desc: "涨跌额"
+            }
+          ]
         }
       ],
 
@@ -308,6 +434,10 @@ const indexApiList = [
   },
   {
     name: "指数某天信息",
+    inputpara: [
+      "method=index_any_day&timestamp=时间戳&code=指数代码&date=交易日",
+      "参数说明:无论是否查询日期是不是交易日,都输出结果,不需要向前推到最近的交易日"
+    ],
     url: "/indexApi/indexSomeDay",
     key: "indexSomeDay",
     data: {
@@ -402,6 +532,10 @@ const indexApiList = [
   },
   {
     name: "指数列表信息",
+    inputpara: [
+      "method=index_list&timestamp=时间戳&sign=签名值",
+      "参数说明:指数列表不分页"
+    ],
     url: "/indexApi/indexListInf",
     key: "indexListInf",
     data: {
@@ -419,7 +553,29 @@ const indexApiList = [
         {
           key: "3",
           name: "list",
-          desc: ""
+          desc: "",
+          children: [
+            {
+              key: "3",
+              name: "code",
+              desc: "指数代码"
+            },
+            {
+              key: "3",
+              name: "name",
+              desc: "指数名称"
+            },
+            {
+              key: "4",
+              name: "name",
+              desc: "sector"
+            },
+            {
+              key: "5",
+              name: "exchange",
+              desc: "所属市场"
+            }
+          ]
         }
       ],
       errorResult: [

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

@@ -12,3 +12,6 @@
   border-radius: 3px;
   background-color: #00c0ff;
 }
+.ant-typography {
+  display: block;
+}

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

@@ -10,7 +10,10 @@ class indexBasicInfo extends React.Component {
     // this.title = title[props.location.pathname];
   }
   render() {
-    const nowKey = this.props.location.state.key;
+    console.log(this.props.location.state);
+    const inputPara = this.props.location.state.inputpara.map((item) => {
+      return <Text>{item}</Text>;
+    });
     const outPutList = this.props.location.state.data.outputResult;
     const errorList = this.props.location.state.data.errorResult;
     const title = this.props.location.state.name;
@@ -21,9 +24,7 @@ class indexBasicInfo extends React.Component {
           <Title className="stocks-title" level={5}>
             输入参数:
           </Title>
-          <Text>
-            method=stock_info&code=股票代码&timestamp=时间戳&sign=签名值
-          </Text>
+          {inputPara}
         </div>
 
         <div>
@@ -32,21 +33,6 @@ class indexBasicInfo extends React.Component {
           </Title>
           <Table
             columns={columns}
-            expandable={{
-              expandedRowRender: (record) =>
-                record.name === "list" ? (
-                  <Table
-                    columns={columns}
-                    dataSource={
-                      nowKey !== "indexListInf" ? subListTime : subList
-                    }
-                    pagination={false}
-                  />
-                ) : (
-                  ""
-                ),
-              rowExpandable: (record) => record.name === "list"
-            }}
             dataSource={outPutList}
             pagination={false}
             size="small"
@@ -115,82 +101,3 @@ const errColumns = [
     key: "message"
   }
 ];
-var subList = [
-  {
-    key: "3",
-    name: "code",
-    desc: "指数代码"
-  },
-  {
-    key: "3",
-    name: "name",
-    desc: "指数名称"
-  },
-  {
-    key: "4",
-    name: "name",
-    desc: "sector"
-  },
-  {
-    key: "5",
-    name: "exchange",
-    desc: "所属市场"
-  }
-];
-var subListTime = [
-  {
-    key: "3",
-    name: "code",
-    desc: "指数代码"
-  },
-  {
-    key: "4",
-    name: "name",
-    desc: "指数名称"
-  },
-  {
-    key: "5",
-    name: "date",
-    desc: "交易日期"
-  },
-  {
-    key: "6",
-    name: "open_price",
-    desc: "开盘价"
-  },
-  {
-    key: "7",
-    name: "close_price",
-    desc: "收盘价"
-  },
-  {
-    key: "8",
-    name: "highest_price",
-    desc: "最高价"
-  },
-  {
-    key: "9",
-    name: "lowest_price",
-    desc: "最低价"
-  },
-  {
-    key: "10",
-    name: "amount",
-    desc: "成交量"
-  },
-  {
-    key: "11",
-    name: "value",
-    desc: "成交金额"
-  },
-  {
-    key: "12",
-    name: "increase_ratio",
-    desc: "涨跌幅"
-  },
-  {
-    key: "13",
-    name: "increase_price",
-    desc: "涨跌额"
-  }
-];