feat(frontend): 全局企业筛选同步 — 各页面显示企业名标签

- 新增 useCompanyName hook 和 CompanyNameTag 组件
- 20+ investor 页面添加 CompanyNameTag 显示企业名
- 表格型页面(agents/agreements/board/weak-signals/talents/reports)新增企业列
- 卡片型页面(risks/synergies/sentinels/alpha/exit-signals/okrs/aars/events/tasks/pre-mortems/nudges/product-diagnostics/peer-circles)添加企业名标签
- customer-success 改用 CompanyNameTag 替代手动 company_name 显示
- PlanCard 组件添加企业名标签
- 编译验证通过
This commit is contained in:
selfrelease
2026-07-20 08:22:24 +08:00
parent c3232f73c8
commit 006fd7de7e
23 changed files with 112 additions and 6 deletions
@@ -1,6 +1,7 @@
"use client";
import { Target, ArrowRight, DollarSign, Users, Trophy } from "lucide-react";
import { CompanyNameTag } from "@/components/shared/CompanyNameTag";
/** 决策链节点。 */
interface DecisionChainNode {
@@ -16,6 +17,7 @@ interface CompetitiveAnalysis {
/** 客户获取方案。 */
interface CustomerPlanData {
company_id?: string;
target_customer?: string;
execution_status?: string;
entry_angle?: string;
@@ -40,6 +42,7 @@ export function PlanCard({ plan }: { plan: CustomerPlanData }) {
<div className="flex items-start justify-between">
<div className="flex items-center gap-2">
<Target size={18} className="text-[var(--investor-primary)]" />
<CompanyNameTag companyId={plan.company_id} />
<h3 className="text-sm font-medium">{plan.target_customer || "未指定目标客户"}</h3>
</div>
<span className={`rounded px-2 py-0.5 text-xs ${plan.execution_status ? (statusColors[plan.execution_status] || "bg-muted") : "bg-muted"}`}>
+6 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { AlertTriangle, Trash2 } from "lucide-react";
import { AlertTriangle, Trash2, Building2 } from "lucide-react";
import {
RISK_STATUS_LABELS,
RISK_STATUS_COLORS,
@@ -9,6 +9,7 @@ import {
RISK_TYPE_LABELS,
type RiskEvent,
} from "@/lib/risks";
import { useCompanyName } from "@/lib/company-scope";
/** 风险卡片组件 — 从风险工作台抽取的独立组件。 */
@@ -22,6 +23,7 @@ interface RiskCardProps {
* 风险事件卡片。
*/
export function RiskCard({ risk, onStatusChange, onDelete }: RiskCardProps) {
const getCompanyName = useCompanyName();
return (
<div className="rounded-lg border bg-white p-4 shadow-sm">
<div className="flex items-start justify-between">
@@ -38,6 +40,9 @@ export function RiskCard({ risk, onStatusChange, onDelete }: RiskCardProps) {
</span>
</div>
<div className="mt-2 flex gap-3 text-xs text-muted-foreground">
<span className="flex items-center gap-1 font-medium text-[var(--investor-primary)]">
<Building2 size={12} aria-hidden="true" />{getCompanyName(risk.company_id)}
</span>
<span>{RISK_TYPE_LABELS[risk.type] || risk.type}</span>
<span className={SEVERITY_COLORS[risk.severity]}>
: {SEVERITY_LABELS[risk.severity] || risk.severity}
@@ -0,0 +1,15 @@
"use client";
import { Building2 } from "lucide-react";
import { useCompanyName } from "@/lib/company-scope";
/** 企业名标签 — 在数据项旁显示所属企业名。 */
export function CompanyNameTag({ companyId, className = "" }: { companyId?: string | null; className?: string }) {
const getCompanyName = useCompanyName();
return (
<span className={`inline-flex items-center gap-1 text-xs font-medium text-[var(--investor-primary)] ${className}`}>
<Building2 size={12} aria-hidden="true" />
{getCompanyName(companyId)}
</span>
);
}