fix: align signature review and admin operations
This commit is contained in:
@@ -70,19 +70,17 @@ export function AdminHome() {
|
||||
}, []);
|
||||
|
||||
const enterpriseSpendRanks = useMemo<EnterpriseSpendRank[]>(() => {
|
||||
return (dashboard?.accounts ?? []).map((account) => {
|
||||
const todaySpend = Math.abs(dashboard?.recentRecharges
|
||||
.filter((item) => item.tenantId === account.tenantId)
|
||||
.reduce((sum, item) => sum + item.amountCents, 0) ?? 0) / 10_000;
|
||||
return (dashboard?.enterpriseSpendRanks ?? []).map((account) => {
|
||||
const todaySpend = moneyUnitsToYuan(account.todaySpendCents);
|
||||
const availableBalance = moneyUnitsToYuan(account.balanceCents + account.creditCents);
|
||||
return {
|
||||
id: account.tenantId,
|
||||
enterprise: account.tenant?.name ?? account.tenantId,
|
||||
enterprise: account.tenantName,
|
||||
todaySpend,
|
||||
availableBalance,
|
||||
balanceStatus: (availableBalance <= 0 ? '欠费' : availableBalance < 100 ? '紧张' : '充足') as EnterpriseSpendRank['balanceStatus'],
|
||||
};
|
||||
}).sort((left, right) => right.todaySpend - left.todaySpend);
|
||||
});
|
||||
}, [dashboard]);
|
||||
|
||||
const totalSend = dashboard?.today.sent ?? 0;
|
||||
@@ -144,6 +142,7 @@ export function AdminHome() {
|
||||
{ key: 'rank', title: '排名', width: '72px', render: (record) => record.rank },
|
||||
{ key: 'signatureName', title: '签名', render: (record) => <div><strong>{record.signatureName}</strong><p className="text-caption">{record.tenantName}</p></div> },
|
||||
{ key: 'total', title: '发送总数', align: 'right', render: (record) => formatCount(record.total) },
|
||||
{ key: 'submitFailureCount', title: '提交失败', align: 'right', render: (record) => formatCount(record.submitFailureCount) },
|
||||
{ key: 'successCount', title: '成功', align: 'right', render: (record) => formatCount(record.successCount) },
|
||||
{ key: 'unknownCount', title: '未知', align: 'right', render: (record) => formatCount(record.unknownCount) },
|
||||
{ key: 'failureCount', title: '失败', align: 'right', render: (record) => formatCount(record.failureCount) },
|
||||
|
||||
Reference in New Issue
Block a user