Blame view

src/pages/Order/components/BaseModal.tsx 805 Bytes
zhongnanhuang authored
1
2
3
4
import { ModalForm } from '@ant-design/pro-components';
import { Form } from 'antd';

// import { cloneDeep } from 'lodash';
zhongnanhuang authored
5
export default ({ setVisible, onClose }) => {
zhongnanhuang authored
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  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: () => {
zhongnanhuang authored
24
            setVisible(false);
zhongnanhuang authored
25
26
27
28
29
30
          },
        }}
        onFinish={async (values) => {
          console.log(values);
          onClose();
        }}
zhongnanhuang authored
31
        onOpenChange={setVisible}
zhongnanhuang authored
32
33
34
35
      ></ModalForm>
    </>
  );
};