|
@ -40,72 +40,84 @@ function StepOne(props) { |
|
|
} |
|
|
} |
|
|
return treeData |
|
|
return treeData |
|
|
} |
|
|
} |
|
|
const treeDataFilter = treeData && dataSources?.rows?.length > 0 ? getTreeNodeData(treeData, null, 'rc') : [] |
|
|
const renderAddonAfter = () => { |
|
|
|
|
|
return !editData && <> |
|
|
|
|
|
<a onClick={() => { |
|
|
|
|
|
dispatch(push(`/metadataManagement/latestMetadata`)); |
|
|
|
|
|
}} style={{ marginRight: 8 }}>新建</a> |
|
|
|
|
|
<a onClick={() => { |
|
|
|
|
|
formRef?.current?.setFieldsValue({ |
|
|
|
|
|
catalogKey: null |
|
|
|
|
|
}) |
|
|
|
|
|
refresh && refresh() |
|
|
|
|
|
}}>刷新</a> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
const treeDataFilter = treeData ? getTreeNodeData(treeData, null, 'rc') : [] |
|
|
const formRef = useRef(); |
|
|
const formRef = useRef(); |
|
|
return <Spin spinning={loading || treeDataFilter.length == 0}> |
|
|
return <ProForm |
|
|
<ProForm |
|
|
formRef={formRef} |
|
|
formRef={formRef} |
|
|
title={''} |
|
|
title={''} |
|
|
initialValues={initialValues} |
|
|
initialValues={initialValues} |
|
|
layout="horizontal" |
|
|
layout="horizontal" |
|
|
grid={true} |
|
|
grid={true} |
|
|
{...formItemLayout} |
|
|
{...formItemLayout} |
|
|
modalProps={{ |
|
|
modalProps={{ |
|
|
destroyOnClose: true, |
|
|
destroyOnClose: true, |
|
|
onCancel: () => { }, |
|
|
onCancel: () => { }, |
|
|
}} |
|
|
}} |
|
|
onFinish={async (values) => { |
|
|
onFinish={async (values) => { |
|
|
values.mountPath = values.catalogKey.split('-')[values.catalogKey.split('-')?.length - 1] |
|
|
values.mountPath = values.catalogKey.split('-')[values.catalogKey.split('-')?.length - 1] |
|
|
next() |
|
|
next() |
|
|
stepOneValuesFinish(values) |
|
|
stepOneValuesFinish(values) |
|
|
return true; |
|
|
return true; |
|
|
}} |
|
|
}} |
|
|
style={{ marginTop: 20 }} |
|
|
style={{ marginTop: 20 }} |
|
|
submitter={{ |
|
|
submitter={{ |
|
|
render: (props, defaultDoms) => { |
|
|
render: (props, defaultDoms) => { |
|
|
return null; |
|
|
return null; |
|
|
}, |
|
|
}, |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<ProFormText |
|
|
<ProFormText |
|
|
rules={[ |
|
|
rules={[ |
|
|
{ required: true, message: '请输入数据源名称' }, |
|
|
{ required: true, message: '请输入数据源名称' }, |
|
|
{ max: 255, message: '数据源名称长度不能大于255个字符' }, |
|
|
{ max: 255, message: '数据源名称长度不能大于255个字符' }, |
|
|
]} |
|
|
]} |
|
|
name="name" |
|
|
name="name" |
|
|
label="数据源名称" |
|
|
label="数据源名称" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: 'PostgreSQL采集适配器', value: 'PostgreSQL采集适配器' }, |
|
|
{ label: 'PostgreSQL采集适配器', value: 'PostgreSQL采集适配器' }, |
|
|
]} |
|
|
]} |
|
|
name="adapterName" |
|
|
name="adapterName" |
|
|
label="适配器" |
|
|
label="适配器" |
|
|
disabled={readOnly} |
|
|
disabled={readOnly} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: '9.x', value: '9.x' }, |
|
|
{ label: '9.x', value: '9.x' }, |
|
|
]} |
|
|
]} |
|
|
name="adapterVersion" |
|
|
name="adapterVersion" |
|
|
label="工具版本" |
|
|
label="工具版本" |
|
|
disabled={readOnly} |
|
|
disabled={readOnly} |
|
|
/> |
|
|
/> |
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: '数据库连接', value: '数据库连接' }, |
|
|
{ label: '数据库连接', value: '数据库连接' }, |
|
|
]} |
|
|
]} |
|
|
name="mode" |
|
|
name="mode" |
|
|
label="采集模式" |
|
|
label="采集模式" |
|
|
disabled={readOnly} |
|
|
disabled={readOnly} |
|
|
/> |
|
|
/> |
|
|
{/* <ProFormSelect |
|
|
{/* <ProFormSelect |
|
|
rules={[{ required: true, message: '请选择输入控件' }]} |
|
|
rules={[{ required: true, message: '请选择输入控件' }]} |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: '库表/目录1', value: 1 }, |
|
|
{ label: '库表/目录1', value: 1 }, |
|
@ -114,68 +126,58 @@ function StepOne(props) { |
|
|
label="数据源挂载路径" |
|
|
label="数据源挂载路径" |
|
|
// disabled={true}
|
|
|
// disabled={true}
|
|
|
/> */} |
|
|
/> */} |
|
|
{treeDataFilter.length > 0 ? <ProFormTreeSelect |
|
|
{treeDataFilter.length > 0 ? <ProFormTreeSelect |
|
|
key={JSON.stringify(treeDataFilter)} |
|
|
key={JSON.stringify(treeDataFilter)} |
|
|
// width={'md'}
|
|
|
// width={'md'}
|
|
|
name="catalogKey" |
|
|
name="catalogKey" |
|
|
label="数据源挂载路径" |
|
|
label="数据源挂载路径" |
|
|
placeholder="请选择数据源挂载路径" |
|
|
placeholder="请选择数据源挂载路径" |
|
|
rules={[{ required: true, message: '请选择数据源挂载路径' }]} |
|
|
rules={[{ required: true, message: '请选择数据源挂载路径' }]} |
|
|
allowClear |
|
|
allowClear |
|
|
width={480} |
|
|
width={480} |
|
|
secondary |
|
|
secondary |
|
|
request={async () => { |
|
|
request={async () => { |
|
|
return treeDataFilter || []; |
|
|
return treeDataFilter || []; |
|
|
}} |
|
|
}} |
|
|
// tree-select args
|
|
|
// tree-select args
|
|
|
fieldProps={{ |
|
|
fieldProps={{ |
|
|
showArrow: false, |
|
|
showArrow: false, |
|
|
filterTreeNode: true, |
|
|
filterTreeNode: true, |
|
|
showSearch: true, |
|
|
showSearch: true, |
|
|
dropdownMatchSelectWidth: false, |
|
|
dropdownMatchSelectWidth: false, |
|
|
labelInValue: false, |
|
|
labelInValue: false, |
|
|
autoClearSearchValue: true, |
|
|
autoClearSearchValue: true, |
|
|
multiple: false, |
|
|
multiple: false, |
|
|
treeNodeFilterProp: 'title', |
|
|
treeNodeFilterProp: 'title', |
|
|
fieldNames: { |
|
|
fieldNames: { |
|
|
label: 'title', |
|
|
label: 'title', |
|
|
}, |
|
|
}, |
|
|
}} |
|
|
}} |
|
|
addonAfter={!editData && <> |
|
|
addonAfter={renderAddonAfter()} |
|
|
<a onClick={() => { |
|
|
disabled={editData} |
|
|
dispatch(push(`/metadataManagement/latestMetadata`)); |
|
|
/> : <ProFormSelect |
|
|
}} style={{ marginRight: 8 }}>新建</a> |
|
|
width={480} |
|
|
<a onClick={() => { |
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
formRef?.current?.setFieldsValue({ |
|
|
options={[]} |
|
|
catalogKey: null |
|
|
name="catalogKey" |
|
|
}) |
|
|
label="数据源挂载路径" |
|
|
refresh() |
|
|
addonAfter={renderAddonAfter()} |
|
|
}}>刷新</a> |
|
|
placeholder="请选择数据源挂载路径" |
|
|
</>} |
|
|
disabled={editData} |
|
|
disabled={editData} |
|
|
/>} |
|
|
/> : <ProFormSelect |
|
|
|
|
|
rules={[{ required: true, message: '请选择' }]} |
|
|
|
|
|
options={[]} |
|
|
|
|
|
name="catalogKey" |
|
|
|
|
|
label="数据源挂载路径" |
|
|
|
|
|
|
|
|
|
|
|
placeholder="请选择数据源挂载路径" |
|
|
|
|
|
disabled={editData} |
|
|
|
|
|
/>} |
|
|
|
|
|
|
|
|
|
|
|
<ProFormTextArea |
|
|
<ProFormTextArea |
|
|
name="description" |
|
|
name="description" |
|
|
label="描述" |
|
|
label="描述" |
|
|
rules={[{ max: 255, message: '描述长度不能大于255个字符' }]} |
|
|
rules={[{ max: 255, message: '描述长度不能大于255个字符' }]} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<div className='step-footer'> |
|
|
<div className='step-footer'> |
|
|
<Button type="primary" htmlType="submit"> |
|
|
<Button type="primary" htmlType="submit"> |
|
|
下一步 |
|
|
下一步 |
|
|
</Button> |
|
|
</Button> |
|
|
</div> |
|
|
</div> |
|
|
</ProForm> |
|
|
</ProForm> |
|
|
</Spin > |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default StepOne |
|
|
export default StepOne |