+
状态:
+ ${hasNeID ? '正常' : '异常'}
+
+
刷新时间:
+ ${serverState.refreshTime ?? '--'}
+
+
ID:${hasNeID}
+
名称:${serverState.neName ?? '--'}
+
版本:
+ ${serverState.version ?? '--'}
+
+
SN:${serverState.sn ?? '--'}
+
有效期:
+ ${serverState.expire ?? '--'}
+
+
+ `;
+ },
+ itemTypes: ['node'],
+ });
+
+ const { edges: processedEdges } = processNodesEdges(
+ currentUnproccessedData.nodes,
+ currentUnproccessedData.edges,
+ CANVAS_WIDTH,
+ CANVAS_HEIGHT,
+ true,
+ true
+ );
+
+ graph = new Graph({
+ container: graphG6Dom,
+ width: graphG6Dom?.clientWidth,
+ height: graphG6Dom?.clientHeight,
+ linkCenter: true,
+ minZoom: 0.1,
+ groupByTypes: false,
+ modes: {
+ default: [
+ {
+ type: 'drag-canvas',
+ enableOptimize: true,
+ },
+ {
+ type: 'zoom-canvas',
+ enableOptimize: true,
+ optimizeZoom: 0.01,
+ },
+ 'drag-node',
+ ],
+ lassoSelect: [
+ {
+ type: 'zoom-canvas',
+ enableOptimize: true,
+ optimizeZoom: 0.01,
+ },
+ {
+ type: 'lasso-select',
+ selectedState: 'focus',
+ trigger: 'drag',
+ },
+ ],
+ fisheyeMode: [],
+ },
+ defaultNode: {
+ type: 'aggregated-node',
+ size: DEFAULTNODESIZE,
+ },
+ plugins: [contextMenu, tooltip],
+ });
+
+ graph.get('canvas').set('localRefresh', false);
+
+ const layoutConfig = getForceLayoutConfig(graph, largeGraphMode);
+ layoutConfig.center = [CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2];
+ layout.instance = new Layout['gForce'](layoutConfig);
+ layout.instance.init({
+ nodes: aggregatedData.nodes,
+ edges: processedEdges,
+ });
+ layout.instance.execute();
+ // console.log(processedEdges)
+ bindListener(graph);
+ // graph.data({ nodes: aggregatedData.nodes, edges: processedEdges });
+ graph.data({ nodes: aggregatedData.nodes, edges: processedEdges });
+ graph.render();
+
+ // 节点展开
+ for (const model of aggregatedData.nodes) {
+ const newArray = manageExpandCollapseArray(
+ graph.getNodes().length,
+ model,
+ collapseArray,
+ expandArray
+ );
+ expandArray = newArray.expandArray;
+ collapseArray = newArray.collapseArray;
+ let mixedGraphData = getMixedGraph(
+ clusteredData,
+ data,
+ nodeMap,
+ aggregatedNodeMap,
+ expandArray,
+ collapseArray
+ );
+ if (mixedGraphData) {
+ cachePositions = cacheNodePositions(graph.getNodes());
+ let currentUnproccessedData = mixedGraphData;
+ handleRefreshGraph(
+ graph,
+ currentUnproccessedData,
+ CANVAS_WIDTH,
+ CANVAS_HEIGHT,
+ largeGraphMode,
+ true
+ );
+ }
+ }
+
+ return graph;
+}
diff --git a/src/views/monitor/topology/index.vue b/src/views/monitor/topology/index.vue
index 8566e536..87a97a64 100644
--- a/src/views/monitor/topology/index.vue
+++ b/src/views/monitor/topology/index.vue
@@ -3,445 +3,161 @@ import { reactive, onMounted, ref } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import ChartGraphG6 from '@/components/ChartGraphG6/index.vue';
import useI18n from '@/hooks/useI18n';
-import useNeInfoStore from '@/store/modules/neinfo';
-import { Graph, GraphData } from '@antv/g6';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
+import { listNe, stateNe } from '@/api/ne/ne';
import message from 'ant-design-vue/lib/message';
-const neInfoStore = useNeInfoStore();
+import { randerGroph } from './graph';
+import { parseDateToStr } from '@/utils/date-utils';
const { t } = useI18n();
/**图DOM节点实例对象 */
const graphG6Dom = ref