datasource.jsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React from 'react'
  2. import { Tabs, Input, Button, Table, Icon, Divider } from 'antd'
  3. const { TabPane } = Tabs
  4. const { Search } = Input
  5. import './dataSource.less'
  6. class DataSource extends React.Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. }
  11. };
  12. render() {
  13. const columns = [{
  14. title: '名称',
  15. dataIndex: 'name',
  16. key: 'name'
  17. }, {
  18. title: '标签',
  19. dataIndex: 'tag',
  20. key: 'tag',
  21. }, {
  22. title: '说明',
  23. dataIndex: 'description',
  24. key: 'description',
  25. }, {
  26. title: '创建人',
  27. dataIndex: 'creator',
  28. key: 'creator'
  29. }, {
  30. title: '创建时间',
  31. dataIndex: 'createTime',
  32. key: 'createTime'
  33. }, {
  34. title: '操作',
  35. key: 'action',
  36. render: (text, record) => (
  37. <span>
  38. <a href="javascript:;">Action 一 {record.name}</a>
  39. <Divider type="vertical" />
  40. <a href="javascript:;">Delete</a>
  41. <Divider type="vertical" />
  42. <a href="javascript:;" className="ant-dropdown-link">
  43. More actions <Icon type="down" />
  44. </a>
  45. </span>
  46. ),
  47. }];
  48. return (
  49. <Tabs
  50. className='datasource-tabs'
  51. type="card"
  52. defaultActiveKey="1"
  53. tabBarExtraContent={
  54. <div className='datasource-tabs-tools'>
  55. <Search
  56. placeholder="input search text"
  57. onSearch={value => console.log(value)}
  58. />
  59. <Button><Icon type="plus" />添加数据源</Button>
  60. </div>
  61. }
  62. >
  63. <TabPane tab="公共数据源" key="1" >
  64. <Table columns={columns} dataSource={[]} />
  65. </TabPane>
  66. <TabPane tab="我的数据源" key="2" >
  67. {/* CSV/XLS组件 */}
  68. </TabPane>
  69. </Tabs>
  70. )
  71. }
  72. }
  73. export default DataSource