index.jsx 1.4KB

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. return (
  21. <Card>
  22. <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
  23. <ProCard.TabPane key={1} tab="资讯管理">
  24. <Form {...formItemLayout} onFinish={Submit} form={form}>
  25. <FormItem label="分类名" name="name" rules={[{ required: true, message: '请输入' }]}>
  26. <Input placeholder="请输入" style={{ width: '350px' }} />
  27. </FormItem>
  28. <FormItem label=" " colon={false}>
  29. <Button type="default" onClick={() => goBack()}>
  30. 返回
  31. </Button>
  32. <Button
  33. type="primary"
  34. loading={loading}
  35. htmlType="Submit"
  36. style={{ marginLeft: '4em' }}
  37. >
  38. 保存
  39. </Button>
  40. </FormItem>
  41. </Form>
  42. </ProCard.TabPane>
  43. </ProCard>
  44. </Card>
  45. );
  46. };