CN-1351 fix: 实体列表、详情和graph的tag颜色从接口获取

This commit is contained in:
刘洪洪
2023-10-11 15:17:15 +08:00
parent ed9a2c4e1f
commit 5fbab86a80
6 changed files with 42 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import _ from 'lodash'
import i18n from '@/i18n'
import axios from 'axios'
import { api } from '@/utils/api'
import { entityDetailTags, psiphon3IpType } from '@/utils/constants'
import { entityDefaultColor, entityDetailTags, psiphon3IpType } from '@/utils/constants'
export default class Node {
/*
@@ -91,7 +91,7 @@ export default class Node {
}
})
if (_.isArray(tags.userDefinedTags)) {
_tags = _.concat(_tags, tags.userDefinedTags.map(tag => ({ value: tag.tagValue, type: 'normal' })))
_tags = _.concat(_tags, tags.userDefinedTags.map(tag => ({ value: tag.tagValue, color: tag.knowledgeBase ? tag.knowledgeBase.color : entityDefaultColor })))
}
this.myData.tags = _tags