wujingjing
2024-10-30 111a9f347755ae791d3d88373a18a5dfeff4c53c
src/views/project/yw/systemManage/agentGraph/AgentGraph.vue
@@ -1,11 +1,11 @@
<template>
   <div v-loading="firstLoading" class="h-full bg-white relative">
   <div v-loading="firstLoading" class="h-full w-full bg-white relative">
      <!-- <div class="absolute right-4 top-4 z-10">
         
         <span class="ywifont ywicon-zishiying cursor-pointer" title="自适应" @click="selfAdaptClick"></span>
      </div> -->
      <div class="h-full" ref="graphRef"></div>
      <div class="h-full w-full" ref="graphRef"></div>
      <div
         class="absolute left-4 top-4 z-10 w-16 divide-y-[1.5px] divide-solid divide-gray-100 rounded-lg"
@@ -191,7 +191,7 @@
         children: metricsList.map((curVal) => {
            const metricsTreeId = `${agentTreeId}-metrics-${curVal.id}`;
            const metrics = {
               treeId:metricsTreeId,
               treeId: metricsTreeId,
               logicId: curVal.id,
               type: 'metrics',
@@ -200,7 +200,7 @@
                  return this.model.title;
               },
               children: (curVal.dimensions ?? []).map((item) => {
                  const dimensionTreeId = `${metricsTreeId}-dimension-${item.id}`
                  const dimensionTreeId = `${metricsTreeId}-dimension-${item.id}`;
                  return {
                     treeId: dimensionTreeId,
                     logicId: item.id,
@@ -216,13 +216,13 @@
         }, []),
      },
   ];
   console.log('🚀 ~ logicTree:', logicTree);
   const resData = logicTree;
   return resData;
};
const selfAdapt = () => {
   graph.zoomToFit();
   graph.zoom(-0.05);
   setTimeout(() => {
      graph.zoomToFit();
   }, 100);
};
//#region ====================== 工具栏 ======================