|
@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react' |
|
|
import { Spin, Popconfirm, Tree, Row, Col, Button, Input, Table } from 'antd'; |
|
|
import { Spin, Popconfirm, Tree, Row, Col, Button, Input, Table } from 'antd'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
|
|
import moment from 'moment'; |
|
|
const TreeNode = Tree.TreeNode; |
|
|
import './style.less'; |
|
|
function DataSourceManagement(props) { |
|
|
function DataSourceManagement(props) { |
|
|
const { loading, clientHeight, actions, dispatch, dataSources, adapters } = props; |
|
|
const { loading, clientHeight, actions, dispatch, dataSources, adapters } = props; |
|
|
const [pageSize, setPageSize] = useState(10); |
|
|
const [pageSize, setPageSize] = useState(10); |
|
@ -52,7 +52,7 @@ function DataSourceManagement(props) { |
|
|
dataIndex: 'control', |
|
|
dataIndex: 'control', |
|
|
render: (text, record) => { |
|
|
render: (text, record) => { |
|
|
const adapterInfo = adapters?.find(s => s.id == record?.adapter) |
|
|
const adapterInfo = adapters?.find(s => s.id == record?.adapter) |
|
|
return adapterInfo?.toolName |
|
|
return adapterInfo?.mode |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -65,11 +65,14 @@ function DataSourceManagement(props) { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '修改时间', |
|
|
title: '修改时间', |
|
|
dataIndex: 'nullable', |
|
|
dataIndex: 'time', |
|
|
|
|
|
render: (text, record) => moment(record?.time).format('YYYY-MM-DD HH:mm:ss') |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '描述', |
|
|
title: '描述', |
|
|
dataIndex: 'description', |
|
|
dataIndex: 'description', |
|
|
|
|
|
ellipsis: true, |
|
|
|
|
|
search: false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '操作', |
|
|
title: '操作', |
|
@ -96,14 +99,15 @@ function DataSourceManagement(props) { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
return <Spin spinning={loading}> |
|
|
return <Spin spinning={loading}> |
|
|
<Row style={{ marginBottom: 16 }}> |
|
|
<Row className='protable-title'> |
|
|
<Col span={12}><Button type='primary'>新建</Button></Col> |
|
|
<Col span={12}><Button type='primary'>新建</Button></Col> |
|
|
<Col span={12} style={{ textAlign: 'right' }}><Input |
|
|
<Col span={12} style={{ textAlign: 'right' }}><Input |
|
|
value={searchValue} onChange={e => { setSearchValue(e.target.value) }} |
|
|
value={searchValue} onChange={e => { setSearchValue(e.target.value) }} |
|
|
style={{ width: 220, marginRight: 15 }} placeholder="数据源名称" /><Button onClick={() => { queryData() }} type='primary'>查询</Button></Col> |
|
|
style={{ width: 220, marginRight: 15 }} placeholder="数据源名称" /><Button onClick={() => { queryData() }} type='primary'>查询</Button></Col> |
|
|
</Row> |
|
|
</Row> |
|
|
<Table |
|
|
<ProTable |
|
|
columns={columns} |
|
|
columns={columns} |
|
|
dateFormatter="string" |
|
|
dateFormatter="string" |
|
|
search={false} |
|
|
search={false} |
|
|