CN-1676 fix: 1、类型为indicator时下拉详情的字段名更改;2、类型为threshold时下拉详情,折线图颜色因severity返回字段变动而更改

This commit is contained in:
刘洪洪
2024-08-12 18:31:19 +08:00
parent a911307e29
commit 0f26c965bf
3 changed files with 20 additions and 8 deletions

View File

@@ -41,12 +41,24 @@ const severityColorMappings = [
{ value: 'low', color: '#ffdd4a' },
{ value: 'info', color: '#d7c668' }
]
const severityNumberColorMappings = [
{ value: 5, color: '#d84c4c' },
{ value: 4, color: '#ff9a79' },
{ value: 3, color: '#ffb65a' },
{ value: 2, color: '#ffdd4a' },
{ value: 1, color: '#d7c668' }
]
export function getSeverityColor (type) {
const mapping = severityColorMappings.find(m => m.value === type)
return mapping && mapping.color ? _.cloneDeep(mapping.color) : null
}
export function getSeverityNumberColor (type) {
const mapping = severityNumberColorMappings.find(m => m.value === type)
return mapping && mapping.color ? _.cloneDeep(mapping.color) : null
}
export const multipleBarOption = {
legend: {
icon: 'circle',