|
@@ -1,7 +1,8 @@
|
|
|
import React, { useState } from "react";
|
|
|
-import { Form, Select, Input, message, Row } from 'antd'
|
|
|
+import { Form, Select, Input, message, Row, Col, InputNumber } from 'antd'
|
|
|
|
|
|
export default function StepFour({syncDataForm}) {
|
|
|
+ const [showPartitionTime, setShowPartitionTime] = useState(false)
|
|
|
return (
|
|
|
<>
|
|
|
<p
|
|
@@ -12,6 +13,159 @@ export default function StepFour({syncDataForm}) {
|
|
|
}}>
|
|
|
设置同步参数
|
|
|
</p>
|
|
|
+ <Form
|
|
|
+ name="syncForm"
|
|
|
+ form={syncDataForm}
|
|
|
+ labelCol={{
|
|
|
+ span: 2,
|
|
|
+ }}
|
|
|
+ wrapperCol={{
|
|
|
+ span: 6,
|
|
|
+ }}
|
|
|
+ initialValues={{
|
|
|
+ over_time: 0,
|
|
|
+ fail_times: 0
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Form.Item
|
|
|
+ label="路由策略"
|
|
|
+ name="route_method"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择路由策略'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Select
|
|
|
+ options={[
|
|
|
+ {label: '第一个', value: 'First'},
|
|
|
+ {label: '最后一个', value: 'Last'}
|
|
|
+ ]}
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="阻塞处理方式"
|
|
|
+ name="block_method"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择阻塞处理方式'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Select
|
|
|
+ options={[
|
|
|
+ {label: '单机串行', value: 'danji'},
|
|
|
+ {label: '丢弃后续调度', value: 'diuqi'},
|
|
|
+ {label: '覆盖之前调度', value: 'fugai'}
|
|
|
+ ]}
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="超时时间"
|
|
|
+ name="over_time"
|
|
|
+ required
|
|
|
+ >
|
|
|
+ <InputNumber />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="失败重试次数"
|
|
|
+ name="fail_times"
|
|
|
+ required
|
|
|
+ >
|
|
|
+ <InputNumber />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="增量开始时间"
|
|
|
+ name="add_begin_time"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入增量开始时间'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="增量时间字段"
|
|
|
+ name="add_time_field"
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </Form.Item>
|
|
|
+ <Row span={24}>
|
|
|
+ <Col span={8}>
|
|
|
+ <Form.Item
|
|
|
+ label="区分字段"
|
|
|
+ name="partition_field"
|
|
|
+ labelCol={{
|
|
|
+ span: 6,
|
|
|
+ }}
|
|
|
+ wrapperCol={{
|
|
|
+ span: 18,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Input onChange={(e) => {
|
|
|
+ if (e.target.value && !showPartitionTime) {
|
|
|
+ setShowPartitionTime(true)
|
|
|
+ } else if (!e.target.value && showPartitionTime) {
|
|
|
+ setShowPartitionTime(false)
|
|
|
+ }
|
|
|
+ }} />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ { showPartitionTime ?
|
|
|
+ <>
|
|
|
+ <Col span={8}>
|
|
|
+ <Form.Item
|
|
|
+ label="分区时间"
|
|
|
+ name="partition_time"
|
|
|
+ labelCol={{
|
|
|
+ span: 12,
|
|
|
+ }}
|
|
|
+ wrapperCol={{
|
|
|
+ span: 12,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Input placeholder="yyyy-MM-dd" />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col>
|
|
|
+ <InputNumber defaultValue={0} style={{marginLeft: '10px'}}/>
|
|
|
+ </Col>
|
|
|
+ </> : ''
|
|
|
+ }
|
|
|
+
|
|
|
+ </Row>
|
|
|
+ <Form.Item
|
|
|
+ label="定时规则"
|
|
|
+ name="time_rules"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入定时规则'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item
|
|
|
+ label="同步任务名称"
|
|
|
+ name="sync_task_name"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入定时规则'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </Form.Item>
|
|
|
+
|
|
|
+ </Form>
|
|
|
</>
|
|
|
)
|
|
|
}
|