这件事值得留下来?沉淀成知识
++ 会把标题、备注、时间线和评论整理成一份草稿,默认进「待核对」,不会直接对外发布。 +
+{notice}
} {error &&{error}
} {busy &&处理中…
} diff --git a/web/src/components/WorkspaceNav.tsx b/web/src/components/WorkspaceNav.tsx index 9467a02..5cefa7a 100644 --- a/web/src/components/WorkspaceNav.tsx +++ b/web/src/components/WorkspaceNav.tsx @@ -6,6 +6,7 @@ const TABS = [ { path: "", label: "任务" }, { path: "/board", label: "看板" }, { path: "/tickets", label: "工单" }, + { path: "/knowledge", label: "知识" }, { path: "/members", label: "成员" }, ]; diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index 43f4ba0..b8a396e 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -112,3 +112,31 @@ export interface Notification { read_at: string | null; created_at: string; } + +export type KnowledgeStatus = "draft" | "in_review" | "published" | "archived"; + +export interface KnowledgeInfo { + doc_type: string; + summary: string; + status_hint: KnowledgeStatus; + source_kind: "manual" | "task" | "ticket"; + source_item_id: string | null; + generated_by: "human" | "rule"; + published_at: string | null; + archived_at: string | null; + chunk_count: number; + author_id: string; +} + +export interface KnowledgeSource { + id: string; + kind: string; + title: string; + status: string; +} + +export interface Knowledge extends Item { + knowledge: KnowledgeInfo; + source: KnowledgeSource | null; + activities?: Activity[]; +} diff --git a/web/src/pages/Knowledge.tsx b/web/src/pages/Knowledge.tsx new file mode 100644 index 0000000..a367b8f --- /dev/null +++ b/web/src/pages/Knowledge.tsx @@ -0,0 +1,390 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { useParams } from "react-router-dom"; +import { Layout } from "../components/Layout"; +import { WorkspaceNav } from "../components/WorkspaceNav"; +import { ApiError, api } from "../lib/client"; +import type { Knowledge, KnowledgeStatus } from "../lib/types"; + +const TABS = [ + { key: "draft", label: "待核对", statuses: ["draft", "in_review"] }, + { key: "published", label: "已发布", statuses: ["published"] }, + { key: "archived", label: "已归档", statuses: ["archived"] }, + { key: "all", label: "全部", statuses: [] }, +] as const; + +const DOC_TYPE_LABEL: Record+ 工单验收通过会自动整理一份草稿;核对无误再发布,发布后才会进入团队检索 +
++ 手记的知识没有来源,它是你自己的笔记;想沉淀某件事,去那件事的详情里点「沉淀成知识」。 +
+{error}
} + + {docs.length === 0 && !loading && ( +