知与行后台管理端

addChannel.jsx 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React from 'react';
  2. import { Form, Select, Input, Button } from 'antd';
  3. import channels from './channelList.less';
  4. const { TextArea } = Input;
  5. const { Option } = Select;
  6. class App extends React.Component {
  7. handleSubmit = e => {
  8. e.preventDefault();
  9. this.props.form.validateFields((err, values) => {
  10. console.log('Form.Item', values.note)
  11. if (!err) {
  12. alert('Received values of form: ', values);
  13. }
  14. });
  15. };
  16. render() {
  17. const { getFieldDecorator } = this.props.form;
  18. return (
  19. <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={this.handleSubmit}>
  20. <Form.Item label="渠道名称">
  21. {getFieldDecorator('note', {
  22. rules: [{ required: true, message: '请输入渠道名称' }],
  23. })(<Input className={channels.inpuit} / >)}
  24. </Form.Item>
  25. <Form.Item label="联系人">
  26. {getFieldDecorator('note2', {
  27. rules: [{ required: true, message: ' 请输入联系人' }],
  28. })(<Input className={channels.inpuit} />)}
  29. </Form.Item>
  30. <Form.Item label="联系电话">
  31. {getFieldDecorator('note3', {
  32. rules: [{ required: true, message: '请输入联系电话' }],
  33. })(<Input className={channels.inpuit} />)}
  34. </Form.Item>
  35. <Form.Item label="说明描述">
  36. <TextArea className={channels.inpuitTxt} rows={8} />
  37. </Form.Item>
  38. <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
  39. <Button type="primary" htmlType="submit">
  40. 保存
  41. </Button>
  42. <Button className={channels.formButton} type="primary" htmlType="submit">
  43. 取消
  44. </Button>
  45. </Form.Item>
  46. </Form>
  47. );
  48. }
  49. }
  50. const WrappedApp = Form.create({ name: 'coordinated' })(App);
  51. export default () => (
  52. <>
  53. <WrappedApp />
  54. </>
  55. );