fix: 解决关系网问题
Showing
3 changed files
with
16 additions
and
3 deletions
| ... | @@ -247,6 +247,11 @@ const initGraph = () => { | ... | @@ -247,6 +247,11 @@ const initGraph = () => { |
| 247 | } | 247 | } |
| 248 | const data = item.getModel(); | 248 | const data = item.getModel(); |
| 249 | data.collapsed = collapsed; | 249 | data.collapsed = collapsed; |
| 250 | setTimeout(() => { | ||
| 251 | graph.focusItem(item, true, { | ||
| 252 | duration: 400 // 动画时长为500ms | ||
| 253 | }); | ||
| 254 | }, 500) | ||
| 250 | return true; | 255 | return true; |
| 251 | }, | 256 | }, |
| 252 | shouldBegin: (e) => { | 257 | shouldBegin: (e) => { |
| ... | @@ -472,7 +477,9 @@ const bindEvents = () => { | ... | @@ -472,7 +477,9 @@ const bindEvents = () => { |
| 472 | } | 477 | } |
| 473 | }); | 478 | }); |
| 474 | lastSelectNode.value = item; | 479 | lastSelectNode.value = item; |
| 475 | detailInfo.value.guid = model.guid; | 480 | detailInfo.value = {}; |
| 481 | // detailInfo.value.guid = model.guid; | ||
| 482 | detailInfoLabel.value = model.label || {}; | ||
| 476 | updateTooltipPosition(evt); | 483 | updateTooltipPosition(evt); |
| 477 | 484 | ||
| 478 | detailLoading.value = true; | 485 | detailLoading.value = true; | ... | ... |
| ... | @@ -7,8 +7,8 @@ | ... | @@ -7,8 +7,8 @@ |
| 7 | <div className='g6-component-topbar'> | 7 | <div className='g6-component-topbar'> |
| 8 | <graphTopbar ref="topBarRef" @displaySwitchChange="displaySwitchChange" :isGraphDisplay="isGraphDisplay" /> | 8 | <graphTopbar ref="topBarRef" @displaySwitchChange="displaySwitchChange" :isGraphDisplay="isGraphDisplay" /> |
| 9 | </div> | 9 | </div> |
| 10 | <RelationNetwork v-show="graphTreeData?.guid && isGraphDisplay" ref="relationNetworkRef" :tree-data="graphTreeData" :noContextMenu="true" | 10 | <RelationNetwork v-show="graphTreeData?.guid && isGraphDisplay" ref="relationNetworkRef" :tree-data="graphTreeData" |
| 11 | @nodeItemClick="handleNodeItemClick"> | 11 | :noContextMenu="true" @nodeItemClick="handleNodeItemClick"> |
| 12 | </RelationNetwork> | 12 | </RelationNetwork> |
| 13 | <Sankey v-show="!isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)" v-loading="sankeyDataLoading" | 13 | <Sankey v-show="!isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)" v-loading="sankeyDataLoading" |
| 14 | :tree-data="sankeyData" :names="sankeyNames"> | 14 | :tree-data="sankeyData" :names="sankeyNames"> |
| ... | @@ -128,6 +128,9 @@ const handleNodeItemClick = (graph, nodeItem) => { | ... | @@ -128,6 +128,9 @@ const handleNodeItemClick = (graph, nodeItem) => { |
| 128 | graph.layout(); | 128 | graph.layout(); |
| 129 | graph.setMinZoom(0.5); | 129 | graph.setMinZoom(0.5); |
| 130 | graph.setMaxZoom(5); | 130 | graph.setMaxZoom(5); |
| 131 | graph.focusItem(nodeItem, true, { | ||
| 132 | duration: 400 // 动画时长为500ms | ||
| 133 | }); | ||
| 131 | }, 500); | 134 | }, 500); |
| 132 | } else { | 135 | } else { |
| 133 | parentData.isLoading = false; | 136 | parentData.isLoading = false; | ... | ... |
| ... | @@ -204,6 +204,9 @@ const handleNodeItemClick = (graph, nodeItem) => { | ... | @@ -204,6 +204,9 @@ const handleNodeItemClick = (graph, nodeItem) => { |
| 204 | graph.layout(); | 204 | graph.layout(); |
| 205 | graph.setMinZoom(0.5); | 205 | graph.setMinZoom(0.5); |
| 206 | graph.setMaxZoom(5); | 206 | graph.setMaxZoom(5); |
| 207 | graph.focusItem(nodeItem, true, { | ||
| 208 | duration: 500 // 动画时长为500ms | ||
| 209 | }); | ||
| 207 | }, 500); | 210 | }, 500); |
| 208 | } else { | 211 | } else { |
| 209 | parentData.isLoading = false; | 212 | parentData.isLoading = false; | ... | ... |
-
Please register or sign in to post a comment