Blame view

src/pages/Order/OrderList/BaseModal.tsx 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { ModalForm } from '@ant-design/pro-components';
import { Form } from 'antd';

// import { cloneDeep } from 'lodash';
export default ({ setVisible, onClose }) => {
  const [form] = Form.useForm<{ name: string; company: string }>();

  return (
    <>
      <ModalForm<{
        name: string;
        company: string;
      }>
        width={500}
        open
        title="标题"
        form={form}
        autoFocusFirstInput
        modalProps={{
          okText: '通过',
          cancelText: '取消',
          destroyOnClose: true,
          onCancel: () => {
            setVisible(false);
          },
        }}
        onFinish={async (values) => {
          console.log(values);
          onClose();
        }}
        onOpenChange={setVisible}
      ></ModalForm>
    </>
  );
};