| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- import React from "react";
- import "./indexBasicInfo.css";
- import { Typography, Table, Button } from "antd";
- const { Text, Title, Link } = Typography;
- class indexBasicInfo extends React.Component {
- constructor(props) {
- super(props);
- // this.title = title[props.location.pathname];
- }
- render() {
- console.log(this.props.location.state);
- const outPutList = this.props.location.state.outputResult;
- const errorList = this.props.location.state.errorResult;
- return (
- <div>
- <Title level={4}>{title[this.props.location.pathname]}</Title>
- <div>
- <Title className="stocks-title" level={5}>
- 输入参数:
- </Title>
- <Text>
- method=stock_info&code=股票代码×tamp=时间戳&sign=签名值
- </Text>
- </div>
- <div>
- <Title className="stocks-title" level={5}>
- 输出结果:
- </Title>
- <Table
- columns={columns}
- dataSource={outPutList}
- pagination={false}
- size="small"
- />
- </div>
- <div>
- <Title className="stocks-title" level={5}>
- 输出结果异常:
- </Title>
- <Table
- columns={errColumns}
- dataSource={errorList}
- pagination={false}
- size="small"
- />
- </div>
- <div>
- <Title className="stocks-title" level={5}>
- 测试地址:
- </Title>
- <Button type="primary" className="stocks-button">
- API测试工具
- </Button>
- </div>
- <div>
- <Title className="stocks-title" level={5}>
- SDK包:
- </Title>
- <Link>php程序包下载</Link>
- </div>
- </div>
- );
- }
- }
- export default indexBasicInfo;
- var title = {
- "/indexBasicInfo": "指数基本信息",
- "/indexNow": "指数当天信息",
- "/indexBefore": "指数回溯"
- };
- const columns = [
- {
- title: "名称",
- dataIndex: "name",
- key: "name",
- render: (text) => <span>{text}</span>
- },
- {
- title: "说明",
- dataIndex: "desc",
- key: "desc"
- }
- ];
- // var data = [
- // {
- // key: "1",
- // name: "message_code",
- // desc: 200
- // },
- // {
- // key: "2",
- // name: "message",
- // desc: "success"
- // },
- // {
- // key: "3",
- // name: "code",
- // desc: "指数代码"
- // },
- // {
- // key: "4",
- // name: "name",
- // desc: "指数名称"
- // },
- // {
- // key: "5",
- // name: "sector",
- // desc: "交易板块"
- // },
- // {
- // key: "6",
- // name: "sector",
- // desc: "所属市场"
- // }
- // ];
- const errColumns = [
- {
- title: "错误类型",
- dataIndex: "type",
- key: "type",
- render: (text) => <span>{text}</span>
- },
- {
- title: "message_code",
- dataIndex: "code",
- key: "code"
- },
- {
- title: "message",
- dataIndex: "message",
- key: "message"
- }
- ];
- // var errdata = [
- // {
- // key: "1",
- // type: "股票代码错误",
- // code: 301,
- // message: "股票代码不存在/错误"
- // },
- // {
- // key: "3",
- // type: "签名错误",
- // code: 304,
- // message: "非法签名"
- // },
- // {
- // key: "4",
- // type: "返回数据为空",
- // code: 401,
- // message: "股票数据为空"
- // },
- // {
- // key: "5",
- // type: "服务器错误",
- // code: 501,
- // message: "服务器错误"
- // }
- // ];
|