1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import React from 'react';
import { Form, Input, Modal } from 'antd';
import DictionarySelect from '../../components/Dictionary/DictionarySelect';
import dictionary from '../../utils/dictionary';
/**
* table 查询
*
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
const SignListModal = Form.create()(props => {
const { onOk, onCancel, visible, title, form, initData = {} } = props;
const { getFieldDecorator, validateFields } = props.form;
function handleOk(e) {
e.preventDefault();
validateFields((err, fields) => {
const searchParams = fields;
if (onOk) {
onOk(searchParams);
form.resetFields();
}
});
}
function handleCancel() {
if (onCancel) {
onCancel();
}
}
const formItemLayout = {
labelCol: { span: 4 },
wrapperCol: { span: 18 },
};
return (
<Modal title={title} visible={visible} onOk={handleOk} onCancel={handleCancel}>
<Form>
<Form.Item {...formItemLayout} label="签名">
{getFieldDecorator('sign', {
rules: [
{
required: true,
message: '请输入签名',
},
],
initialValue: initData.sign,
})(<Input placeholder="请输入签名" />)}
</Form.Item>
<Form.Item {...formItemLayout} label="平台">
{getFieldDecorator('platform', {
rules: [
{
required: true,
message: '请选择平台',
},
],
initialValue: initData.platform,
})(<DictionarySelect dicKey={dictionary.SMS_PLATFORM} />)}
</Form.Item>
</Form>
</Modal>
);
});
export default SignListModal;