2017-07-11 19:12:13 +08:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import { Table, Button } from 'antd'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
|
|
|
class InterfaceTable extends Component {
|
|
|
|
static propTypes = {
|
2017-07-12 14:18:17 +08:00
|
|
|
data: PropTypes.array
|
2017-07-11 19:12:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const columns = [{
|
|
|
|
title: '接口名称',
|
|
|
|
dataIndex: 'name',
|
2017-07-12 14:18:17 +08:00
|
|
|
key: 'name'
|
2017-07-11 19:12:13 +08:00
|
|
|
}, {
|
|
|
|
title: '接口URL',
|
|
|
|
dataIndex: 'age',
|
2017-07-12 14:18:17 +08:00
|
|
|
key: 'age'
|
2017-07-11 19:12:13 +08:00
|
|
|
}, {
|
|
|
|
title: '操作者',
|
|
|
|
dataIndex: 'address',
|
2017-07-12 14:18:17 +08:00
|
|
|
key: 'address'
|
2017-07-11 19:12:13 +08:00
|
|
|
}, {
|
|
|
|
title: '更新日期',
|
|
|
|
dataIndex: 'date',
|
2017-07-12 14:18:17 +08:00
|
|
|
key: 'date'
|
2017-07-11 19:12:13 +08:00
|
|
|
}, {
|
|
|
|
title: '功能',
|
|
|
|
'key': 'action',
|
|
|
|
render: () => {
|
|
|
|
return (
|
|
|
|
<span>
|
2017-07-12 12:17:27 +08:00
|
|
|
<Button type="primary">编辑</Button>
|
|
|
|
<Button type="danger">删除</Button>
|
2017-07-11 19:12:13 +08:00
|
|
|
</span>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
|
|
|
|
const data = this.props.data;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<section className="interface-table">
|
|
|
|
<Table columns={columns} dataSource={data} />
|
|
|
|
</section>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-12 14:18:17 +08:00
|
|
|
export default InterfaceTable
|