This commit is contained in:
archer
2023-07-17 10:20:30 +08:00
parent 98a5796592
commit 246283ee1c
46 changed files with 1747 additions and 780 deletions

View File

@@ -30,7 +30,7 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont
() => (
<AlertDialog isOpen={isOpen} leastDestructiveRef={cancelRef} onClose={onClose}>
<AlertDialogOverlay>
<AlertDialogContent>
<AlertDialogContent maxW={'min(90vw,400px)'}>
<AlertDialogHeader fontSize="lg" fontWeight="bold">
{title}
</AlertDialogHeader>

View File

@@ -13,13 +13,15 @@ export const usePagination = <T = any,>({
pageSize = 10,
params = {},
defaultRequest = true,
type = 'button'
type = 'button',
onChange
}: {
api: (data: any) => any;
pageSize?: number;
params?: Record<string, any>;
defaultRequest?: boolean;
type?: 'button' | 'scroll';
onChange?: (pageNum: number) => void;
}) => {
const elementRef = useRef<HTMLDivElement>(null);
const { toast } = useToast();
@@ -39,6 +41,7 @@ export const usePagination = <T = any,>({
setPageNum(num);
res.total !== undefined && setTotal(res.total);
setData(res.data);
onChange && onChange(num);
} catch (error: any) {
toast({
title: error?.message || '获取数据异常',