"use client" import { useState } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Textarea } from "@/components/ui/textarea" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog" import { Avatar, AvatarFallback } from "@/components/ui/avatar" import { Progress } from "@/components/ui/progress" import { TrendingUp, TrendingDown, AlertTriangle, Upload, MessageSquare, Plus, BarChart3 } from "lucide-react" // Mock progress data const progressData = [ { id: 1, kpiTitle: "營收成長率", currentValue: 85, targetValue: 100, progress: 85, lastUpdate: "2024-02-10", updatedBy: "陳雅雯", comment: "本月營收表現良好,預計下月可達成目標", blockers: "", trend: "up", color: "emerald", category: "financial", }, { id: 2, kpiTitle: "團隊滿意度", currentValue: 92, targetValue: 90, progress: 102, lastUpdate: "2024-02-08", updatedBy: "王志明", comment: "團隊士氣高昂,超越預期目標", blockers: "", trend: "up", color: "blue", category: "team", }, { id: 3, kpiTitle: "市場佔有率", currentValue: 68, targetValue: 75, progress: 91, lastUpdate: "2024-02-05", updatedBy: "李美玲", comment: "競爭激烈,需要加強市場推廣", blockers: "競爭對手推出新產品", trend: "down", color: "purple", category: "operational", }, { id: 4, kpiTitle: "創新指數", currentValue: 45, targetValue: 80, progress: 56, lastUpdate: "2024-02-03", updatedBy: "張建國", comment: "研發進度落後,需要額外資源", blockers: "人力不足,預算限制", trend: "down", color: "orange", category: "innovation", }, ] // 簡單的趨勢數據 const trendData = [ { month: "1月", 營收成長率: 75, 團隊滿意度: 88, 市場佔有率: 72, 創新指數: 40 }, { month: "2月", 營收成長率: 85, 團隊滿意度: 92, 市場佔有率: 68, 創新指數: 45 }, ] export default function ProgressPage() { const [activeTab, setActiveTab] = useState("overview") const [isUpdateDialogOpen, setIsUpdateDialogOpen] = useState(false) const [selectedKPI, setSelectedKPI] = useState(null) const handleUpdateProgress = (kpi: any) => { setSelectedKPI(kpi) setIsUpdateDialogOpen(true) } return (
{/* Header */}
公司 Logo

進度追蹤中心

KPI 進度更新與監控

{/* Progress Overview Cards */}
{progressData.map((item) => (
{item.kpiTitle} {item.trend === "up" ? ( ) : ( )}
進度 {item.progress}%
{item.currentValue} / {item.targetValue} {item.lastUpdate}
{item.updatedBy.charAt(0)}
{item.blockers && (

{item.blockers}

)}
))}
{/* Main Content */} 進度分析 KPI 進度趨勢與詳細追蹤 趨勢概覽 詳細記錄 時間軸 KPI 進度趨勢
{trendData.map((data, index) => (

{data.month}

營收成長率 {data.營收成長率}%
團隊滿意度 {data.團隊滿意度}%
市場佔有率 {data.市場佔有率}%
創新指數 {data.創新指數}%
))}
{progressData.map((item) => (

{item.kpiTitle}

= 80 ? "default" : item.progress >= 60 ? "secondary" : "destructive" } > {item.progress}%
目前: {item.currentValue} / 目標: {item.targetValue} 更新: {item.lastUpdate}
{item.comment && (

{item.comment}

)} {item.blockers && (

阻礙因素: {item.blockers}

)}
{item.updatedBy.charAt(0)}

{item.updatedBy}

{item.lastUpdate}

))}
{progressData.map((item, index) => (
{index + 1}

{item.kpiTitle}

= 80 ? "default" : "secondary"}>{item.progress}%

{item.comment}

更新者: {item.updatedBy} {item.lastUpdate}
))}
{/* Update Progress Dialog */} 更新進度 更新 {selectedKPI?.kpiTitle} 的最新進度