import React from 'react'; import { Drawer, Form, Input, Button, message } from 'antd'; import type { DrawerProps } from 'antd'; import { useCreateDict } from '../apis/dicts'; interface DictDrawerProps extends DrawerProps { refresh: () => void; onClose: () => void; } const DictDrawer: React.FC = ({ refresh, ...props }) => { const createDict = useCreateDict(); return (
void (async () => { try { await createDict(values); void message.success('创建成功'); refresh(); props.onClose(); } catch (err) { if (err instanceof Error) { void message.error(err.message); } } })() } >
); }; export default DictDrawer;