From e0f6b66ed1702037b1cbecd7cefe20135064a45d Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sun, 24 Aug 2025 16:51:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E5=9C=A8=E5=9B=BE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=A7=86=E5=9B=BE=E6=B7=BB=E5=8A=A0=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=BC=B9=E7=AA=97=E5=B9=B6=E4=BC=98=E5=8C=96=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增图数据库说明弹窗,包含使用说明和查询逻辑 - 修复拼写错误(randerGraph -> renderGraph) - 优化状态显示,添加状态文本 - 调整搜索框宽度为300px - 重命名precessing为processing以保持一致性 - 简化图数据库描述信息,移除模型显示 --- web/src/views/GraphView.vue | 97 +++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 19 deletions(-) diff --git a/web/src/views/GraphView.vue b/web/src/views/GraphView.vue index 5e45f90b..f8d81f83 100644 --- a/web/src/views/GraphView.vue +++ b/web/src/views/GraphView.vue @@ -16,10 +16,14 @@ @@ -93,7 +119,7 @@ import { Graph } from "@antv/g6"; import { computed, onMounted, reactive, ref, h } from 'vue'; import { message, Button as AButton } from 'ant-design-vue'; import { useConfigStore } from '@/stores/config'; -import { UploadOutlined, SyncOutlined, GlobalOutlined } from '@ant-design/icons-vue'; +import { UploadOutlined, SyncOutlined, GlobalOutlined, InfoCircleOutlined } from '@ant-design/icons-vue'; import HeaderComponent from '@/components/HeaderComponent.vue'; import { neo4jApi } from '@/apis/graph_api'; import { useUserStore } from '@/stores/user'; @@ -118,6 +144,7 @@ const state = reactive({ searchInput: '', searchLoading: false, showModal: false, + showInfoModal: false, precessing: false, indexing: false, showPage: true, @@ -185,7 +212,7 @@ const getGraphData = () => { } const addDocumentByFile = () => { - state.precessing = true + state.processing = true const files = fileList.value.filter(file => file.status === 'done').map(file => file.response.file_path) neo4jApi.addEntities(files[0]) .then((data) => { @@ -200,7 +227,7 @@ const addDocumentByFile = () => { console.error(error) message.error(error.message || '添加文件失败'); }) - .finally(() => state.precessing = false) + .finally(() => state.processing = false) }; const loadSampleNodes = () => { @@ -210,7 +237,7 @@ const loadSampleNodes = () => { graphData.nodes = data.result.nodes graphData.edges = data.result.edges console.log(graphData) - setTimeout(() => randerGraph(), 500) + setTimeout(() => renderGraph(), 500) }) .catch((error) => { console.error(error) @@ -263,7 +290,7 @@ const onSearch = () => { .finally(() => state.searchLoading = false) }; -const randerGraph = () => { +const renderGraph = () => { if (graphInstance) { graphInstance.destroy(); @@ -315,7 +342,7 @@ const initGraph = () => { }, behaviors: ['drag-element', 'zoom-canvas', 'drag-canvas'], }); - window.addEventListener('resize', randerGraph); + window.addEventListener('resize', renderGraph); } onMounted(() => { @@ -348,10 +375,9 @@ const graphDescription = computed(() => { const dbName = graphInfo.value?.graph_name || ''; const entityCount = graphInfo.value?.entity_count || 0; const relationCount = graphInfo.value?.relationship_count || 0; - const modelName = graphInfo.value?.embed_model_name || '未上传文件'; const unindexed = unindexedCount.value > 0 ? `,${unindexedCount.value}个节点未索引` : ''; - return `${dbName} - 共 ${entityCount} 实体,${relationCount} 个关系(不含知识库创建的图谱)。向量模型:${modelName}${unindexed}`; + return `${dbName} - 共 ${entityCount} 实体,${relationCount} 个关系;${unindexed}`; }); // 为未索引节点添加索引 @@ -362,7 +388,7 @@ const indexNodes = () => { return } - if (state.precessing) { + if (state.processing) { message.error('后台正在处理,请稍后再试') return } @@ -407,6 +433,10 @@ const openLink = (url) => { color: rgba(0, 0, 0, 0.65); } +.status-text { + margin-left: 8px; +} + .status-indicator { width: 12px; height: 12px; @@ -502,4 +532,33 @@ const openLink = (url) => { flex-direction: column; color: var(--gray-900); } + +.info-content { + line-height: 1.6; + + ul { + padding-left: 20px; + margin: 10px 0; + } + + li { + margin: 8px 0; + } + + code { + background-color: #f0f0f0; + padding: 2px 4px; + border-radius: 4px; + font-family: monospace; + } + + pre { + background-color: #f8f8f8; + padding: 12px; + border-radius: 4px; + overflow-x: auto; + margin: 15px 0; + font-size: 13px; + } +}