import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { ProTable, TableDropdown, PageContainer, ModalForm, ProForm, ProFormDateRangePicker, ProFormSelect, ProFormText, } from '@ant-design/pro-components'; import { Button, Dropdown, Space, Tag, Form } from 'antd'; import { useRef, useState } from 'react'; export const waitTimePromise = async (time: number = 100) => { return new Promise((resolve) => { setTimeout(() => { resolve(true); }, time); }); }; export const waitTime = async (time: number = 100) => { await waitTimePromise(time); }; const columns: ProColumns[] = [ { title: 'ID', dataIndex: 'id', }, { title: '企业名称', dataIndex: 'name', }, { title: '来源', dataIndex: 'state', }, { title: '登录次数', dataIndex: 'app_id', }, { title: 'ApiKey', dataIndex: 'api_key', }, { title: 'SecretKey', dataIndex: 'secret_key', }, { title: '操作', valueType: 'option', key: 'option', render: (text, record, _, action) => [ { action?.startEditable?.(record.id); }} > 编辑 , ], }, ]; export default () => { const [form] = Form.useForm(); const [data, setData] = useState([{id: 1}]) return ( <> console.log(page), }} toolBarRender={() => [ title="新增项目" trigger={ } submitter={{ render: (props, defaultDoms) => { return [ , ...defaultDoms, ]; }, }} form={form} autoFocusFirstInput modalProps={{ destroyOnClose: true, onCancel: () => console.log('run'), }} submitTimeout={2000} onFinish={async (values) => { await waitTime(2000); console.log(values.name); return true; }} > ]} /> ); };