feat(admin-web): 仪表板添加预种待合并/已合并统计卡片
在网络因子/加速因子下方新增一行: - 预种待合并: 显示全网 pendingMergePortions(份) - 预种已合并: 显示全网 totalTreesMerged(棵) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7fff665d9b
commit
19753a8639
|
|
@ -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}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue