wupengfei
2025-09-17 3cd644701e6055454fcfad545f2b6c218d3b0d37
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import * as userServices from '@/services/api/user';
import { useTable } from '@bole-core/components';
 
type UsePersonalUserTransactionsOptions = {
  type?: EnumUserWalletTransactionType;
};
 
export function usePersonalUserTransactions(options: UsePersonalUserTransactionsOptions = {}) {
  const { type } = options;
 
  const {
    getDataSource: getList,
    proTableProps,
    paginationState,
    extraParamState,
    reset,
  } = useTable(
    async ({ pageIndex, pageSize }, extraParamState) => {
      try {
        let params: API.GetPersonalUserTransactionsQuery = {
          pageModel: {
            rows: pageSize,
            page: pageIndex,
            orderInput: extraParamState.orderInput,
          },
          type: type,
        };
        let res = await userServices.getPersonalUserTransactions(params);
        return res;
      } catch (error) {}
    },
    {
      defaultExtraParams: {
        orderInput: [{ property: 'id', order: EnumPagedListOrder.Asc }],
      },
      columnsRenderProps: {},
    }
  );
 
  return { getList, proTableProps, extraParamState };
}