diff --git a/src/views/charts2/charts/entityDetail/EntityDetailBasicInfo.vue b/src/views/charts2/charts/entityDetail/EntityDetailBasicInfo.vue index 1ce2a4bc..2fc5b9c0 100644 --- a/src/views/charts2/charts/entityDetail/EntityDetailBasicInfo.vue +++ b/src/views/charts2/charts/entityDetail/EntityDetailBasicInfo.vue @@ -153,12 +153,24 @@ export default { if (tagData.status === 200) { Object.keys(res.data).forEach(k => { if (k !== 'userDefinedTags' && res.data[k]) { - Object.keys(res.data[k]).forEach(k2 => { - const find = entityDetailTags[this.entity.entityType].find(t => t.name === k2) - if (find) { - this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(res.data[k][k2]), type: find.type }) - } - }) + // 此处是vpnLearningDomain/Ip/App的tag + if (_.isArray(res.data[k])) { + res.data[k].forEach(k3 => { + const find = entityDetailTags[this.entity.entityType].find(t => t.name === k3.pluginName) + if (find) { + this.levelTwoTags.push({ key: 'pluginName', value: this.tagValueHandler(k3.pluginName), type: find.type }) + } else { + this.levelTwoTags.push({ key: 'pluginName', value: this.tagValueHandler(k3.pluginName), color: k3.knowledgeBase ? (k3.knowledgeBase.color || entityDefaultColor) : entityDefaultColor }) + } + }) + } else { + Object.keys(res.data[k]).forEach(k2 => { + const find = entityDetailTags[this.entity.entityType].find(t => t.name === k2) + if (find) { + this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(res.data[k][k2]), type: find.type }) + } + }) + } } }) if (_.isArray(res.data.userDefinedTags)) { diff --git a/src/views/entityExplorer/entityGraph/node.js b/src/views/entityExplorer/entityGraph/node.js index cbab2b69..e0e3ab32 100644 --- a/src/views/entityExplorer/entityGraph/node.js +++ b/src/views/entityExplorer/entityGraph/node.js @@ -82,12 +82,24 @@ export default class Node { let _tags = [] Object.keys(tags).forEach(k => { if (k !== 'userDefinedTags' && tags[k]) { - Object.keys(tags[k]).forEach(k2 => { - const find = entityDetailTags[entityType].find(t => t.name === k2) - if (find) { - _tags.push({ key: k2, value: this.tagValueHandler(k, k2, tags[k][k2]), type: find.type }) - } - }) + // 此处是vpnLearningDomain/Ip/App的tag + if (_.isArray(tags[k])) { + tags[k].forEach(k3 => { + const find = entityDetailTags[entityType].find(t => t.name === k3.pluginName) + if (find) { + _tags.push({ key: 'pluginName', value: this.tagValueHandler('', '', k3.pluginName), type: find.type }) + } else { + _tags.push({ key: 'pluginName', value: this.tagValueHandler('', '', k3.pluginName), color: k3.knowledgeBase ? (k3.knowledgeBase.color || entityDefaultColor) : entityDefaultColor }) + } + }) + } else { + Object.keys(tags[k]).forEach(k2 => { + const find = entityDetailTags[entityType].find(t => t.name === k2) + if (find) { + _tags.push({ key: k2, value: this.tagValueHandler(k, k2, tags[k][k2]), type: find.type }) + } + }) + } } }) if (_.isArray(tags.userDefinedTags)) { diff --git a/src/views/entityExplorer/entityList/Row.vue b/src/views/entityExplorer/entityList/Row.vue index 927432b2..66e482eb 100644 --- a/src/views/entityExplorer/entityList/Row.vue +++ b/src/views/entityExplorer/entityList/Row.vue @@ -305,12 +305,24 @@ export default { if (responese.status === 200) { Object.keys(res.data).forEach(k => { if (k !== 'userDefinedTags' && res.data[k]) { - Object.keys(res.data[k]).forEach(k2 => { - const find = entityDetailTags[this.entity.entityType].find(t => t.name === k2) - if (find) { - this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(res.data[k][k2]), type: find.type }) - } - }) + // 此处是vpnLearningDomain/Ip/App的tag + if (_.isArray(res.data[k])) { + res.data[k].forEach(k3 => { + const find = entityDetailTags[this.entity.entityType].find(t => t.name === k3.pluginName) + if (find) { + this.levelTwoTags.push({ key: 'pluginName', value: this.tagValueHandler(k3.pluginName), type: find.type }) + } else { + this.levelTwoTags.push({ key: 'pluginName', value: this.tagValueHandler(k3.pluginName), color: k3.knowledgeBase ? (k3.knowledgeBase.color || entityDefaultColor) : entityDefaultColor }) + } + }) + } else { + Object.keys(res.data[k]).forEach(k2 => { + const find = entityDetailTags[this.entity.entityType].find(t => t.name === k2) + if (find) { + this.levelTwoTags.push({ key: k2, value: this.tagValueHandler(res.data[k][k2]), type: find.type }) + } + }) + } } }) if (_.isArray(res.data.userDefinedTags)) {