diff --git a/src/pages/IttoCollectionsPage.tsx b/src/pages/IttoCollectionsPage.tsx index 9521a00..dfb7c7c 100644 --- a/src/pages/IttoCollectionsPage.tsx +++ b/src/pages/IttoCollectionsPage.tsx @@ -4,7 +4,6 @@ import { FileOutput, FileText, Wrench } from 'lucide-react' import { artifactMap, knowledgeAreas, - processGroups, processes, toolMap, normalizeProcessRef, @@ -14,9 +13,10 @@ import type { Process, ProcessRef } from '@/types/itto' type ViewKey = 'inputs' | 'tools' | 'outputs' type CollectionRow = { - processGroupId: string - processGroupName: string - color: string + processId: string + processCode: string + processName: string + processNameEn: string items: string[] } @@ -67,22 +67,16 @@ function uniqueItems(items: string[]) { function buildCollection(viewKey: ViewKey): CollectionArea[] { return knowledgeAreas.map((area) => { - const areaProcesses = processes.filter((process) => process.knowledgeAreaId === area.id) - const rows = processGroups.map((group) => { - const groupProcesses = areaProcesses.filter((process) => process.processGroupId === group.id) - const items = uniqueItems( - groupProcesses.flatMap((process) => - getRefsByView(process, viewKey).map((ref) => formatRef(ref, viewKey)) - ) - ) - - return { - processGroupId: group.id, - processGroupName: group.name, - color: group.color, - items, - } - }).filter((row) => row.items.length > 0) + const rows = processes + .filter((process) => process.knowledgeAreaId === area.id) + .sort((a, b) => a.order - b.order) + .map((process) => ({ + processId: process.id, + processCode: process.code, + processName: process.name, + processNameEn: process.nameEn, + items: uniqueItems(getRefsByView(process, viewKey).map((ref) => formatRef(ref, viewKey))), + })) return { id: area.id, @@ -98,13 +92,14 @@ function buildCollection(viewKey: ViewKey): CollectionArea[] { export function IttoCollectionsPage() { const [activeTab, setActiveTab] = useState('inputs') const collection = useMemo(() => buildCollection(activeTab), [activeTab]) + const activeLabel = tabs.find((tab) => tab.key === activeTab)?.label return (

输入 · 工具 · 输出

-

按知识领域与过程组汇总

+

按知识领域与子过程汇总

{tabs.map((tab) => { @@ -162,24 +157,30 @@ export function IttoCollectionsPage() { - {area.rows.map((row) => ( - +
- 过程组 + + 子过程 - {tabs.find((tab) => tab.key === activeTab)?.label} + {activeLabel}
- - {row.processGroupName} - +
+ + {row.processCode} + +
+
{row.processName}
+
{row.processNameEn}
+
+
{row.items.join(';')}