fix: 修复实体详情对于自定义tag标签颜色显示异常的问题

This commit is contained in:
刘洪洪
2024-02-20 11:01:13 +08:00
parent d0b29c24ba
commit b7c0b74247
2 changed files with 7 additions and 3 deletions

View File

@@ -1534,7 +1534,7 @@ export const formatTagsOfDetails = (data, type, list) => {
intelligenceContent: []
}
if (k === 'userDefinedTag') {
aggregation.intelligenceContent.push({ key: k, value: r[k].tagValue, type: 'normal' })
aggregation.intelligenceContent.push({ key: k, value: r[k].tagValue, type: 'normal', color: r[k].knowledgeBase ? (r[k].knowledgeBase.color || entityDefaultColor) : entityDefaultColor })
} else {
if (_.isArray(r[k])) {
r[k].forEach(k3 => {

View File

@@ -41,7 +41,10 @@
<template #default="scope">
<div class="information-aggregation-tags">
<div v-for="ic in scope.row.intelligenceContent" :key="ic.key"
class="entity-tag entity-tag--small margin-r-6" :test-id="`entity-tag${scope.$index}`" :class="`entity-tag--level-two-${ic.type}`">
class="entity-tag entity-tag--small margin-r-6"
:test-id="`entity-tag${scope.$index}`"
:style="getTagColor(ic.color)"
:class="`entity-tag--level-two-${ic.type}`">
{{ic.value}}
</div>
</div>
@@ -75,7 +78,7 @@ import { entityDetailTabsName } from '@/utils/constants'
import { dateFormatByAppearance, getNowTime } from '@/utils/date-util'
import chartNoData from '@/views/charts/charts/ChartNoData'
import { ref } from 'vue'
import { formatTagsOfDetails } from '@/utils/tools'
import { formatTagsOfDetails, getTagColor } from '@/utils/tools'
export default {
name: 'InformationAggregation',
@@ -101,6 +104,7 @@ export default {
components: { chartNoData },
methods: {
dateFormatByAppearance,
getTagColor,
intelligenceContentClass ({ columnIndex }) {
if (columnIndex === 2) {
return 'padding-0'