From 35da38e1c98c43859ead26dc7099400dca1e57c6 Mon Sep 17 00:00:00 2001 From: 666ghj <670939375@qq.com> Date: Thu, 11 Dec 2025 11:39:42 +0800 Subject: [PATCH] Add GraphPanel and WorkbenchPanel components for enhanced visualization and interaction - Introduced GraphPanel.vue for dynamic graph visualization, featuring real-time updates, node and edge detail panels, and loading states. - Added WorkbenchPanel.vue to manage ontology generation and graph building processes, including progress tracking and system logs. - Updated MainView.vue to integrate both panels, allowing users to switch between graph and workbench views seamlessly. - Enhanced styling across components for improved user experience and visual consistency. --- frontend/src/components/GraphPanel.vue | 460 +++++++++++++++ frontend/src/components/WorkbenchPanel.vue | 657 +++++++++++++++++++++ frontend/src/router/index.js | 2 +- frontend/src/views/MainView.vue | 465 +++++++++++++++ 4 files changed, 1583 insertions(+), 1 deletion(-) create mode 100644 frontend/src/components/GraphPanel.vue create mode 100644 frontend/src/components/WorkbenchPanel.vue create mode 100644 frontend/src/views/MainView.vue diff --git a/frontend/src/components/GraphPanel.vue b/frontend/src/components/GraphPanel.vue new file mode 100644 index 0000000..e7ebf16 --- /dev/null +++ b/frontend/src/components/GraphPanel.vue @@ -0,0 +1,460 @@ + + + + + + + ↻ + + + ⤢ + + + + + + + + + + + + + 实时更新中... + + + + + + {{ selectedItem.type === 'node' ? 'Node Details' : 'Relationship' }} + × + + + + + + Name + {{ selectedItem.data.name }} + + + Type + + {{ selectedItem.entityType }} + + + + + Properties + + + {{ key }}: + {{ value }} + + + + + + + + + {{ selectedItem.data.source_name }} + → + {{ selectedItem.data.name || 'RELATED_TO' }} + → + {{ selectedItem.data.target_name }} + + + + + + + + + 图谱数据加载中... + + + + + ❖ + 等待本体生成... + + + + + + + + {{ type.name }} + + + + + + + + diff --git a/frontend/src/components/WorkbenchPanel.vue b/frontend/src/components/WorkbenchPanel.vue new file mode 100644 index 0000000..041c80d --- /dev/null +++ b/frontend/src/components/WorkbenchPanel.vue @@ -0,0 +1,657 @@ + + + + + + + + 01 + 本体生成 + + + 已完成 + 生成中 + 等待 + + + + + POST /api/graph/ontology/generate + + 上传文档后,LLM分析文档内容,自动生成适合舆论模拟的本体结构(实体类型 + 关系类型)。 + + + + + + {{ ontologyProgress.message || '正在分析文档...' }} + + + + + + + {{ selectedOntologyItem.itemType === 'entity' ? 'ENTITY' : 'RELATION' }} + {{ selectedOntologyItem.name }} + + × + + + {{ selectedOntologyItem.description }} + + + + ATTRIBUTES + + + {{ attr.name }} + ({{ attr.type }}) + {{ attr.description }} + + + + + + + EXAMPLES + + {{ ex }} + + + + + + CONNECTIONS + + + {{ conn.source }} + → + {{ conn.target }} + + + + + + + + + GENERATED ENTITY TYPES + + + {{ entity.name }} + + + + + + + GENERATED RELATION TYPES + + + {{ rel.name }} + + + + + + + + + + + 02 + 图谱构建 + + + 已完成 + {{ buildProgress?.progress || 0 }}% + 等待 + + + + + POST /api/graph/build + + 基于生成的本体,将文档分块后调用 Zep API 构建知识图谱,提取实体和关系。 + + + + + + {{ graphStats.nodes }} + 实体节点 + + + {{ graphStats.edges }} + 关系边 + + + {{ graphStats.types }} + SCHEMA类型 + + + + + + + + + + 03 + 构建完成 + + + 进行中 + + + + + 图谱构建已完成,请进入下一步进行环境参数配置。 + + 进入环境搭建 ➝ + + + + + + + + + SYSTEM DASHBOARD + {{ projectData?.project_id || 'NO_PROJECT' }} + + + + {{ log.time }} + {{ log.msg }} + + + + + + + + + diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 5df5ac0..4bae635 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -1,6 +1,6 @@ import { createRouter, createWebHistory } from 'vue-router' import Home from '../views/Home.vue' -import Process from '../views/Process.vue' +import Process from '../views/MainView.vue' const routes = [ { diff --git a/frontend/src/views/MainView.vue b/frontend/src/views/MainView.vue new file mode 100644 index 0000000..0dab5c3 --- /dev/null +++ b/frontend/src/views/MainView.vue @@ -0,0 +1,465 @@ + + + + + + MIROFISH + + + + + + {{ mode.toUpperCase() }} + + + + + + + + + {{ statusText }} + + + + + + + + + + + + + + + + + + + + + +
图谱数据加载中...
等待本体生成...
POST /api/graph/ontology/generate
+ 上传文档后,LLM分析文档内容,自动生成适合舆论模拟的本体结构(实体类型 + 关系类型)。 +
POST /api/graph/build
+ 基于生成的本体,将文档分块后调用 Zep API 构建知识图谱,提取实体和关系。 +
图谱构建已完成,请进入下一步进行环境参数配置。