From 44cbdc9d6234bb313e577377622edb3547d06172 Mon Sep 17 00:00:00 2001 From: selfrelease Date: Sun, 19 Jul 2026 19:06:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20P3+P4=20=E5=88=9B=E5=A7=8B?= =?UTF-8?q?=E4=BA=BA=E7=AB=AF=E5=A2=9E=E5=BC=BA=20+=20=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=88=98=E6=83=85=E5=AE=A4=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P3 创始人端: - 经营驾驶舱: 6 KPI 卡片 + 风险提示 - 投资人沟通准备中心: 会议列表 + 准备清单 + AI 建议 - 里程碑自填: 进度滑块 + 新增表单 - OKR 对齐视图: 投资人期望对齐度 + KR 进度 - BML 认知追踪: 信念/心智模型/学习追踪 - 通知页面 + 个人中心页面 P4 企业战情室集成: - HighlightsPanel: 顶部 KPI 摘要栏 - WorkModeSwitcher: 4 种工作模式切换 - InsightRail: 右侧 AI 面板(默认风险预警 Agent) Admin: - 商业秘密保护配置: 密级/留痕/导出管控/审计日志 --- .../companies/[id]/workbench/page.tsx | 73 +++++---- frontend/src/app/admin/security/page.tsx | 120 +++++++++++++++ .../src/app/founder/bml-tracking/page.tsx | 90 +++++++++++ .../src/app/founder/investor-comms/page.tsx | 80 ++++++++++ .../src/app/founder/milestones-self/page.tsx | 145 ++++++++++++++++++ .../src/app/founder/notifications/page.tsx | 42 +++++ frontend/src/app/founder/okr-align/page.tsx | 83 ++++++++++ frontend/src/app/founder/operations/page.tsx | 56 +++++++ frontend/src/app/founder/profile/page.tsx | 47 ++++++ 9 files changed, 705 insertions(+), 31 deletions(-) create mode 100644 frontend/src/app/admin/security/page.tsx create mode 100644 frontend/src/app/founder/bml-tracking/page.tsx create mode 100644 frontend/src/app/founder/investor-comms/page.tsx create mode 100644 frontend/src/app/founder/milestones-self/page.tsx create mode 100644 frontend/src/app/founder/notifications/page.tsx create mode 100644 frontend/src/app/founder/okr-align/page.tsx create mode 100644 frontend/src/app/founder/operations/page.tsx create mode 100644 frontend/src/app/founder/profile/page.tsx diff --git a/frontend/src/app/(investor)/companies/[id]/workbench/page.tsx b/frontend/src/app/(investor)/companies/[id]/workbench/page.tsx index a4bd3f5..6cb6283 100644 --- a/frontend/src/app/(investor)/companies/[id]/workbench/page.tsx +++ b/frontend/src/app/(investor)/companies/[id]/workbench/page.tsx @@ -6,6 +6,9 @@ import { TabNav, TabPanel, type TabId } from "@/components/workbench/TabNav"; import { HealthRadar, DIMENSIONS_14, DIMENSIONS_14_DETAIL, HealthDimensionDetail } from "@/components/health/HealthRadar"; import { LoadingSpinner } from "@/components/shared/LoadingSpinner"; import { EmptyState } from "@/components/shared/EmptyState"; +import { HighlightsPanel } from "@/components/workbench/HighlightsPanel"; +import { WorkModeSwitcher, type WorkMode } from "@/components/shared/WorkModeSwitcher"; +import { InsightRail } from "@/components/shared/InsightRail"; import { apiFetch } from "@/lib/api"; import { AlertTriangle, FileText, ClipboardList, ScrollText, Network, DollarSign, Activity, Users, Bot } from "lucide-react"; @@ -16,6 +19,7 @@ export default function WorkbenchPage() { const [activeTab, setActiveTab] = useState("overview"); const [detail, setDetail] = useState(null); const [loading, setLoading] = useState(true); + const [workMode, setWorkMode] = useState("overview"); useEffect(() => { if (!companyId) return; @@ -41,41 +45,48 @@ export default function WorkbenchPage() { const { company, health_score, recent_reports, open_risks, recent_weak_signals, active_agreements, recent_board_meetings } = detail; + const highRisksCount = (open_risks || []).filter((r: any) => r.severity === "high" || r.severity === "critical").length; + const pendingTasksCount = (recent_reports || []).filter((r: any) => r.status === "pending" || r.status === "draft").length; + const runway = health_score?.runway_months ?? 12; + return (
- {/* 企业头部信息 */} -
-
-

{company.name}

-

- {company.industry || "未知行业"} · {company.stage || "未知阶段"} -

-
- {health_score && ( -
-
- {health_score.total_score.toFixed(0)} -
-
健康度总分
-
- )} + {/* Highlights Panel — 企业 KPI 摘要 */} + + + {/* Work Mode 切换器 */} +
+
- {/* Tab 导航 + 内容 */} -
- - - {activeTab === "overview" && } - {activeTab === "financial" && } - {activeTab === "operational" && } - {activeTab === "org" && } - {activeTab === "ai" && } - {activeTab === "risk" && } - {activeTab === "reports" && } - {activeTab === "board" && } - {activeTab === "agreements" && } - {activeTab === "synergy" && } - + {/* 主内容 + Insight Rail */} +
+ {/* Tab 导航 + 内容 */} +
+ + + {activeTab === "overview" && } + {activeTab === "financial" && } + {activeTab === "operational" && } + {activeTab === "org" && } + {activeTab === "ai" && } + {activeTab === "risk" && } + {activeTab === "reports" && } + {activeTab === "board" && } + {activeTab === "agreements" && } + {activeTab === "synergy" && } + +
+ + {/* Insight Rail — 右侧 AI 面板 */} +
); diff --git a/frontend/src/app/admin/security/page.tsx b/frontend/src/app/admin/security/page.tsx new file mode 100644 index 0000000..83af5a2 --- /dev/null +++ b/frontend/src/app/admin/security/page.tsx @@ -0,0 +1,120 @@ +/** Admin 商业秘密保护配置页面 — 密级规则 + 查看留痕 + 导出管控。 */ + +"use client"; + +import { ShieldCheck, Lock, Eye, Download, Settings } from "lucide-react"; +import { useState } from "react"; +import { ClassificationBadge, type ClassificationLevel } from "@/components/shared/ClassificationBadge"; + +/** 商业秘密保护配置页面。 */ +export default function SecurityPage() { + const [defaultLevel, setDefaultLevel] = useState("internal"); + const [watermarkEnabled, setWatermarkEnabled] = useState(true); + const [exportApproval, setExportApproval] = useState(true); + const [viewLogRetention, setViewLogRetention] = useState("180"); + + const levels: ClassificationLevel[] = ["public", "internal", "confidential", "secret"]; + + return ( +
+
+ +

商业秘密保护

+
+ + {/* 默认密级配置 */} +
+
+
+

新建数据时的默认密级标签:

+
+ {levels.map((level) => ( + + ))} +
+
+ + {/* 查看留痕 */} +
+
+
+
+
+ 机密/绝密数据查看时自动记录 + 已启用 +
+
+ 留痕数据保留天数 + setViewLogRetention(e.target.value)} + className="w-20 rounded-md border px-2 py-1 text-sm" + /> +
+
+
+ + {/* 导出管控 */} +
+
+
+
+ + +
+
+ + {/* 审计日志摘要 */} +
+
+
+
+ {[ + { user: "张三", action: "查看机密报告", time: "2026-07-14 10:23" }, + { user: "李四", action: "导出绝密数据", time: "2026-07-13 16:45" }, + { user: "王五", action: "查看机密财务", time: "2026-07-12 09:12" }, + ].map((log, i) => ( +
+ {log.user} — {log.action} + {log.time} +
+ ))} +
+
+
+ ); +} diff --git a/frontend/src/app/founder/bml-tracking/page.tsx b/frontend/src/app/founder/bml-tracking/page.tsx new file mode 100644 index 0000000..7c59858 --- /dev/null +++ b/frontend/src/app/founder/bml-tracking/page.tsx @@ -0,0 +1,90 @@ +/** 创始人端 BML 认知追踪页面 — 信念-心智模型-学习追踪。 */ + +"use client"; + +import { Brain, Lightbulb, BookOpen, TrendingUp } from "lucide-react"; + +/** BML 条目。 */ +interface BMLItem { + type: "belief" | "mental_model" | "learning"; + title: string; + status: "validating" | "validated" | "invalidated" | "learning"; + evidence: string; + lastUpdated: string; +} + +/** BML 认知追踪页面。 */ +export default function BMLTrackingPage() { + const items: BMLItem[] = [ + { type: "belief", title: "企业客户更看重数据安全而非价格", status: "validated", evidence: "5 个 PoC 反馈一致", lastUpdated: "2026-07-10" }, + { type: "belief", title: "AI 模型成本会持续下降", status: "validating", evidence: "推理成本月降 8%", lastUpdated: "2026-07-12" }, + { type: "mental_model", title: "PLG 不适用于企业级 AI 产品", status: "validated", evidence: "3 次免费试用转化率 <5%", lastUpdated: "2026-06-28" }, + { type: "learning", title: "董事会关注 AI 伦理风险", status: "learning", evidence: "上次董事会提问方向", lastUpdated: "2026-07-05" }, + ]; + + const TYPE_CONFIG = { + belief: { label: "信念", icon: Lightbulb, color: "text-amber-600 bg-amber-50" }, + mental_model: { label: "心智模型", icon: Brain, color: "text-indigo-600 bg-indigo-50" }, + learning: { label: "学习", icon: BookOpen, color: "text-emerald-600 bg-emerald-50" }, + } as const; + + const STATUS_LABELS = { + validating: "验证中", + validated: "已验证", + invalidated: "已证伪", + learning: "学习中", + } as const; + + return ( +
+
+ +

BML 认知追踪

+
+ + {/* 摘要 */} +
+
+
+
+
+
+
+
+ + {/* BML 列表 */} +
+ {items.map((item, i) => { + const cfg = TYPE_CONFIG[item.type]; + return ( +
+
+
+ + {cfg.label} + + {item.title} +
+ {STATUS_LABELS[item.status]} +
+
+
+
+ ); + })} +
+
+ ); +} diff --git a/frontend/src/app/founder/investor-comms/page.tsx b/frontend/src/app/founder/investor-comms/page.tsx new file mode 100644 index 0000000..7251cc4 --- /dev/null +++ b/frontend/src/app/founder/investor-comms/page.tsx @@ -0,0 +1,80 @@ +/** 投资人沟通准备中心 — 帮助创始人准备与投资人的沟通。 */ + +"use client"; + +import { MessageSquare, FileText, CheckCircle2, Clock, AlertTriangle } from "lucide-react"; + +/** 投资人沟通准备中心页面。 */ +export default function InvestorCommsPage() { + const upcomingMeetings = [ + { title: "7 月度沟通", date: "2026-07-20", status: "preparing", items: 5 }, + { title: "季度董事会", date: "2026-07-25", status: "preparing", items: 8 }, + ]; + + const checklist = [ + { label: "月报已提交", done: true }, + { label: "OKR 进度更新", done: true }, + { label: "财务数据校验", done: true }, + { label: "风险项说明准备", done: false }, + { label: "下季度计划文档", done: false }, + ]; + + return ( +
+
+ +

投资人沟通准备

+
+ + {/* 即将到来的沟通 */} +
+ {upcomingMeetings.map((meeting) => ( +
+
+
+

{meeting.title}

+

+

+
+ + 准备中 · {meeting.items} 项 + +
+
+ ))} +
+ + {/* 准备清单 */} +
+

准备清单

+
+ {checklist.map((item) => ( +
+ {item.done ? ( +
+
+ + {/* AI 建议 */} +
+
+
+

+ 投资人可能关注客户流失率上升原因。建议准备:1) 流失客户分析报告 2) 回访计划 3) Q3 恢复目标。 +

+
+
+ ); +} diff --git a/frontend/src/app/founder/milestones-self/page.tsx b/frontend/src/app/founder/milestones-self/page.tsx new file mode 100644 index 0000000..a8ea49a --- /dev/null +++ b/frontend/src/app/founder/milestones-self/page.tsx @@ -0,0 +1,145 @@ +/** 里程碑自填页面 — 创始人自主更新里程碑进度。 */ + +"use client"; + +import { GitBranch, Plus, CheckCircle2, Clock, Circle } from "lucide-react"; +import { useState } from "react"; + +/** 里程碑状态类型。 */ +type MilestoneStatus = "completed" | "in_progress" | "planned"; + +/** 里程碑数据。 */ +interface Milestone { + id: string; + title: string; + targetDate: string; + status: MilestoneStatus; + progress: number; +} + +/** 状态配置。 */ +const STATUS_CONFIG: Record = { + completed: { label: "已完成", icon: CheckCircle2, color: "text-emerald-500" }, + in_progress: { label: "进行中", icon: Clock, color: "text-amber-500" }, + planned: { label: "计划中", icon: Circle, color: "text-gray-400" }, +}; + +/** 里程碑自填页面。 */ +export default function MilestonesSelfPage() { + const [milestones, setMilestones] = useState([ + { id: "m1", title: "A+ 轮融资完成", targetDate: "2026-09-30", status: "in_progress", progress: 45 }, + { id: "m2", title: "客户数突破 200", targetDate: "2026-08-31", status: "in_progress", progress: 78 }, + { id: "m3", title: "AI 商业化 PoC #3 签约", targetDate: "2026-07-31", status: "planned", progress: 0 }, + { id: "m4", title: "核心团队扩招 5 人", targetDate: "2026-06-30", status: "completed", progress: 100 }, + ]); + + const [showForm, setShowForm] = useState(false); + const [newTitle, setNewTitle] = useState(""); + const [newDate, setNewDate] = useState(""); + + function addMilestone() { + if (!newTitle.trim()) return; + setMilestones((prev) => [ + ...prev, + { id: `m${prev.length + 1}`, title: newTitle, targetDate: newDate || "待定", status: "planned", progress: 0 }, + ]); + setNewTitle(""); + setNewDate(""); + setShowForm(false); + } + + function updateProgress(id: string, progress: number) { + setMilestones((prev) => + prev.map((m) => + m.id === id + ? { ...m, progress, status: progress >= 100 ? "completed" : progress > 0 ? "in_progress" : "planned" } + : m + ) + ); + } + + return ( +
+
+
+ +

里程碑

+
+ +
+ + {/* 新增表单 */} + {showForm && ( +
+
+ setNewTitle(e.target.value)} + className="w-full rounded-md border px-3 py-2 text-sm" + /> + setNewDate(e.target.value)} + className="w-full rounded-md border px-3 py-2 text-sm" + /> + +
+
+ )} + + {/* 里程碑列表 */} +
+ {milestones.map((m) => { + const cfg = STATUS_CONFIG[m.status]; + return ( +
+
+
+
+ 目标日期:{m.targetDate} +
+
+
+
+
+ {m.progress}% + updateProgress(m.id, Number(e.target.value))} + className="w-24" + aria-label={`${m.title} 进度`} + /> +
+
+ ); + })} +
+
+ ); +} diff --git a/frontend/src/app/founder/notifications/page.tsx b/frontend/src/app/founder/notifications/page.tsx new file mode 100644 index 0000000..fd6312e --- /dev/null +++ b/frontend/src/app/founder/notifications/page.tsx @@ -0,0 +1,42 @@ +/** 创始人端通知页面。 */ + +import { Bell } from "lucide-react"; + +/** 通知页面。 */ +export default function NotificationsPage() { + const notifications = [ + { title: "月报审阅完成", content: "投资人已审阅 6 月月报,无修改意见。", time: "2 小时前", read: false }, + { title: "风险预警", content: "客户流失率连续 2 月上升,建议关注。", time: "5 小时前", read: false }, + { title: "协同机会", content: "智链科技与贵公司有供应链协同机会。", time: "1 天前", read: true }, + { title: "里程碑提醒", content: "A+ 轮融资目标日期 9 月 30 日,当前进度 45%。", time: "2 天前", read: true }, + ]; + + return ( +
+
+ +

通知

+
+ +
+ {notifications.map((n, i) => ( +
+
+
+

{n.title}

+

{n.content}

+
+ {n.time} +
+ {!n.read && ( +
+ )} +
+ ))} +
+
+ ); +} diff --git a/frontend/src/app/founder/okr-align/page.tsx b/frontend/src/app/founder/okr-align/page.tsx new file mode 100644 index 0000000..5231849 --- /dev/null +++ b/frontend/src/app/founder/okr-align/page.tsx @@ -0,0 +1,83 @@ +/** 创始人端 OKR 对齐视图 — 查看公司 OKR 与投资人期望的对齐情况。 */ + +"use client"; + +import { Target, CheckCircle2, Circle, AlertTriangle } from "lucide-react"; + +/** OKR 数据。 */ +interface OKR { + objective: string; + keyResults: { title: string; progress: number; aligned: boolean }[]; +} + +/** OKR 对齐视图页面。 */ +export default function OKRAlignPage() { + const okrs: OKR[] = [ + { + objective: "加速 AI 商业化落地", + keyResults: [ + { title: "完成 3 个 PoC 签约", progress: 67, aligned: true }, + { title: "AI 产品月营收达 100 万", progress: 45, aligned: true }, + { title: "客户满意度 NPS > 50", progress: 80, aligned: false }, + ], + }, + { + objective: "提升组织效能", + keyResults: [ + { title: "核心团队扩招 5 人", progress: 100, aligned: true }, + { title: "建立 OKR 季度复盘机制", progress: 100, aligned: true }, + { title: "人均产出提升 20%", progress: 60, aligned: true }, + ], + }, + ]; + + return ( +
+
+ +

OKR 对齐视图

+
+ + {/* 对齐度摘要 */} +
+
+ 投资人期望对齐度 + 85% +
+
+
+
+
+ + {/* OKR 列表 */} +
+ {okrs.map((okr, i) => ( +
+

{okr.objective}

+
+ {okr.keyResults.map((kr, j) => ( +
+ {kr.progress >= 100 ? ( +
+ ))} +
+
+ ))} +
+
+ ); +} diff --git a/frontend/src/app/founder/operations/page.tsx b/frontend/src/app/founder/operations/page.tsx new file mode 100644 index 0000000..ce4537c --- /dev/null +++ b/frontend/src/app/founder/operations/page.tsx @@ -0,0 +1,56 @@ +/** 经营驾驶舱页面 — 创始人端核心经营指标可视化。 */ + +"use client"; + +import { Gauge, TrendingUp, TrendingDown, Wallet, Users, Target, Cpu, AlertTriangle } from "lucide-react"; + +/** 经营驾驶舱页面。 */ +export default function OperationsPage() { + const kpis = [ + { label: "月营收", value: "800万", trend: "up", trendValue: "+15%", icon: Wallet, color: "text-emerald-600" }, + { label: "毛利率", value: "42%", trend: "up", trendValue: "+3%", icon: TrendingUp, color: "text-emerald-600" }, + { label: "客户数", value: "156", trend: "up", trendValue: "+12", icon: Users, color: "text-emerald-600" }, + { label: "Runway", value: "18 月", trend: "stable", trendValue: "持平", icon: Gauge, color: "text-blue-600" }, + { label: "OKR 进度", value: "68%", trend: "up", trendValue: "+8%", icon: Target, color: "text-indigo-600" }, + { label: "AI PoC", value: "3 个", trend: "up", trendValue: "+1", icon: Cpu, color: "text-indigo-600" }, + ]; + + return ( +
+
+ +

经营驾驶舱

+
+ + {/* KPI 卡片网格 */} +
+ {kpis.map((kpi) => ( +
+
+
+
{kpi.value}
+
{kpi.label}
+
+ ))} +
+ + {/* 风险提示 */} +
+
+
+
    +
  • • 客户流失率连续 2 月上升,建议制定回访计划
  • +
  • • 竞品发布类似产品,需加速差异化功能上线
  • +
+
+
+ ); +} diff --git a/frontend/src/app/founder/profile/page.tsx b/frontend/src/app/founder/profile/page.tsx new file mode 100644 index 0000000..d7ffeab --- /dev/null +++ b/frontend/src/app/founder/profile/page.tsx @@ -0,0 +1,47 @@ +/** 创始人端个人中心页面。 */ + +import { UserCircle, Building2, Mail, LogOut } from "lucide-react"; + +/** 个人中心页面。 */ +export default function ProfilePage() { + return ( +
+
+ +

我的

+
+ + {/* 用户信息 */} +
+
+
+
+
+

李明

+

智链科技 · 创始人 & CEO

+
+
+
+ + {/* 信息列表 */} +
+
+
+
+
+ +
+
+ ); +}