1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. const { Option } = Select
  7. const goBack = () => {
  8. history.goBack()
  9. }
  10. const FormItem = Form.Item
  11. export default (props) => {
  12. const [form] = Form.useForm()
  13. const [loading, setLoading] = useState(false)
  14. const formItemLayout = {
  15. //布局
  16. labelCol: { span: 6 },
  17. wrapperCol: { span: 14 },
  18. };
  19. const Submit = values => {
  20. setLoading(false)
  21. console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
  22. };
  23. return (
  24. <Card >
  25. <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
  26. >
  27. <ProCard.TabPane key={1} tab="设备管理">
  28. <Form {...formItemLayout} onFinish={Submit} form={form} >
  29. <FormItem label="设备ID" name="shopName" rules={[{ required: true, message: '请输入' }]}>
  30. <Input placeholder="请输入" style={{ width: '350px' }} />
  31. </FormItem>
  32. <FormItem label="设备号" name="title" rules={[{ required: true, message: '请输入' }]}>
  33. <Input placeholder="请输入" style={{ width: '350px' }} />
  34. </FormItem>
  35. <FormItem label=" " colon={false} >
  36. <Button type='default' onClick={() => goBack()} >返回</Button>
  37. <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
  38. </FormItem>
  39. </Form>
  40. </ProCard.TabPane>
  41. </ProCard>
  42. </Card>
  43. )
  44. }