|
@@ -1,76 +0,0 @@
|
1
|
|
-import { Input, Card, Select, Button, message } from "antd"
|
2
|
|
-import { useEffect, useState } from 'react'
|
3
|
|
-import { Form } from "antd";
|
4
|
|
-import { history } from 'umi';
|
5
|
|
-import ProCard from '@ant-design/pro-card'
|
6
|
|
-
|
7
|
|
-const { Option } = Select
|
8
|
|
-const goBack = () => {
|
9
|
|
- history.goBack()
|
10
|
|
-}
|
11
|
|
-const FormItem = Form.Item
|
12
|
|
-export default (props) => {
|
13
|
|
-
|
14
|
|
- const [form] = Form.useForm()
|
15
|
|
- const [loading, setLoading] = useState(false)
|
16
|
|
-
|
17
|
|
- const formItemLayout = {
|
18
|
|
- //布局
|
19
|
|
- labelCol: { span: 6 },
|
20
|
|
- wrapperCol: { span: 14 },
|
21
|
|
- };
|
22
|
|
-
|
23
|
|
- const Submit = values => {
|
24
|
|
- // setLoading(true)
|
25
|
|
- console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
|
26
|
|
-
|
27
|
|
- };
|
28
|
|
-
|
29
|
|
- return (
|
30
|
|
- <Card >
|
31
|
|
- <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
|
32
|
|
- >
|
33
|
|
- <ProCard.TabPane key={1} tab="人员管理">
|
34
|
|
- <Form {...formItemLayout} onFinish={Submit} form={form} >
|
35
|
|
- <FormItem label="账号" name="shopName" rules={[{ required: true, message: '请输入' }]}>
|
36
|
|
- <Input placeholder="请输入" style={{ width: '350px' }} />
|
37
|
|
- </FormItem>
|
38
|
|
- <FormItem label="姓名" name="title" rules={[{ required: true, message: '请输入' }]}>
|
39
|
|
- <Input placeholder="请输入" style={{ width: '350px' }} />
|
40
|
|
- </FormItem>
|
41
|
|
- <FormItem label="邮箱" name="phone" rules={[{ required: true, message: '邮箱格式不正确或内容为空', pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/ }]}>
|
42
|
|
- <Input placeholder="请输入" style={{ width: '350px' }} />
|
43
|
|
- </FormItem>
|
44
|
|
- <FormItem label="角色" name="user" rules={[{ required: true, message: '请选择' }]}>
|
45
|
|
- <Select
|
46
|
|
- placeholder="请选择角色"
|
47
|
|
- // onChange={onGenderChange}
|
48
|
|
- allowClear
|
49
|
|
- style={{ width: '350px' }}
|
50
|
|
- >
|
51
|
|
- <Option value="nongji">农机手</Option>
|
52
|
|
- <Option value="nonghu">农户</Option>
|
53
|
|
- </Select>
|
54
|
|
- </FormItem>
|
55
|
|
- <FormItem label="状态" name="stry" rules={[{ required: true, message: '请选择', }]} >
|
56
|
|
- <Select
|
57
|
|
- placeholder="请选择状态"
|
58
|
|
- // onChange={onGenderChange}
|
59
|
|
- allowClear
|
60
|
|
- style={{ width: '350px' }}
|
61
|
|
- >
|
62
|
|
- <Option value="0">启用</Option>
|
63
|
|
- <Option value="1">禁用</Option>
|
64
|
|
- </Select>
|
65
|
|
- </FormItem>
|
66
|
|
-
|
67
|
|
- <FormItem label=" " colon={false} >
|
68
|
|
- <Button type='default' onClick={() => goBack()} >返回</Button>
|
69
|
|
- <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
|
70
|
|
- </FormItem>
|
71
|
|
- </Form>
|
72
|
|
- </ProCard.TabPane>
|
73
|
|
- </ProCard>
|
74
|
|
- </Card>
|
75
|
|
- )
|
76
|
|
-}
|