|
|
@ -9,14 +9,24 @@ import { |
|
|
|
|
|
|
|
import '../../style.less'; |
|
|
|
function StepOne(props) { |
|
|
|
const { next, stepOneValues, stepOneValuesFinish } = props; |
|
|
|
const { next, stepOneValues, stepOneValuesFinish, readOnly, dataSources, stepOneInitValue } = props; |
|
|
|
const formRef = React.createRef(); |
|
|
|
const initialValues = stepOneValues ? stepOneValues : { |
|
|
|
adapter: 'PostgreSQL采集适配器', |
|
|
|
version: '9.x', |
|
|
|
adapterName: 'PostgreSQL采集适配器', |
|
|
|
adapterVersion: '9.x', |
|
|
|
mode: '数据库连接', |
|
|
|
source: '库表/目录1', |
|
|
|
mountPath: 1, |
|
|
|
} |
|
|
|
|
|
|
|
const checkName = async (rule, value) => { |
|
|
|
let filter = dataSources?.rows?.find(s => s?.name == value && value !== stepOneInitValue?.name) |
|
|
|
if (filter) { |
|
|
|
return Promise.reject(new Error('已存该数据源名称!')); |
|
|
|
} |
|
|
|
return Promise.resolve(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const formItemLayout = { labelCol: { span: 3 }, wrapperCol: { span: 10 } }; |
|
|
|
return <> |
|
|
|
<ProForm |
|
|
@ -41,10 +51,12 @@ function StepOne(props) { |
|
|
|
}, |
|
|
|
}} |
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<ProFormText |
|
|
|
rules={[{ required: true, message: '请输入数据源名称' }, |
|
|
|
{ max: 255, message: '数据源名称长度不能大于255个字符' }, |
|
|
|
rules={[ |
|
|
|
{ required: true, message: '请输入数据源名称' }, |
|
|
|
{ max: 255, message: '数据源名称长度不能大于255个字符' }, |
|
|
|
{ validator: checkName } |
|
|
|
]} |
|
|
|
name="name" |
|
|
|
label="数据源名称" |
|
|
@ -55,9 +67,9 @@ function StepOne(props) { |
|
|
|
options={[ |
|
|
|
{ label: 'PostgreSQL采集适配器', value: 'PostgreSQL采集适配器' }, |
|
|
|
]} |
|
|
|
name="adapter" |
|
|
|
name="adapterName" |
|
|
|
label="适配器" |
|
|
|
disabled={true} |
|
|
|
disabled={readOnly} |
|
|
|
/> |
|
|
|
|
|
|
|
<ProFormSelect |
|
|
@ -65,9 +77,9 @@ function StepOne(props) { |
|
|
|
options={[ |
|
|
|
{ label: '9.x', value: '9.x' }, |
|
|
|
]} |
|
|
|
name="version" |
|
|
|
name="adapterVersion" |
|
|
|
label="工具版本" |
|
|
|
disabled={true} |
|
|
|
disabled={readOnly} |
|
|
|
/> |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
@ -76,16 +88,16 @@ function StepOne(props) { |
|
|
|
]} |
|
|
|
name="mode" |
|
|
|
label="采集模式" |
|
|
|
disabled={true} |
|
|
|
disabled={readOnly} |
|
|
|
/> |
|
|
|
<ProFormSelect |
|
|
|
rules={[{ required: true, message: '请选择输入控件' }]} |
|
|
|
options={[ |
|
|
|
{ label: '库表/目录1', value: '库表/目录1' }, |
|
|
|
{ label: '库表/目录1', value: 1 }, |
|
|
|
]} |
|
|
|
name="source" |
|
|
|
name="mountPath" |
|
|
|
label="数据源挂载路径" |
|
|
|
disabled={true} |
|
|
|
// disabled={true}
|
|
|
|
/> |
|
|
|
|
|
|
|
<ProFormTextArea |
|
|
|