|
|
@ -1,5 +1,5 @@ |
|
|
|
import React, { useEffect, useState } from 'react' |
|
|
|
import { Button, Spin, Input, Row, Col } from 'antd'; |
|
|
|
import React, { useRef } from 'react' |
|
|
|
import { Button, Spin } from 'antd'; |
|
|
|
import { |
|
|
|
ProForm, |
|
|
|
ProFormSelect, |
|
|
@ -12,7 +12,6 @@ import { push } from 'react-router-redux'; |
|
|
|
import '../../style.less'; |
|
|
|
function StepOne(props) { |
|
|
|
const { next, stepOneValues, stepOneValuesFinish, readOnly, treeData, dataSources, dispatch, refresh, loading, editData } = props; |
|
|
|
const formRef = React.createRef(); |
|
|
|
const initialValues = stepOneValues ? stepOneValues : { |
|
|
|
adapterName: 'PostgreSQL采集适配器', |
|
|
|
adapterVersion: '9.x', |
|
|
@ -42,8 +41,10 @@ function StepOne(props) { |
|
|
|
return treeData |
|
|
|
} |
|
|
|
const treeDataFilter = treeData && dataSources?.rows?.length > 0 ? getTreeNodeData(treeData, null, 'rc') : [] |
|
|
|
const formRef = useRef(); |
|
|
|
return <Spin spinning={loading || treeDataFilter.length == 0}> |
|
|
|
<ProForm |
|
|
|
formRef={formRef} |
|
|
|
title={''} |
|
|
|
initialValues={initialValues} |
|
|
|
layout="horizontal" |
|
|
@ -114,6 +115,7 @@ function StepOne(props) { |
|
|
|
// disabled={true}
|
|
|
|
/> */} |
|
|
|
{treeDataFilter.length > 0 ? <ProFormTreeSelect |
|
|
|
key={JSON.stringify(treeDataFilter)} |
|
|
|
// width={'md'}
|
|
|
|
name="catalogKey" |
|
|
|
label="数据源挂载路径" |
|
|
@ -144,6 +146,9 @@ function StepOne(props) { |
|
|
|
dispatch(push(`/metadataManagement/latestMetadata`)); |
|
|
|
}} style={{ marginRight: 8 }}>新建</a> |
|
|
|
<a onClick={() => { |
|
|
|
formRef?.current?.setFieldsValue({ |
|
|
|
catalogKey: null |
|
|
|
}) |
|
|
|
refresh() |
|
|
|
}}>刷新</a> |
|
|
|
</>} |
|
|
@ -153,6 +158,7 @@ function StepOne(props) { |
|
|
|
options={[]} |
|
|
|
name="catalogKey" |
|
|
|
label="数据源挂载路径" |
|
|
|
|
|
|
|
placeholder="请选择数据源挂载路径" |
|
|
|
disabled={editData} |
|
|
|
/>} |
|
|
@ -169,7 +175,7 @@ function StepOne(props) { |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
</ProForm> |
|
|
|
</Spin> |
|
|
|
</Spin > |
|
|
|
} |
|
|
|
|
|
|
|
export default StepOne |