import AddOutlined from "@mui/icons-material/AddOutlined"; import RefreshOutlined from "@mui/icons-material/RefreshOutlined"; import Button from "@mui/material/Button"; import MenuItem from "@mui/material/MenuItem"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; import TextField from "@mui/material/TextField"; import { APPLICATION_STATUS } from "../constants.js"; import { formatAmount, formatTime, operationLabel, statusLabel, walletIdentityLabel } from "../format.js"; export function FinanceMyApplicationList({ applications, error, filters, loading, onCreate, onFiltersChange, onReload, operations, options }) { const items = applications.items || []; const page = Number(applications.page || filters.page || 1); const pageSize = Number(applications.pageSize || 50); const total = Number(applications.total || 0); const hasNextPage = page * pageSize < total; return (
onFiltersChange({ appCode: event.target.value })}> 全部 APP {options.apps.map((app) => ( {app.appName || app.appCode} ))} onFiltersChange({ operation: event.target.value })}> 全部操作 {operations.map((operation) => ( {operation.label} ))} onFiltersChange({ status: event.target.value })}> 全部状态 {APPLICATION_STATUS.map(([value, label]) => ( {label} ))} onFiltersChange({ keyword: event.target.value })} />
{error ?
{error}
: null} {loading && !items.length ?
: null} {!loading || items.length ? ( APP 操作 目标用户 金币数量 充值金额 凭证 状态 发起申请时间 审批人 审核时间 {items.length ? ( items.map((item) => ( {item.appName || item.appCode || "-"} {item.targetUserId || "-"} {formatAmount(item.coinAmount)} {formatAmount(item.rechargeAmount)} {formatTime(item.createdAtMs)} {formatTime(item.auditedAtMs)} )) ) : ( 当前无数据 )}
) : null} {total > pageSize ? (
第 {page} 页 / 共 {total} 条
) : null}
); } function Evidence({ item }) { if (!item.credentialImageUrl && !item.credentialText) { return "-"; } return ( {item.credentialImageUrl ? ( 图片 ) : null} {item.credentialText ? {item.credentialText} : null} ); } function Stacked({ primary, secondary }) { return ( {primary || "-"} {secondary || ""} ); } function StatusBadge({ status }) { const tone = status === "approved" ? "success" : status === "rejected" ? "danger" : "warning"; return {statusLabel(status)}; }