This commit is contained in:
Archer
2023-11-09 09:46:57 +08:00
committed by GitHub
parent 661ee79943
commit 8bb5588305
402 changed files with 9899 additions and 5967 deletions

View File

@@ -11,9 +11,9 @@ import {
Box,
Button
} from '@chakra-ui/react';
import { BillSourceMap } from '@/constants/user';
import { getUserBills } from '@/web/common/bill/api';
import type { UserBillType } from '@/types/user';
import { BillSourceMap } from '@fastgpt/global/support/wallet/bill/constants';
import { getUserBills } from '@/web/support/wallet/bill/api';
import type { BillItemType } from '@fastgpt/global/support/wallet/bill/type';
import { usePagination } from '@/web/common/hooks/usePagination';
import { useLoading } from '@/web/common/hooks/useLoading';
import dayjs from 'dayjs';
@@ -33,14 +33,14 @@ const BillTable = () => {
to: new Date()
});
const { isPc } = useSystemStore();
const [billDetail, setBillDetail] = useState<UserBillType>();
const [billDetail, setBillDetail] = useState<BillItemType>();
const {
data: bills,
isLoading,
Pagination,
getData
} = usePagination<UserBillType>({
} = usePagination<BillItemType>({
api: getUserBills,
pageSize: isPc ? 20 : 10,
params: {
@@ -55,6 +55,7 @@ const BillTable = () => {
<Table>
<Thead>
<Tr>
<Th>{t('wallet.bill.bill username')}</Th>
<Th>{t('user.Time')}</Th>
<Th>{t('user.Source')}</Th>
<Th>{t('user.Application Name')}</Th>
@@ -65,6 +66,7 @@ const BillTable = () => {
<Tbody fontSize={'sm'}>
{bills.map((item) => (
<Tr key={item.id}>
<Td>{item.username}</Td>
<Td>{dayjs(item.time).format('YYYY/MM/DD HH:mm:ss')}</Td>
<Td>{BillSourceMap[item.source]}</Td>
<Td>{t(item.appName) || '-'}</Td>