feat(admin-web): 仪表板添加预种待合并/已合并统计卡片

在网络因子/加速因子下方新增一行:
- 预种待合并: 显示全网 pendingMergePortions(份)
- 预种已合并: 显示全网 totalTreesMerged(棵)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-02 05:19:03 -08:00
parent 7fff665d9b
commit 19753a8639
1 changed files with 37 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import {
usePlantingStats,
usePlantingTrendForDashboard,
useHotWalletBalance,
usePrePlantingStats,
} from '@/hooks';
import type { DashboardPeriod } from '@/types';
import styles from './dashboard.module.scss';
@ -100,6 +101,12 @@ export default function DashboardPage() {
isLoading: hotWalletLoading,
} = useHotWalletBalance();
// 预种统计(待合并/已合并)
const {
data: prePlantingStats,
isLoading: prePlantingStatsLoading,
} = usePrePlantingStats();
// [2026-01-06] 基于 planting-service 数据构建统计卡片数据
const statsCards = plantingStatsData ? [
{
@ -219,6 +226,36 @@ export default function DashboardPage() {
</div>
</div>
{/* 预种统计区域 */}
<div className={styles.dashboard__walletBalance}>
<div className={styles.dashboard__walletCard}>
<div className={styles.dashboard__walletLabel}></div>
<div className={styles.dashboard__walletValue}>
{prePlantingStatsLoading ? (
<span className={styles.dashboard__walletLoading}>...</span>
) : (
<span className={styles.dashboard__walletAmount}>
{(prePlantingStats?.pendingMergePortions ?? 0).toLocaleString()}
<span style={{ fontSize: '0.5em', marginLeft: 4, opacity: 0.7 }}></span>
</span>
)}
</div>
</div>
<div className={styles.dashboard__walletCard}>
<div className={styles.dashboard__walletLabel}></div>
<div className={styles.dashboard__walletValue}>
{prePlantingStatsLoading ? (
<span className={styles.dashboard__walletLoading}>...</span>
) : (
<span className={styles.dashboard__walletAmount}>
{(prePlantingStats?.totalTreesMerged ?? 0).toLocaleString()}
<span style={{ fontSize: '0.5em', marginLeft: 4, opacity: 0.7 }}></span>
</span>
)}
</div>
</div>
</div>
{/* 图表区 - [2026-01-06] 使用 planting-service 数据 */}
<div className={styles.dashboard__charts}>
<div className={styles.dashboard__mainChart}>