index.jsx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import React, { useEffect } from 'react'
  2. import { Form, Input, Modal, Row, Col, Select } from 'antd'
  3. import LazyCascader from '@/components/LazyCascader'
  4. import { useForm } from 'antd/lib/form/Form'
  5. const Addcontact = props => {
  6. const [form] = useForm()
  7. const { visible, onCancel, onConfirm, loading } = props
  8. const { Option } = Select
  9. const layout = {
  10. labelCol: { span: 6 }
  11. }
  12. function handleChange(value) {
  13. console.log(`selected ${value}`)
  14. }
  15. useEffect(() => {}, [visible])
  16. return (
  17. <div>
  18. <Modal
  19. title="添加联系人"
  20. width={800}
  21. onCancel={onCancel}
  22. visible={visible}
  23. confirmLoading={loading}
  24. onOk={() => {
  25. form.validateFields().then(values => {
  26. form.resetFields()
  27. onConfirm(values)
  28. })
  29. }}>
  30. <Form {...layout} form={form} name="basic">
  31. <Row>
  32. <Col span={12}>
  33. <Form.Item
  34. label="姓名"
  35. name="clientName"
  36. rules={[{ required: true, message: '姓名' }]}>
  37. <Input />
  38. </Form.Item>
  39. </Col>
  40. <Col span={12} />
  41. <Col span={12}>
  42. <Form.Item label="联系人地区" name="" rules={[{ message: '联系人地区' }]}>
  43. <LazyCascader key="LazyCascader" />
  44. </Form.Item>
  45. </Col>
  46. <Col span={12} />
  47. <Col span={12}>
  48. <Form.Item label="性别" name="gender" rules={[{ message: '性别' }]}>
  49. <Select onChange={handleChange}>
  50. <Option value="男">男</Option>
  51. <Option value="女">女</Option>
  52. </Select>
  53. </Form.Item>
  54. </Col>
  55. <Col span={12}>
  56. <Form.Item label="昵称" name="niceName" rules={[{ message: '昵称' }]}>
  57. <Input />
  58. </Form.Item>
  59. </Col>
  60. <Col span={12}>
  61. <Form.Item
  62. label="手机"
  63. name="telephone"
  64. rules={[{ required: true, message: '手机' }]}>
  65. <Input />
  66. </Form.Item>
  67. </Col>
  68. <Col span={12}>
  69. <Form.Item label="QQ" name="qq" rules={[{ required: true, message: 'QQ' }]}>
  70. <Input />
  71. </Form.Item>
  72. </Col>
  73. <Col span={12}>
  74. <Form.Item label="电话" name="phone" rules={[{ required: true, message: '电话' }]}>
  75. <Input />
  76. </Form.Item>
  77. </Col>
  78. <Col span={12}>
  79. <Form.Item label="邮箱" name="email" rules={[{ required: true, message: '邮箱' }]}>
  80. <Input />
  81. </Form.Item>
  82. </Col>
  83. <Col span={12}>
  84. <Form.Item label="联系人地址" name="address" rules={[{ message: '联系人地址' }]}>
  85. <Input />
  86. </Form.Item>
  87. </Col>
  88. <Col span={12}>
  89. <Form.Item label="联系人乘车" name="ride" rules={[{ message: '联系人乘车' }]}>
  90. <Input />
  91. </Form.Item>
  92. </Col>
  93. <Col span={12}>
  94. <Form.Item label="联系人地标" name="landmarks" rules={[{ message: '联系人地标' }]}>
  95. <Input />
  96. </Form.Item>
  97. </Col>
  98. <Col span={12}>
  99. <Form.Item label="联系人住宿" name="stay" rules={[{ message: '联系人住宿' }]}>
  100. <Input />
  101. </Form.Item>
  102. </Col>
  103. <Col span={12}>
  104. <Form.Item label="备注" name="mark" rules={[{ message: '备注' }]}>
  105. <Input />
  106. </Form.Item>
  107. </Col>
  108. </Row>
  109. </Form>
  110. </Modal>
  111. </div>
  112. )
  113. }
  114. export default Addcontact