feat: 迭代

This commit is contained in:
2026-05-14 09:55:25 +08:00
parent 6eed65baf2
commit c647f3c8cd
27 changed files with 2242 additions and 105 deletions
+2
View File
@@ -11,6 +11,8 @@
},
"dependencies": {
"@ant-design/icons": "^5.5.0",
"@rent/shared-types": "workspace:*",
"@rent/shared-utils": "workspace:*",
"antd": "^5.22.0",
"axios": "^1.7.0",
"dayjs": "^1.11.13",
@@ -1,7 +1,7 @@
import React from 'react';
import { Card, Row, Col, Statistic } from 'antd';
import { formatMoney } from '@rent/shared-utils/format';
import type { Account } from '@rent/shared-types/finance';
import { formatMoney } from '@rent/shared-utils';
import type { Account } from '@rent/shared-types';
interface AccountCardProps {
account: Account;
@@ -1,7 +1,7 @@
import React from 'react';
import { Tag } from 'antd';
import type { SettlementStatus } from '@rent/shared-types/finance';
import { SETTLEMENT_STATUS_MAP } from '@rent/shared-types/finance-constants';
import type { SettlementStatus } from '@rent/shared-types';
import { SETTLEMENT_STATUS_MAP } from '@rent/shared-types';
interface SettlementStatusTagProps {
status: SettlementStatus;
@@ -1,7 +1,7 @@
import React from 'react';
import type { TransactionType } from '@rent/shared-types/finance';
import { TRANSACTION_TYPE_MAP } from '@rent/shared-types/finance-constants';
import { formatMoney } from '@rent/shared-utils/format';
import type { TransactionType } from '@rent/shared-types';
import { TRANSACTION_TYPE_MAP } from '@rent/shared-types';
import { formatMoney } from '@rent/shared-utils';
interface TransactionAmountProps {
type: TransactionType;
@@ -1,7 +1,7 @@
import React from 'react';
import { Tag } from 'antd';
import type { WithdrawalStatus } from '@rent/shared-types/finance';
import { WITHDRAWAL_STATUS_MAP } from '@rent/shared-types/finance-constants';
import type { WithdrawalStatus } from '@rent/shared-types';
import { WITHDRAWAL_STATUS_MAP } from '@rent/shared-types';
interface WithdrawalStatusTagProps {
status: WithdrawalStatus;
+1 -1
View File
@@ -1,6 +1,6 @@
import { useState, useCallback } from 'react';
import { message } from 'antd';
import type { ApprovalParams } from '@rent/shared-types/finance';
import type { ApprovalParams } from '@rent/shared-types';
interface UseApprovalOptions {
approveFn: (params: ApprovalParams) => Promise<void>;
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react';
import type { PaginatedResponse, FinanceQueryParams } from '@rent/shared-types/finance';
import type { PaginatedResponse, FinanceQueryParams } from '@rent/shared-types';
interface UseTableDataOptions<T> {
fetchFn: (params: FinanceQueryParams) => Promise<PaginatedResponse<T>>;
@@ -3,8 +3,8 @@ import { Card, Table, Button, Space, Modal, Descriptions, message } from 'antd';
import { EyeOutlined } from '@ant-design/icons';
import { getMerchantSettlements, getSettlementDetail, getSettlementItems } from '@/api/finance';
import type { ColumnsType } from 'antd/es/table';
import type { Settlement } from '@rent/shared-types/finance';
import { formatMoney, formatDateTime } from '@rent/shared-utils/format';
import type { Settlement } from '@rent/shared-types';
import { formatMoney, formatDateTime } from '@rent/shared-utils';
import { useTableData } from '@/hooks/useTableData';
import { useModal } from '@/hooks/useModal';
import { SettlementStatusTag } from '@/components/SettlementStatusTag';
@@ -3,9 +3,9 @@ import { Card, Table, Form, Select, DatePicker, Button, Space, Modal, Descriptio
import { SearchOutlined, ReloadOutlined } from '@ant-design/icons';
import { getMerchantTransactions, getTransactionDetail } from '@/api/finance';
import type { ColumnsType } from 'antd/es/table';
import type { Transaction } from '@rent/shared-types/finance';
import { TRANSACTION_TYPE_MAP, TRANSACTION_TYPE_OPTIONS } from '@rent/shared-types/finance-constants';
import { formatMoney, formatDateTime } from '@rent/shared-utils/format';
import type { Transaction, TransactionType } from '@rent/shared-types';
import { TRANSACTION_TYPE_MAP, TRANSACTION_TYPE_OPTIONS } from '@rent/shared-types';
import { formatMoney, formatDateTime } from '@rent/shared-utils';
import { useTableData } from '@/hooks/useTableData';
import { useModal } from '@/hooks/useModal';
import { TransactionAmount } from '@/components/TransactionAmount';
@@ -95,7 +95,7 @@ const Transactions: React.FC = () => {
dataIndex: 'type',
key: 'type',
width: 120,
render: (type: string) => TRANSACTION_TYPE_MAP[type]?.label || type,
render: (type: string) => TRANSACTION_TYPE_MAP[type as TransactionType]?.label || type,
},
{
title: '金额',
@@ -2,9 +2,9 @@ import React, { useEffect, useState } from 'react';
import { Card, Button, Table, message } from 'antd';
import { getMerchantAccount, getMerchantTransactions } from '@/api/finance';
import type { ColumnsType } from 'antd/es/table';
import type { Account, Transaction } from '@rent/shared-types/finance';
import { TRANSACTION_TYPE_MAP } from '@rent/shared-types/finance-constants';
import { formatMoney, formatDateTime } from '@rent/shared-utils/format';
import type { Account, Transaction, TransactionType } from '@rent/shared-types';
import { TRANSACTION_TYPE_MAP } from '@rent/shared-types';
import { formatMoney, formatDateTime } from '@rent/shared-utils';
import { useTableData } from '@/hooks/useTableData';
import { AccountCard } from '@/components/AccountCard';
import { TransactionAmount } from '@/components/TransactionAmount';
@@ -63,7 +63,7 @@ const Wallet: React.FC = () => {
dataIndex: 'type',
key: 'type',
width: 120,
render: (type: string) => TRANSACTION_TYPE_MAP[type]?.label || type,
render: (type: string) => TRANSACTION_TYPE_MAP[type as TransactionType]?.label || type,
},
{
title: '金额',
@@ -3,8 +3,8 @@ import { Card, Table, Button, Space, Modal, Form, Input, InputNumber, message, D
import { PlusOutlined } from '@ant-design/icons';
import { getMerchantWithdrawals, getWithdrawalDetail, applyWithdrawal, cancelWithdrawal } from '@/api/finance';
import type { ColumnsType } from 'antd/es/table';
import type { Withdrawal } from '@rent/shared-types/finance';
import { formatMoney, formatDateTime } from '@rent/shared-utils/format';
import type { Withdrawal } from '@rent/shared-types';
import { formatMoney, formatDateTime } from '@rent/shared-utils';
import { useTableData } from '@/hooks/useTableData';
import { useModal } from '@/hooks/useModal';
import { WithdrawalStatusTag } from '@/components/WithdrawalStatusTag';
+1
View File
@@ -0,0 +1 @@
{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/finance.ts","./src/api/order.ts","./src/api/review.ts","./src/api/room-calendar.ts","./src/api/room.ts","./src/api/statistics.ts","./src/components/accountcard.tsx","./src/components/settlementstatustag.tsx","./src/components/transactionamount.tsx","./src/components/withdrawalstatustag.tsx","./src/hooks/useapproval.ts","./src/hooks/usemodal.ts","./src/hooks/usetabledata.ts","./src/layouts/mainlayout.tsx","./src/pages/dashboard.tsx","./src/pages/login.tsx","./src/pages/orderdetail.tsx","./src/pages/orderlist.tsx","./src/pages/reviewlist.tsx","./src/pages/roomcalendar.tsx","./src/pages/roomform.tsx","./src/pages/roomlist.tsx","./src/pages/settings.tsx","./src/pages/finance/settlementdetail.tsx","./src/pages/finance/settlements.tsx","./src/pages/finance/transactions.tsx","./src/pages/finance/wallet.tsx","./src/pages/finance/withdrawals.tsx","./src/store/auth.ts","./src/utils/request.ts"],"version":"5.9.3"}