"use client"; import { useState } from "react"; import { Download, ChevronDown, CheckCircle2 } from "lucide-react"; import Link from "next/link"; import { metricsData, MetricCategoryData } from "./metricsData"; export default function DashboardContent() { const [expandedCard, setExpandedCard] = useState(null); const [activeTab, setActiveTab] = useState<"K" | "A" | "S" | "D">("K"); const toggleCard = (id: string) => { setExpandedCard(expandedCard === id ? null : id); }; const getMetricStatus = (score: string) => { const num = parseInt(score); if (isNaN(num)) return { label: "未知", class: "bg-surface-variant text-on-surface-variant" }; if (num >= 90) return { label: "优秀", class: "bg-metric-high/10 text-metric-high border-metric-high/30" }; if (num >= 80) return { label: "良好", class: "bg-metric-mid/10 text-metric-mid border-metric-mid/30" }; if (num >= 70) return { label: "一般", class: "bg-metric-warn/10 text-metric-warn border-metric-warn/30" }; return { label: "需改进", class: "bg-metric-low/10 text-metric-low border-metric-low/30" }; }; return (

综合能力总览

基于核心能力指标的数据分析与追踪

{metricsData[activeTab].map((metric) => (
toggleCard(metric.id)} >
{metric.id}

{metric.name}

{metric.description}

{metric.avgScore}
平均分
{metric.subMetrics.map((subMetric) => { // Make a fake consistent status based on submetric ID string length and char codes for visual diversity, in a real app this is data driven const fakeScoreVal = 70 + (subMetric.id.charCodeAt(subMetric.id.length - 1) * 3) % 25; const status = getMetricStatus(fakeScoreVal.toString()); return (

{subMetric.id} {subMetric.name}

{status.label}
{subMetric.values.map((val, idx) => (
{val.name}
))}
); })}
))}

近期活动追踪

{metricsData[activeTab].slice(0, 4).map((metric, i) => { const status = getMetricStatus(metric.avgScore); return ( (window.location.href = `/metrics/${metric.id.toLowerCase()}`)} > ) })}
能力指标 测验/活动 得分 状态
{metric.id} {metric.name} {metric.subMetrics[0]?.values[0]?.name || "综合能力评估"} {metric.avgScore} {status.label}
); }