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

@@ -1356,3 +1356,18 @@ export function beforeRouterPush () {
}
store.commit('setRouterHistoryList', historyList)
}
/**
* 配置tag颜色此为接口返回的颜色字段color为rgb格式
* @param color
* @returns {string}
*/
export function getTagColor (color) {
if (color) {
let backgroundColor = ''
if (color.indexOf('rgb(') > -1) {
backgroundColor = color.replace('rgb(', 'rgba(').replace(')', ',0.06)')
}
return `color: ${color};border-color: ${color};background-color: ${backgroundColor};`
}
}