Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
4 changed files
with
61 additions
and
34 deletions
| ... | @@ -82,7 +82,7 @@ watch(() => props.treeData, (val) => { | ... | @@ -82,7 +82,7 @@ watch(() => props.treeData, (val) => { |
| 82 | 82 | ||
| 83 | const renderGraph = (graph: any, lineageData: any) => { | 83 | const renderGraph = (graph: any, lineageData: any) => { |
| 84 | if (!graph || !lineageData) return; | 84 | if (!graph || !lineageData) return; |
| 85 | graph.setMinZoom(0.7); | 85 | graph.setMinZoom(1); |
| 86 | graph.setMaxZoom(1); | 86 | graph.setMaxZoom(1); |
| 87 | graph.data(lineageData); | 87 | graph.data(lineageData); |
| 88 | graph.render(); | 88 | graph.render(); |
| ... | @@ -230,7 +230,7 @@ const initGraph = () => { | ... | @@ -230,7 +230,7 @@ const initGraph = () => { |
| 230 | container: container, | 230 | container: container, |
| 231 | width, | 231 | width, |
| 232 | height, | 232 | height, |
| 233 | // animate: false, | 233 | // animate: false, |
| 234 | plugins: [contextMenu, tooltip.value], | 234 | plugins: [contextMenu, tooltip.value], |
| 235 | fitCenter: true, | 235 | fitCenter: true, |
| 236 | fitView: true, | 236 | fitView: true, |
| ... | @@ -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) => { |
| ... | @@ -260,7 +265,7 @@ const initGraph = () => { | ... | @@ -260,7 +265,7 @@ const initGraph = () => { |
| 260 | ], | 265 | ], |
| 261 | }, | 266 | }, |
| 262 | defaultNode: { | 267 | defaultNode: { |
| 263 | size: 24, | 268 | size: 20, |
| 264 | anchorPoints: [ | 269 | anchorPoints: [ |
| 265 | [0, 0.5], | 270 | [0, 0.5], |
| 266 | [1, 0.5], | 271 | [1, 0.5], |
| ... | @@ -287,7 +292,7 @@ const initGraph = () => { | ... | @@ -287,7 +292,7 @@ const initGraph = () => { |
| 287 | return 16; | 292 | return 16; |
| 288 | }, | 293 | }, |
| 289 | getVGap: function getVGap() { | 294 | getVGap: function getVGap() { |
| 290 | return 25; | 295 | return 15; |
| 291 | }, | 296 | }, |
| 292 | getHGap: function getHGap() { | 297 | getHGap: function getHGap() { |
| 293 | return 120; | 298 | return 120; |
| ... | @@ -301,7 +306,7 @@ const initGraph = () => { | ... | @@ -301,7 +306,7 @@ const initGraph = () => { |
| 301 | label: handleLabelLength((node.isField ? node.metaStandardId : node.standardName) as string), | 306 | label: handleLabelLength((node.isField ? node.metaStandardId : node.standardName) as string), |
| 302 | collapsed: node.children?.length ? false : true, | 307 | collapsed: node.children?.length ? false : true, |
| 303 | labelCfg: { | 308 | labelCfg: { |
| 304 | offset: 10, | 309 | offset: 7, |
| 305 | style: { | 310 | style: { |
| 306 | fontSize: 13, | 311 | fontSize: 13, |
| 307 | fill: '#212121', | 312 | fill: '#212121', |
| ... | @@ -364,7 +369,7 @@ const observeResize = () => { | ... | @@ -364,7 +369,7 @@ const observeResize = () => { |
| 364 | return; | 369 | return; |
| 365 | } | 370 | } |
| 366 | graphRef.value.changeSize(width, height); | 371 | graphRef.value.changeSize(width, height); |
| 367 | graphRef.value.setMinZoom(0.7); | 372 | graphRef.value.setMinZoom(1); |
| 368 | graphRef.value.setMaxZoom(1); | 373 | graphRef.value.setMaxZoom(1); |
| 369 | graphRef.value.fitView(40, { direction: 'both' }); | 374 | graphRef.value.fitView(40, { direction: 'both' }); |
| 370 | graphRef.value.fitCenter(); | 375 | graphRef.value.fitCenter(); |
| ... | @@ -380,7 +385,7 @@ const observeResize = () => { | ... | @@ -380,7 +385,7 @@ const observeResize = () => { |
| 380 | return; | 385 | return; |
| 381 | } | 386 | } |
| 382 | graphRef.value.changeSize(width, height); | 387 | graphRef.value.changeSize(width, height); |
| 383 | graphRef.value.setMinZoom(0.7); | 388 | graphRef.value.setMinZoom(1); |
| 384 | graphRef.value.setMaxZoom(1); | 389 | graphRef.value.setMaxZoom(1); |
| 385 | graphRef.value.fitView(40, { direction: 'both' }); | 390 | graphRef.value.fitView(40, { direction: 'both' }); |
| 386 | graphRef.value.fitCenter(); | 391 | graphRef.value.fitCenter(); |
| ... | @@ -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; |
| ... | @@ -600,7 +607,7 @@ defineExpose({ | ... | @@ -600,7 +607,7 @@ defineExpose({ |
| 600 | overflow-y: auto; | 607 | overflow-y: auto; |
| 601 | 608 | ||
| 602 | .title { | 609 | .title { |
| 603 | font-size: 16px; | 610 | font-size: 14px; |
| 604 | color: #212121; | 611 | color: #212121; |
| 605 | line-height: 24px; | 612 | line-height: 24px; |
| 606 | font-weight: 600; | 613 | font-weight: 600; |
| ... | @@ -608,7 +615,7 @@ defineExpose({ | ... | @@ -608,7 +615,7 @@ defineExpose({ |
| 608 | 615 | ||
| 609 | .row { | 616 | .row { |
| 610 | margin-top: 8px; | 617 | margin-top: 8px; |
| 611 | font-size: 14px; | 618 | font-size: 12px; |
| 612 | color: #666666; | 619 | color: #666666; |
| 613 | word-break: break-all; | 620 | word-break: break-all; |
| 614 | line-height: 21px; | 621 | line-height: 21px; | ... | ... |
| ... | @@ -78,6 +78,7 @@ const sankeyInstance: any = ref(); | ... | @@ -78,6 +78,7 @@ const sankeyInstance: any = ref(); |
| 78 | const containerRef = ref(); | 78 | const containerRef = ref(); |
| 79 | 79 | ||
| 80 | const setChartsOption = () => { | 80 | const setChartsOption = () => { |
| 81 | |||
| 81 | let option = { | 82 | let option = { |
| 82 | tooltip: { | 83 | tooltip: { |
| 83 | trigger: 'item', | 84 | trigger: 'item', |
| ... | @@ -85,19 +86,33 @@ const setChartsOption = () => { | ... | @@ -85,19 +86,33 @@ const setChartsOption = () => { |
| 85 | if (params.data.name) { | 86 | if (params.data.name) { |
| 86 | return null; | 87 | return null; |
| 87 | } | 88 | } |
| 88 | return params.data.source + ' --> ' + params.data.target | 89 | return params.data.source + ' > ' + params.data.target |
| 89 | } | 90 | } |
| 90 | }, | 91 | }, |
| 91 | color: ["#3DBCBE", "#6b67d1", "#7BBCE0", "#2B8EF3", "#51dca2", "#E19D46"], | 92 | color: ["#3DBCBE", "#6b67d1", "#7BBCE0", "#2B8EF3", "#51dca2", "#E19D46"], |
| 92 | series: [ | 93 | series: [ |
| 93 | { | 94 | { |
| 94 | type: 'sankey', | 95 | type: 'sankey', |
| 95 | top: 80, | 96 | top: 60, |
| 96 | bottom: 40, | 97 | bottom: 20, |
| 97 | draggable: false, | 98 | draggable: false, |
| 98 | left: 40, | 99 | left: 50, |
| 99 | right: 80, | 100 | right: 100, |
| 100 | data: props.names, | 101 | label: { |
| 102 | fontSize: 10, | ||
| 103 | }, | ||
| 104 | data: props.names?.map(n => { | ||
| 105 | if (n.isLast) { | ||
| 106 | return { | ||
| 107 | ...n, | ||
| 108 | label: { | ||
| 109 | width: 97, | ||
| 110 | overflow: 'breakAll' | ||
| 111 | } | ||
| 112 | } | ||
| 113 | } | ||
| 114 | return n; | ||
| 115 | }), | ||
| 101 | links: props.treeData, | 116 | links: props.treeData, |
| 102 | lineStyle: { | 117 | lineStyle: { |
| 103 | color: 'source', | 118 | color: 'source', |
| ... | @@ -113,10 +128,9 @@ const setChartsOption = () => { | ... | @@ -113,10 +128,9 @@ const setChartsOption = () => { |
| 113 | const resizeObserver = ref(); | 128 | const resizeObserver = ref(); |
| 114 | 129 | ||
| 115 | const observeResize = () => { | 130 | const observeResize = () => { |
| 116 | resizeObserver.value = new ResizeObserver(() => { | 131 | window.addEventListener('resize', (e) => { |
| 117 | sankeyInstance.value?.resize(); | 132 | sankeyInstance.value?.resize(); |
| 118 | }); | 133 | }); |
| 119 | resizeObserver.value.observe(containerRef.value); | ||
| 120 | } | 134 | } |
| 121 | 135 | ||
| 122 | onMounted(() => { | 136 | onMounted(() => { | ... | ... |
| ... | @@ -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"> |
| ... | @@ -112,8 +112,8 @@ const handleNodeItemClick = (graph, nodeItem) => { | ... | @@ -112,8 +112,8 @@ const handleNodeItemClick = (graph, nodeItem) => { |
| 112 | nodeItem.getModel().collapsed = false; | 112 | nodeItem.getModel().collapsed = false; |
| 113 | parentData.collapsed = false; | 113 | parentData.collapsed = false; |
| 114 | graph.updateItem(nodeItem, { | 114 | graph.updateItem(nodeItem, { |
| 115 | ...nodeItem.getModel(), | 115 | ...nodeItem.getModel(), |
| 116 | collapsed: false | 116 | collapsed: false |
| 117 | }); | 117 | }); |
| 118 | graph.layout(); | 118 | graph.layout(); |
| 119 | setTimeout(() => { | 119 | setTimeout(() => { |
| ... | @@ -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; |
| ... | @@ -144,20 +147,20 @@ onBeforeMount(() => { | ... | @@ -144,20 +147,20 @@ onBeforeMount(() => { |
| 144 | const data = res.data || []; | 147 | const data = res.data || []; |
| 145 | let resultData = data?.[0] || {}; | 148 | let resultData = data?.[0] || {}; |
| 146 | if (!resultData?.children?.length && resultData.isHaveData == 'Y') { | 149 | if (!resultData?.children?.length && resultData.isHaveData == 'Y') { |
| 147 | graphDataLoading.value = true; | 150 | graphDataLoading.value = true; |
| 148 | getMetaStandardField(resultData.guid).then((res: any) => { | 151 | getMetaStandardField(resultData.guid).then((res: any) => { |
| 149 | graphDataLoading.value = false; | 152 | graphDataLoading.value = false; |
| 150 | if (res?.code == proxy.$passCode) { | 153 | if (res?.code == proxy.$passCode) { |
| 151 | resultData.children = res.data || []; | 154 | resultData.children = res.data || []; |
| 152 | graphTreeData.value = resultData; | 155 | graphTreeData.value = resultData; |
| 156 | } else { | ||
| 157 | graphTreeData.value = resultData; | ||
| 158 | ElMessage.error(res.msg); | ||
| 159 | } | ||
| 160 | }); | ||
| 153 | } else { | 161 | } else { |
| 154 | graphTreeData.value = resultData; | 162 | graphTreeData.value = resultData; |
| 155 | ElMessage.error(res.msg); | 163 | } |
| 156 | } | ||
| 157 | }); | ||
| 158 | } else { | ||
| 159 | graphTreeData.value = resultData; | ||
| 160 | } | ||
| 161 | } else { | 164 | } else { |
| 162 | ElMessage.error(res.msg); | 165 | ElMessage.error(res.msg); |
| 163 | } | 166 | } | ... | ... |
| ... | @@ -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