docs(uiux): UIUX 设计方案大改 + 5 份作业指导书对齐 + 开发任务文档
- UIUX 文档:填充 19 个缺口(多主体画像/健康度/AI+看板/增长域/洞察域/创始人端/OODA/助推/商密) - UIUX 文档:插入 6 个新章节(十四~十九),旧章节重编号为二十~三十一,更新目录和交叉引用 - 作业指导书 x5:导航改为 6 域分组,新增 Context Bar/工作模式/Insight Rail/决策线程/多工作区等 UI 概念 - 新建 docs/2-task-uiux.md:50 个代码落地开发任务,按 P0-P6 分优先级 + 8 Sprint 规划 - 后端/前端:大量新增模型、路由、组件(来自之前 Phase 开发)
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { AlertTriangle } from "lucide-react";
|
||||
import { listMajorEvents, listInquiries } from "@/lib/api-v2";
|
||||
import { PageContainer, Badge } from "@/components/shared/PageContainer";
|
||||
import { LoadingSpinner } from "@/components/shared/LoadingSpinner";
|
||||
import { EmptyState } from "@/components/shared/EmptyState";
|
||||
|
||||
export default function EventsPage() {
|
||||
const [events, setEvents] = useState<Record<string, any>[]>([]);
|
||||
const [inquiries, setInquiries] = useState<Record<string, any>[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [tab, setTab] = useState<"events" | "inquiries">("events");
|
||||
|
||||
useEffect(() => {
|
||||
Promise.all([listMajorEvents(), listInquiries()])
|
||||
.then(([e, i]) => {
|
||||
setEvents((e.data as Record<string, any>[]) ?? []);
|
||||
setInquiries((i.data as Record<string, any>[]) ?? []);
|
||||
})
|
||||
.catch(() => {
|
||||
setEvents([]);
|
||||
setInquiries([]);
|
||||
})
|
||||
.finally(() => setIsLoading(false));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageContainer title="重大事项 & 追问清单" description="AI 从月报/弱信号中自动识别重大事项 + 生成追问清单">
|
||||
<div className="flex gap-2 border-b border-gray-200">
|
||||
<button
|
||||
onClick={() => setTab("events")}
|
||||
className={`px-4 py-2 text-sm font-medium ${tab === "events" ? "border-b-2 border-gray-900 text-gray-900" : "text-gray-500"}`}
|
||||
>
|
||||
重大事项
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setTab("inquiries")}
|
||||
className={`px-4 py-2 text-sm font-medium ${tab === "inquiries" ? "border-b-2 border-gray-900 text-gray-900" : "text-gray-500"}`}
|
||||
>
|
||||
追问清单
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{isLoading ? (
|
||||
<LoadingSpinner />
|
||||
) : tab === "events" ? (
|
||||
events.length === 0 ? (
|
||||
<EmptyState description="暂无重大事项" />
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
{events.map((item, i) => (
|
||||
<div key={i} className="rounded-lg border border-gray-200 bg-white p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge color="blue">{item.event_type as string}</Badge>
|
||||
<h3 className="font-medium text-gray-900">{item.title as string}</h3>
|
||||
</div>
|
||||
<Badge color={item.severity === "critical" ? "red" : item.severity === "high" ? "amber" : "gray"}>
|
||||
{item.severity as string}
|
||||
</Badge>
|
||||
</div>
|
||||
{item.description && <p className="mt-2 text-sm text-gray-600">{item.description as string}</p>}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
inquiries.length === 0 ? (
|
||||
<EmptyState description="暂无追问清单" />
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
{inquiries.map((item, i) => (
|
||||
<div key={i} className="rounded-lg border border-gray-200 bg-white p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="font-medium text-gray-900">追问清单</h3>
|
||||
<Badge color={item.status === "answered" ? "green" : item.status === "closed" ? "gray" : "amber"}>
|
||||
{item.status as string}
|
||||
</Badge>
|
||||
</div>
|
||||
<div className="mt-2 space-y-1">
|
||||
{Array.isArray(item.questions) && (item.questions as unknown[]).map((q, qi) => (
|
||||
<p key={qi} className="text-sm text-gray-600">• {String(q)}</p>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user