From 5f9d19ac653ba8a4c2d30db89ffc7d2b9a60590a Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 28 Oct 2024 17:21:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/overview/components/Topology/index.vue | 7 +++++++ src/views/monitor/topologyBuild/index.vue | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/views/dashboard/overview/components/Topology/index.vue b/src/views/dashboard/overview/components/Topology/index.vue index 54c57cc5..29fcde82 100644 --- a/src/views/dashboard/overview/components/Topology/index.vue +++ b/src/views/dashboard/overview/components/Topology/index.vue @@ -5,6 +5,7 @@ import { listAllNeInfo } from '@/api/ne/neInfo'; import { message } from 'ant-design-vue/es'; import { getGraphData } from '@/api/monitor/topology'; import { Graph, GraphData, Tooltip } from '@antv/g6'; +import { parseBasePath } from '@/plugins/file-static-url'; import { edgeLineAnimateState } from '@/views/monitor/topologyBuild/hooks/registerEdge'; import { nodeImageAnimateState } from '@/views/monitor/topologyBuild/hooks/registerNode'; import { @@ -186,6 +187,12 @@ function fnGraphDataLoad(reload: boolean = false) { const nf: Record[] = nodes.filter( (node: Record) => { Reflect.set(node, 'neState', { online: false }); + // 图片路径处理 + if (node.img) node.img = parseBasePath(node.img); + if (node.icon.show && node.icon?.img) { + node.icon.img = parseBasePath(node.icon.img); + } + // 遍历是否有网元数据 const nodeID: string = node.id; const hasNe = res.neList.some(ne => { Reflect.set(node, 'neInfo', ne.neType === nodeID ? ne : {}); diff --git a/src/views/monitor/topologyBuild/index.vue b/src/views/monitor/topologyBuild/index.vue index 74ce3061..f94a617e 100644 --- a/src/views/monitor/topologyBuild/index.vue +++ b/src/views/monitor/topologyBuild/index.vue @@ -13,6 +13,7 @@ import { } from '@/api/monitor/topology'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { Form, Modal, message } from 'ant-design-vue/es'; +import { parseBasePath } from '@/plugins/file-static-url'; const { t } = useI18n(); const { graphMode, graphModeOptions, handleRanderGraph, handleChangeMode } = useGraph(); @@ -80,6 +81,14 @@ function fnGraphDataLoad(reload: boolean = false) { getGraphData(graphState.group) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { + res.data.nodes.map((item: any) => { + // 图片路径处理 + if (item.img) item.img = parseBasePath(item.img); + if (item.icon.show && item.icon?.img) { + item.icon.img = parseBasePath(item.icon.img); + } + return item; + }); graphState.data = res.data; } })