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
ba70837e
Commit
ba70837e
authored
Aug 25, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增标签选择名称则代入数据并disable
parent
c526d3a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
d3.vue
src/components/d3.vue
+5
-1
main.vue
src/components/main.vue
+29
-5
No files found.
src/components/d3.vue
View file @
ba70837e
...
@@ -114,7 +114,11 @@ export default {
...
@@ -114,7 +114,11 @@ export default {
const
handleLinkClick
=
(
d
)
=>
{
const
handleLinkClick
=
(
d
)
=>
{
const
{
nodeLabel
}
=
d
.
target
const
{
nodeLabel
}
=
d
.
target
if
(
nodeLabel
===
'System'
||
nodeLabel
===
'Subject'
)
{
if
(
nodeLabel
===
'System'
||
nodeLabel
===
'Subject'
||
nodeLabel
===
'SubjectLabel'
)
{
ctx
.
emit
(
'del-link'
,
d
)
ctx
.
emit
(
'del-link'
,
d
)
}
}
}
}
...
...
src/components/main.vue
View file @
ba70837e
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
filterable
filterable
tag
tag
:options=
"tagOptions"
:options=
"tagOptions"
:on-update:value=
"(e) => selectTag(e, i)"
/>
/>
</n-form-item>
</n-form-item>
<n-form-item
label=
"标签分类"
path=
"classification"
>
<n-form-item
label=
"标签分类"
path=
"classification"
>
...
@@ -61,12 +62,16 @@
...
@@ -61,12 +62,16 @@
v-model:value=
"data.classification"
v-model:value=
"data.classification"
placeholder=
"请选择"
placeholder=
"请选择"
:options=
"tagClassOptions"
:options=
"tagClassOptions"
:disabled=
"disableTag"
/>
/>
</n-form-item>
</n-form-item>
<n-form-item
path=
"isPositive"
:show-label=
"false"
>
<n-form-item
path=
"isPositive"
:show-label=
"false"
>
<n-checkbox
v-model:checked=
"data.isPositive"
<n-checkbox
>
是否为积极的标签
</n-checkbox
v-model:checked=
"data.isPositive"
:disabled=
"disableTag"
>
>
是否为积极的标签
</n-checkbox>
</n-form-item>
</n-form-item>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
@@ -333,10 +338,11 @@ function fetchTags() {
...
@@ -333,10 +338,11 @@ function fetchTags() {
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
const
data
=
(
res
.
data
&&
res
.
data
.
content
)
||
[]
const
data
=
(
res
.
data
&&
res
.
data
.
content
)
||
[]
tagOptions
.
value
=
data
.
map
((
e
)
=>
({
tagOptions
.
value
=
data
.
map
((
e
)
=>
({
// TODO
...
e
,
label
:
e
.
labelName
,
label
:
e
.
labelName
,
value
:
e
.
i
d
+
''
,
value
:
e
.
nodeI
d
+
''
,
}))
}))
console
.
log
(
tagOptions
.
value
)
})
})
}
}
fetchTags
()
fetchTags
()
...
@@ -419,6 +425,21 @@ function getTagName(relationId) {
...
@@ -419,6 +425,21 @@ function getTagName(relationId) {
return
tag
&&
tag
.
label
return
tag
&&
tag
.
label
}
}
const
disableTag
=
ref
(
false
)
function
selectTag
(
nodeId
,
i
)
{
formData
.
value
[
i
].
labelName
=
nodeId
const
curTag
=
tagOptions
.
value
.
find
((
e
)
=>
e
.
value
==
nodeId
)
if
(
curTag
)
{
formData
.
value
[
i
].
isPositive
=
curTag
.
isPositive
formData
.
value
[
i
].
classification
=
curTag
.
classification
disableTag
.
value
=
true
}
else
{
formData
.
value
[
i
].
isPositive
=
null
formData
.
value
[
i
].
classification
=
null
disableTag
.
value
=
false
}
}
function
submitNewNode
(
e
)
{
function
submitNewNode
(
e
)
{
e
.
preventDefault
()
e
.
preventDefault
()
console
.
log
(
formData
.
value
)
console
.
log
(
formData
.
value
)
...
@@ -533,9 +554,12 @@ function deleteNode(data) {
...
@@ -533,9 +554,12 @@ function deleteNode(data) {
function
deleteLink
(
data
)
{
function
deleteLink
(
data
)
{
const
{
source
,
target
}
=
data
const
{
source
,
target
}
=
data
cons
t
name
=
`'
${
source
.
propertyName
||
target
.
subjectName
}
_
${
le
t
name
=
`'
${
source
.
propertyName
||
target
.
subjectName
}
_
${
target
.
systemName
||
source
.
subjectName
target
.
systemName
||
source
.
subjectName
}
'`
}
'`
if
(
target
.
nodeLabel
===
'SubjectLabel'
)
{
name
=
`'
${
source
.
subjectName
}
_
${
target
.
labelName
}
'`
}
dialog
.
error
({
dialog
.
error
({
title
:
'提示'
,
title
:
'提示'
,
content
:
`是否删除
${
name
}
关联关系?`
,
content
:
`是否删除
${
name
}
关联关系?`
,
...
...
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