123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import { Input, Card, Select, Button, message } from "antd"
- import { useEffect, useState } from 'react'
- import { Form } from "antd";
- import { history } from 'umi';
- import ProCard from '@ant-design/pro-card'
-
- const { Option } = Select
- const goBack = () => {
- history.goBack()
- }
- const FormItem = Form.Item
- export default (props) => {
-
- const [form] = Form.useForm()
- const [loading, setLoading] = useState(false)
-
- const formItemLayout = {
- //布局
- labelCol: { span: 6 },
- wrapperCol: { span: 14 },
- };
-
- const Submit = values => {
- console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
-
- };
-
- return (
- <Card >
- <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
- >
- <ProCard.TabPane key={1} tab="人员管理">
- <Form {...formItemLayout} onFinish={Submit} form={form} >
- <FormItem label="账号" name="shopName" rules={[{ required: true, message: '请输入' }]}>
- <Input placeholder="请输入" style={{ width: '350px' }} />
- </FormItem>
- <FormItem label="姓名" name="title" rules={[{ required: true, message: '请输入' }]}>
- <Input placeholder="请输入" style={{ width: '350px' }} />
- </FormItem>
- <FormItem label="邮箱" name="phone" rules={[{ required: true, message: '邮箱格式不正确或内容为空', pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/ }]}>
- <Input placeholder="请输入" style={{ width: '350px' }} />
- </FormItem>
- <FormItem label="角色" name="user" rules={[{ required: true, message: '请选择' }]}>
- <Select
- placeholder="请选择方式"
- // onChange={onGenderChange}
- allowClear
- style={{ width: '350px' }}
- >
- <Option value="nongji">农机手</Option>
- <Option value="nonghu">农户</Option>
- </Select>
- </FormItem>
- <FormItem label="状态" name="stry" rules={[{ required: true, message: '请选择', }]} >
- <Select
- placeholder="请选择方式"
- // onChange={onGenderChange}
- allowClear
- style={{ width: '350px' }}
- >
- <Option value="0">启用</Option>
- <Option value="1">禁用</Option>
- </Select>
- </FormItem>
-
- <FormItem label=" " colon={false} >
- <Button type='default' onClick={() => goBack()} >返回</Button>
- <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
- </FormItem>
- </Form>
- </ProCard.TabPane>
- </ProCard>
- </Card>
- )
- }
|