Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
137c2960
authored
2025-06-26 18:27:50 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 解决关系网问题
1 parent
f3da88e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
18 deletions
src/components/RelationNetwork/index.vue
src/views/data_meta/standard-query-view.vue
src/views/data_meta/standard-query.vue
src/components/RelationNetwork/index.vue
View file @
137c296
...
...
@@ -230,7 +230,7 @@ const initGraph = () => {
container
:
container
,
width
,
height
,
// animate: false,
// animate: false,
plugins
:
[
contextMenu
,
tooltip
.
value
],
fitCenter
:
true
,
fitView
:
true
,
...
...
@@ -247,6 +247,11 @@ const initGraph = () => {
}
const
data
=
item
.
getModel
();
data
.
collapsed
=
collapsed
;
setTimeout
(()
=>
{
graph
.
focusItem
(
item
,
true
,
{
duration
:
400
// 动画时长为500ms
});
},
500
)
return
true
;
},
shouldBegin
:
(
e
)
=>
{
...
...
@@ -472,7 +477,9 @@ const bindEvents = () => {
}
});
lastSelectNode
.
value
=
item
;
detailInfo
.
value
.
guid
=
model
.
guid
;
detailInfo
.
value
=
{};
// detailInfo.value.guid = model.guid;
detailInfoLabel
.
value
=
model
.
label
||
{};
updateTooltipPosition
(
evt
);
detailLoading
.
value
=
true
;
...
...
src/views/data_meta/standard-query-view.vue
View file @
137c296
...
...
@@ -7,8 +7,8 @@
<div
className=
'g6-component-topbar'
>
<graphTopbar
ref=
"topBarRef"
@
displaySwitchChange=
"displaySwitchChange"
:isGraphDisplay=
"isGraphDisplay"
/>
</div>
<RelationNetwork
v-show=
"graphTreeData?.guid && isGraphDisplay"
ref=
"relationNetworkRef"
:tree-data=
"graphTreeData"
:noContextMenu=
"true"
@
nodeItemClick=
"handleNodeItemClick"
>
<RelationNetwork
v-show=
"graphTreeData?.guid && isGraphDisplay"
ref=
"relationNetworkRef"
:tree-data=
"graphTreeData"
:noContextMenu=
"true"
@
nodeItemClick=
"handleNodeItemClick"
>
</RelationNetwork>
<Sankey
v-show=
"!isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)"
v-loading=
"sankeyDataLoading"
:tree-data=
"sankeyData"
:names=
"sankeyNames"
>
...
...
@@ -112,8 +112,8 @@ const handleNodeItemClick = (graph, nodeItem) => {
nodeItem
.
getModel
().
collapsed
=
false
;
parentData
.
collapsed
=
false
;
graph
.
updateItem
(
nodeItem
,
{
...
nodeItem
.
getModel
(),
collapsed
:
false
...
nodeItem
.
getModel
(),
collapsed
:
false
});
graph
.
layout
();
setTimeout
(()
=>
{
...
...
@@ -128,6 +128,9 @@ const handleNodeItemClick = (graph, nodeItem) => {
graph
.
layout
();
graph
.
setMinZoom
(
0.5
);
graph
.
setMaxZoom
(
5
);
graph
.
focusItem
(
nodeItem
,
true
,
{
duration
:
400
// 动画时长为500ms
});
},
500
);
}
else
{
parentData
.
isLoading
=
false
;
...
...
@@ -144,20 +147,20 @@ onBeforeMount(() => {
const
data
=
res
.
data
||
[];
let
resultData
=
data
?.[
0
]
||
{};
if
(
!
resultData
?.
children
?.
length
&&
resultData
.
isHaveData
==
'Y'
)
{
graphDataLoading
.
value
=
true
;
getMetaStandardField
(
resultData
.
guid
).
then
((
res
:
any
)
=>
{
graphDataLoading
.
value
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
resultData
.
children
=
res
.
data
||
[];
graphTreeData
.
value
=
resultData
;
graphDataLoading
.
value
=
true
;
getMetaStandardField
(
resultData
.
guid
).
then
((
res
:
any
)
=>
{
graphDataLoading
.
value
=
false
;
if
(
res
?.
code
==
proxy
.
$passCode
)
{
resultData
.
children
=
res
.
data
||
[];
graphTreeData
.
value
=
resultData
;
}
else
{
graphTreeData
.
value
=
resultData
;
ElMessage
.
error
(
res
.
msg
);
}
});
}
else
{
graphTreeData
.
value
=
resultData
;
ElMessage
.
error
(
res
.
msg
);
}
});
}
else
{
graphTreeData
.
value
=
resultData
;
}
}
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
...
...
src/views/data_meta/standard-query.vue
View file @
137c296
...
...
@@ -204,6 +204,9 @@ const handleNodeItemClick = (graph, nodeItem) => {
graph
.
layout
();
graph
.
setMinZoom
(
0.5
);
graph
.
setMaxZoom
(
5
);
graph
.
focusItem
(
nodeItem
,
true
,
{
duration
:
500
// 动画时长为500ms
});
},
500
);
}
else
{
parentData
.
isLoading
=
false
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment