|
@@ -1,5 +1,6 @@
|
|
|
import { Form, Row, Col, Input, Button, Cascader, Select, Tag } from 'antd'
|
|
import { Form, Row, Col, Input, Button, Cascader, Select, Tag } from 'antd'
|
|
|
import React, { useEffect,useRef,useState } from 'react'
|
|
import React, { useEffect,useRef,useState } from 'react'
|
|
|
|
|
+import EditableForm from '@/components/EditableForm'
|
|
|
// eslint-disable-next-line import/no-unresolved
|
|
// eslint-disable-next-line import/no-unresolved
|
|
|
// import '../Contacts/index.scss'
|
|
// import '../Contacts/index.scss'
|
|
|
|
|
|
|
@@ -7,10 +8,113 @@ const ContanctForm = props => {
|
|
|
const actionRef = useRef()
|
|
const actionRef = useRef()
|
|
|
const [form] = Form.useForm()
|
|
const [form] = Form.useForm()
|
|
|
const { client } = props
|
|
const { client } = props
|
|
|
|
|
+ const record = {
|
|
|
|
|
+ clientname: '啊实打实大',
|
|
|
|
|
+ address: '珠海',
|
|
|
|
|
+ age: 16
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const columns = [
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'clientname',
|
|
|
|
|
+ label: '姓名',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'companyname',
|
|
|
|
|
+ label: '客户名称',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'gender',
|
|
|
|
|
+ label: '性别',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'nicename',
|
|
|
|
|
+ label: '昵称',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'telephone',
|
|
|
|
|
+ label: '手机',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'qq',
|
|
|
|
|
+ label: 'QQ',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'phone',
|
|
|
|
|
+ label: '电话',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'email',
|
|
|
|
|
+ label: '邮箱',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'fax',
|
|
|
|
|
+ label: '传真',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'department',
|
|
|
|
|
+ label: '部门',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'position',
|
|
|
|
|
+ label: '职务',
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'office',
|
|
|
|
|
+ label: '办公室',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'address',
|
|
|
|
|
+ label: '联系人地址',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'ride',
|
|
|
|
|
+ label: '联系人乘车',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'landmarks',
|
|
|
|
|
+ label: '联系人地标',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'stay',
|
|
|
|
|
+ label: '联系人住宿',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'mark',
|
|
|
|
|
+ label: '备注',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'gerenbiaoqian',
|
|
|
|
|
+ label: '个人标签',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'xiezuobiaoqian',
|
|
|
|
|
+ label: '协作标签',
|
|
|
|
|
+ span: 24
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- // console.log(client)
|
|
|
|
|
- form.setFieldsValue(client)
|
|
|
|
|
|
|
+ console.log(client)
|
|
|
|
|
+ // form.setFieldsValue(client)
|
|
|
}, [client])
|
|
}, [client])
|
|
|
const residences = [
|
|
const residences = [
|
|
|
{
|
|
{
|
|
@@ -50,23 +154,24 @@ const ContanctForm = props => {
|
|
|
<div>
|
|
<div>
|
|
|
<Row>
|
|
<Row>
|
|
|
<Col span={12}>
|
|
<Col span={12}>
|
|
|
- <h2>刘泽富</h2>
|
|
|
|
|
|
|
+ <h2>{client.clientname}</h2>
|
|
|
</Col>
|
|
</Col>
|
|
|
{/* className={[ 'text-right', styles.textMuted ]} */}
|
|
{/* className={[ 'text-right', styles.textMuted ]} */}
|
|
|
<Col span={12} className="zh-text-right zh-gray">
|
|
<Col span={12} className="zh-text-right zh-gray">
|
|
|
陈特 创建于 2019年5月6日 14:55
|
|
陈特 创建于 2019年5月6日 14:55
|
|
|
</Col>
|
|
</Col>
|
|
|
</Row>
|
|
</Row>
|
|
|
- <Form layout="vertical" form={form}>
|
|
|
|
|
|
|
+ <EditableForm dataSource={record} columns={columns} />
|
|
|
|
|
+ {/* <Form layout="vertical" form={form}>
|
|
|
<Form.Item label="姓名" name="clientname" rules={[{ required: false, message: '姓名' }]}>
|
|
<Form.Item label="姓名" name="clientname" rules={[{ required: false, message: '姓名' }]}>
|
|
|
<Input value="刘泽富" />
|
|
<Input value="刘泽富" />
|
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
- {/* <Form.Item
|
|
|
|
|
|
|
+ <Form.Item
|
|
|
label="联系人地区"
|
|
label="联系人地区"
|
|
|
name="district"
|
|
name="district"
|
|
|
rules={[{ required: false, message: '地区' }]}>
|
|
rules={[{ required: false, message: '地区' }]}>
|
|
|
<Cascader options={residences} />
|
|
<Cascader options={residences} />
|
|
|
- </Form.Item> */}
|
|
|
|
|
|
|
+ </Form.Item>
|
|
|
<Form.Item
|
|
<Form.Item
|
|
|
label="客户名称"
|
|
label="客户名称"
|
|
|
name="companyname"
|
|
name="companyname"
|
|
@@ -177,22 +282,7 @@ const ContanctForm = props => {
|
|
|
<Tag color="#FF69B4">协作标签2</Tag>
|
|
<Tag color="#FF69B4">协作标签2</Tag>
|
|
|
</span>
|
|
</span>
|
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
- </Form>
|
|
|
|
|
- {/* <Button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- className="ant-btn ant-btn-primary"
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- form
|
|
|
|
|
- .validateFields()
|
|
|
|
|
- .then(values => {
|
|
|
|
|
- onCreate(values)
|
|
|
|
|
- })
|
|
|
|
|
- .catch(err => {
|
|
|
|
|
- console.log(err)
|
|
|
|
|
- })
|
|
|
|
|
- }}>
|
|
|
|
|
- 确定
|
|
|
|
|
- </Button> */}
|
|
|
|
|
|
|
+ </Form> */}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|