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
4d35e7f3
Commit
4d35e7f3
authored
Aug 26, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有获取数据判断非空
parent
af9f585f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
main.vue
src/components/main.vue
+12
-10
No files found.
src/components/main.vue
View file @
4d35e7f3
...
...
@@ -304,7 +304,8 @@ function fetchSubjects() {
})
.
then
((
res
)
=>
{
console
.
log
(
'subject'
,
res
.
data
.
content
)
const
[{
links
,
nodes
}]
=
res
.
data
.
content
const
{
links
=
[],
nodes
=
[]
}
=
res
.
data
&&
res
.
data
.
content
&&
res
.
data
.
content
[
0
]
subjectOptions
.
value
=
nodes
.
map
((
item
)
=>
({
label
:
item
.
subjectName
,
value
:
item
.
nodeId
,
...
...
@@ -325,7 +326,7 @@ function fetchTags() {
url
:
api
.
GET_TAG_CLASS
,
})
.
then
((
res
)
=>
{
const
data
=
res
.
data
.
content
const
data
=
(
res
.
data
&&
res
.
data
.
content
)
||
[]
tagClassOptions
.
value
=
data
.
map
((
e
)
=>
({
label
:
e
.
classification
,
value
:
e
.
classification
,
...
...
@@ -342,7 +343,6 @@ function fetchTags() {
label
:
e
.
labelName
,
value
:
e
.
nodeId
+
''
,
}))
console
.
log
(
tagOptions
.
value
)
})
}
fetchTags
()
...
...
@@ -353,8 +353,8 @@ function getSelectOptions() {
url
:
api
.
GET_RELATIONS
,
})
.
then
((
res
)
=>
{
if
(
!
res
.
data
||
!
res
.
data
.
content
)
return
relationOptions
.
value
=
res
.
data
.
content
.
map
((
item
)
=>
({
const
data
=
(
res
.
data
&&
res
.
data
.
content
)
||
[]
relationOptions
.
value
=
data
.
map
((
item
)
=>
({
label
:
item
.
relationName
,
value
:
item
.
id
+
''
,
}))
...
...
@@ -364,8 +364,8 @@ function getSelectOptions() {
url
:
api
.
GET_SYSTEMS
,
})
.
then
((
res
)
=>
{
if
(
!
res
.
data
||
!
res
.
data
.
content
)
return
systemOptions
.
value
=
res
.
data
.
content
.
map
((
item
)
=>
({
const
data
=
(
res
.
data
&&
res
.
data
.
content
)
||
[]
systemOptions
.
value
=
data
.
map
((
item
)
=>
({
label
:
item
.
systemName
,
value
:
item
.
nodeId
+
''
,
}))
...
...
@@ -383,7 +383,7 @@ function fetchSubordinates(params = null) {
},
})
.
then
((
res
)
=>
{
const
{
links
,
nodes
}
=
res
.
data
.
content
const
{
links
=
[],
nodes
=
[]
}
=
res
.
data
&&
res
.
data
.
content
graphData
.
value
=
{
nodes
:
[
...
graphData
.
value
.
nodes
,
...
...
@@ -442,7 +442,6 @@ function selectTag(nodeId, i) {
function
submitNewNode
(
e
)
{
e
.
preventDefault
()
console
.
log
(
formData
.
value
)
formRef
.
value
.
validate
(
async
(
errors
)
=>
{
if
(
!
errors
)
{
isLoading
.
value
=
true
...
...
@@ -625,7 +624,10 @@ const searchNodes = (type, key) => {
params
,
})
.
then
((
res
)
=>
{
graphData
.
value
=
res
.
data
.
content
graphData
.
value
=
(
res
.
data
&&
res
.
data
.
content
)
||
{
links
:
[],
nodes
:
[],
}
})
}
...
...
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