Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
R
relation-graph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭铭瑶
relation-graph
Commits
384d4230
Commit
384d4230
authored
Aug 20, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
展开附属节点后提供一个短暂的自适配的力
parent
c4768c68
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
footer.vue
src/components/footer.vue
+6
-1
main.vue
src/components/main.vue
+6
-6
useD3.js
src/util/useD3.js
+6
-1
No files found.
src/components/footer.vue
View file @
384d4230
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
/>
/>
<n-button
type=
"primary"
ghost
@
click=
"search"
>
搜索
</n-button>
<n-button
type=
"primary"
ghost
@
click=
"search"
>
搜索
</n-button>
</n-input-group>
</n-input-group>
<n-space>
<n-space
v-if=
"!isNarrow"
>
<n-tag
v-show=
"nodeVal"
size=
"small"
round
:color=
"color"
>
<n-tag
v-show=
"nodeVal"
size=
"small"
round
:color=
"color"
>
{{ switchName(nodeVal
&&
nodeVal._label_key) }}
{{ switchName(nodeVal
&&
nodeVal._label_key) }}
</n-tag>
</n-tag>
...
@@ -188,6 +188,9 @@ export default defineComponent({
...
@@ -188,6 +188,9 @@ export default defineComponent({
return
'未知'
return
'未知'
}
}
}
}
const
isNarrow
=
computed
(()
=>
{
return
window
.
innerHeight
/
window
.
innerWidth
>
0.75
})
return
{
return
{
curKey
,
curKey
,
setKey
,
setKey
,
...
@@ -201,6 +204,7 @@ export default defineComponent({
...
@@ -201,6 +204,7 @@ export default defineComponent({
clear
,
clear
,
nodeOptions
,
nodeOptions
,
switchName
,
switchName
,
isNarrow
,
}
}
},
},
})
})
...
@@ -215,6 +219,7 @@ export default defineComponent({
...
@@ -215,6 +219,7 @@ export default defineComponent({
background #f8f9fb
background #f8f9fb
box-shadow 10px 6px 10px 0 #000
box-shadow 10px 6px 10px 0 #000
margin-top 4px
margin-top 4px
flex-wrap wrap
.search-bar
.search-bar
flex 1
flex 1
margin 0 2%
margin 0 2%
...
...
src/components/main.vue
View file @
384d4230
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
@
search=
"searchNodes"
@
search=
"searchNodes"
/>
/>
</div>
</div>
<n-drawer
v-model:show=
"showDrawer"
:width=
"
40
0"
placement=
"left"
>
<n-drawer
v-model:show=
"showDrawer"
:width=
"
34
0"
placement=
"left"
>
<n-drawer-content
title=
"新增附属节点"
>
<n-drawer-content
title=
"新增附属节点"
closable
>
<n-form
ref=
"formRef"
:model=
"formData"
:rules=
"rules"
>
<n-form
ref=
"formRef"
:model=
"formData"
:rules=
"rules"
>
<n-form-item
path=
"propertyName"
label=
"节点名称"
>
<n-form-item
path=
"propertyName"
label=
"节点名称"
>
<n-input
<n-input
...
@@ -54,8 +54,8 @@
...
@@ -54,8 +54,8 @@
</n-form>
</n-form>
</n-drawer-content>
</n-drawer-content>
</n-drawer>
</n-drawer>
<n-drawer
v-model:show=
"showSubjectDrawer"
:width=
"
40
0"
placement=
"left"
>
<n-drawer
v-model:show=
"showSubjectDrawer"
:width=
"
34
0"
placement=
"left"
>
<n-drawer-content
title=
"新增主体"
>
<n-drawer-content
title=
"新增主体"
closable
>
<n-form
ref=
"subjectFormRef"
:model=
"subjectData"
:rules=
"rules"
>
<n-form
ref=
"subjectFormRef"
:model=
"subjectData"
:rules=
"rules"
>
<n-form-item
path=
"subjectName"
label=
"名称"
>
<n-form-item
path=
"subjectName"
label=
"名称"
>
<n-input
<n-input
...
@@ -72,8 +72,8 @@
...
@@ -72,8 +72,8 @@
</n-form>
</n-form>
</n-drawer-content>
</n-drawer-content>
</n-drawer>
</n-drawer>
<n-drawer
v-model:show=
"showLinkDrawer"
:width=
"
40
0"
placement=
"left"
>
<n-drawer
v-model:show=
"showLinkDrawer"
:width=
"
34
0"
placement=
"left"
>
<n-drawer-content
title=
"连接主体"
>
<n-drawer-content
title=
"连接主体"
closable
>
<n-form
ref=
"linkFormRef"
:model=
"linkData"
:rules=
"rules"
>
<n-form
ref=
"linkFormRef"
:model=
"linkData"
:rules=
"rules"
>
<n-form-item
path=
"sourceNodeId"
label=
"源主体"
>
<n-form-item
path=
"sourceNodeId"
label=
"源主体"
>
<n-select
<n-select
...
...
src/util/useD3.js
View file @
384d4230
...
@@ -418,10 +418,15 @@ export default class RelationGraph {
...
@@ -418,10 +418,15 @@ export default class RelationGraph {
.
alpha
(
1
)
.
alpha
(
1
)
.
restart
()
.
restart
()
this
.
simulation
.
alphaTarget
(
0.3
).
restart
()
this
.
curActiveNode
.
fx
=
this
.
curActiveNode
.
x
this
.
curActiveNode
.
fy
=
this
.
curActiveNode
.
y
const
timer
=
setTimeout
(()
=>
{
const
timer
=
setTimeout
(()
=>
{
this
.
simulation
.
alphaTarget
(
0
)
this
.
simulation
.
force
(
'link'
,
null
)
this
.
simulation
.
force
(
'link'
,
null
)
clearTimeout
(
timer
)
clearTimeout
(
timer
)
},
200
)
},
200
0
)
}
}
openMenu
(
self
,
d
,
types
)
{
openMenu
(
self
,
d
,
types
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment