import { EditOutlined, PlusOutlined, RollbackOutlined, SaveFilled, } from '@ant-design/icons'; import { useNavigate } from '@umijs/max'; import { Button, ButtonProps, Dropdown, Popconfirm } from 'antd'; import { MyResponseType } from '..'; type MyButtonsType = { title?: string; to?: string } & ButtonProps; export const MyButtons = { Create({ title, ...rest }: MyButtonsType): JSX.Element { return ( ); }, Default({ onConfirm, isConfirm, title, description = '是否确定取消?', ...rest }: { onConfirm?: () => void; isConfirm?: boolean; description?: string; } & MyButtonsType): JSX.Element { return isConfirm ? ( ) : ( ); }, View({ title, ...rest }: MyButtonsType): JSX.Element { const navigate = useNavigate(); return ( ); }, Edit({ title = '编辑', ...rest }: MyButtonsType): JSX.Element { return ( ); }, Save({ title = '保存', ...rest }: MyButtonsType): JSX.Element { return ( ); }, Delete({ onConfirm, title = '删除', ...rest }: { onConfirm: () => void } & MyButtonsType): JSX.Element { return ( ); }, Export({ api, params, title, ...rest }: { api: (data: any) => Promise; params?: Record; } & MyButtonsType): JSX.Element { return ( { console.log(item, key); api?.({ ...params, ...{ download_type: key } }); }, items: [ // { // key: 'page', // label: '导出当前页', // }, { key: 'query', label: '按条件导出', }, // { // key: 'all', // label: '导出全部', // }, ], }} placement="bottomLeft" arrow > ); }, SoftDelete() {}, };