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
0f2a29a8
authored
2025-06-27 15:49:17 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
关系网修改节点大小,并添加定位到标准管理
1 parent
cad55d0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
12 deletions
src/components/RelationNetwork/index.vue
src/router/modules/dataMeta.ts
src/views/data_meta/standard-query-view.vue
src/views/data_meta/standard.vue
src/components/RelationNetwork/index.vue
View file @
0f2a29a
...
...
@@ -210,7 +210,7 @@ const initGraph = () => {
const
{
item
,
target
}
=
evt
;
let
model
=
item
.
_cfg
.
model
;
if
(
props
.
noContextMenu
)
{
return
false
;
//
return false;
if
(
model
&&
!
model
.
isField
)
{
return
true
;
}
...
...
@@ -320,15 +320,17 @@ const initGraph = () => {
graphRef
.
value
=
graph
;
graph
.
node
((
node
)
=>
{
return
{
size
:
node
.
isField
?
11
:
16
,
id
:
node
.
guid
as
string
,
label
:
handleLabelLength
((
node
.
isField
?
node
.
metaStandardId
:
node
.
standardName
)
as
string
),
collapsed
:
node
.
children
?.
length
?
false
:
true
,
labelCfg
:
{
offset
:
7
,
offset
:
node
.
isField
?
4
:
7
,
style
:
{
fontSize
:
13
,
fill
:
'#212121'
,
fontWeight
:
500
fontWeight
:
500
,
cursor
:
'pointer'
},
position
:
!
node
.
isField
?
'left'
:
'right'
,
//只有字段是最后一层级,不需要展开
},
...
...
src/router/modules/dataMeta.ts
View file @
0f2a29a
...
...
@@ -278,7 +278,7 @@ const routes: RouteRecordRaw[] = [
}
}
},
{
{
path
:
'table-create-manual'
,
name
:
'tableCreateManual'
,
component
:
()
=>
import
(
'@/views/data_meta/tableCreateManual.vue'
),
...
...
src/views/data_meta/standard-query-view.vue
View file @
0f2a29a
...
...
@@ -8,7 +8,7 @@
<graphTopbar
ref=
"topBarRef"
@
displaySwitchChange=
"displaySwitchChange"
:isGraphDisplay=
"isGraphDisplay"
/>
</div>
<RelationNetwork
v-show=
"graphTreeData?.guid && isGraphDisplay"
ref=
"relationNetworkRef"
:tree-data=
"graphTreeData"
:noContextMenu=
"true"
@
nodeItemClick=
"handleNodeItemClick"
>
:noContextMenu=
"true"
@
nodeItemClick=
"handleNodeItemClick"
@
contextMenu=
"handleContextMenu"
>
</RelationNetwork>
<Sankey
v-show=
"!isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)"
v-loading=
"sankeyDataLoading"
:tree-data=
"sankeyData"
:names=
"sankeyNames"
>
...
...
@@ -128,9 +128,9 @@ const handleNodeItemClick = (graph, nodeItem) => {
graph
.
layout
();
graph
.
setMinZoom
(
0.5
);
graph
.
setMaxZoom
(
5
);
graph
.
focusItem
(
nodeItem
,
true
,
{
duration
:
400
// 动画时长为500ms
});
graph
.
focusItem
(
nodeItem
,
true
,
{
duration
:
400
// 动画时长为500ms
});
},
500
);
}
else
{
parentData
.
isLoading
=
false
;
...
...
@@ -139,6 +139,15 @@ const handleNodeItemClick = (graph, nodeItem) => {
})
}
const
handleContextMenu
=
(
model
)
=>
{
router
.
push
({
name
:
'metadataStandard'
,
query
:
{
standardGuid
:
model
.
guid
}
});
}
onBeforeMount
(()
=>
{
graphDataLoading
.
value
=
true
getMetaStandardTreeList
(
metaGuid
.
value
).
then
((
res
:
any
)
=>
{
...
...
src/views/data_meta/standard.vue
View file @
0f2a29a
...
...
@@ -24,6 +24,8 @@ import StandardFieldsDialog from './components/standardFieldsDialog.vue'
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
route
=
useRoute
();
const
cacheStore
=
useCatchStore
()
const
showFiledsPage
=
ref
(
false
)
...
...
@@ -76,8 +78,10 @@ function treeCustomClick (node, type) {
}).
then
(()
=>
deleteTreeNode
(
node
.
data
.
guid
))
}
}
function
getTree
(
refresh
=
false
)
{
function
getTree
(
refresh
=
false
,
initLocate
=
false
)
{
treeInfo
.
value
.
loading
=
true
;
getMetaStandardTree
().
then
((
res
:
any
)
=>
{
treeInfo
.
value
.
loading
=
false
;
if
(
res
.
code
===
proxy
.
$passCode
)
{
let
data
=
res
.
data
||
[]
data
.
forEach
(
item
=>
{
...
...
@@ -85,8 +89,10 @@ function getTree (refresh = false) {
item
.
level
=
1
})
treeInfo
.
value
.
data
=
data
treeInfo
.
value
.
expandedKey
=
[
data
[
0
].
guid
]
treeInfo
.
value
.
currentNodeKey
=
data
[
0
].
guid
if
(
!
initLocate
)
{
treeInfo
.
value
.
expandedKey
=
[
data
[
0
].
guid
]
treeInfo
.
value
.
currentNodeKey
=
data
[
0
].
guid
}
nodeClick
(
data
[
0
])
}
})
...
...
@@ -443,8 +449,16 @@ function batchDelete () {
})
}
/** 从关系网定位打开此页面,需定位到对应的树节点。 route.query.standardGuid */
onActivated
(()
=>
{
if
(
route
.
query
.
standardGuid
)
{
treeInfo
.
value
.
currentNodeKey
=
route
.
query
.
standardGuid
as
string
;
}
})
onBeforeMount
(()
=>
{
getTree
()
getTree
(
false
,
route
.
query
.
standardGuid
!=
null
)
})
const
viewGraph
=
()
=>
{
...
...
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