fix: 修复Detection模块下的echarts报警问题

This commit is contained in:
刘洪洪
2022-12-14 14:43:38 +08:00
parent 3e387162a5
commit 9862bf52a8
7 changed files with 56 additions and 54 deletions

View File

@@ -38,10 +38,8 @@ export const entityListLineOption = {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 2
}
lineStyle: {
width: 2
}
},
data: [],

View File

@@ -108,10 +108,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#69b072',
@@ -130,10 +128,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#7899c6',

View File

@@ -219,11 +219,9 @@ export const singleValueLine = {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
color: '#81C9FF',
lineStyle: {
width: 2
}
color: '#81C9FF',
lineStyle: {
width: 2
}
},
data: [],
@@ -272,10 +270,8 @@ export const entityListLine = {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 2
}
lineStyle: {
width: 2
}
},
data: [],

View File

@@ -326,7 +326,11 @@ export default {
// eventSeverityTrendOption.xAxis.data = dataMap.get('info').map(v => rTime(v[0]))
eventSeverityTrendOption.xAxis.data = xData
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
detectionChart.setOption(eventSeverityTrendOption)
// this.isEventSeverityNoData = false
@@ -353,7 +357,11 @@ export default {
return { value: d.count, name: d.eventSeverity, itemStyle: { color: getSeverityColor(d.eventSeverity) } }
})
const chartDom = document.getElementById(`eventSeverityPie${this.pageType}`)
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
detectionChart.setOption(eventSeverityOption)
const vm = this
@@ -380,7 +388,11 @@ export default {
count: r.count
}))
const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`)
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
const securityTypeOption = this.$_.cloneDeep(pieForSeverity)
securityTypeOption.series[0].data = data.map(d => {
@@ -408,7 +420,11 @@ export default {
count: r.count
}))
const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`)
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
const securityTypeOption = this.$_.cloneDeep(pieForSeverity)
securityTypeOption.series[0].data = data.map(d => {
@@ -440,7 +456,11 @@ export default {
this.filterData[this.pageType][4].showIndex = showIndex
const chartDom = document.getElementById(`detectionActiveAttacker${this.pageType}`)
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
const offenderIpOption = this.$_.cloneDeep(activeAttackBar)
data.sort(reverseSortBy('count'))
@@ -496,7 +516,11 @@ export default {
this.statisticsActiveAttackData = data
if (!this.$_.isEmpty(data)) {
const chartDom = document.getElementById(`detectionActiveAttacker${this.pageType}`)
const detectionChart = echarts.init(chartDom)
let detectionChart = echarts.getInstanceByDom(chartDom)
if (detectionChart) {
echarts.dispose(detectionChart)
}
detectionChart = echarts.init(chartDom)
this.chartInit.push(shallowRef(detectionChart))
const option = this.$_.cloneDeep(activeAttackBar)
data.sort(reverseSortBy('count'))

View File

@@ -207,8 +207,8 @@ export const pieForSeverity = {
return `${param.name}: ${param.value}`
}
},
itemStyle: {
emphasis: {
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
@@ -267,11 +267,9 @@ export const activeAttackBar = {
barWidth: 5,
barMaxHeight: 20,
itemStyle: {
normal: {
color: function (params) {
const colorList = ['#d1bd50', '#c9d150', '#fddd52', '#ffb65a', '#fe845d']
return colorList[params.dataIndex]
}
color: function (params) {
const colorList = ['#d1bd50', '#c9d150', '#fddd52', '#ffb65a', '#fe845d']
return colorList[params.dataIndex]
}
},
data: [],

View File

@@ -136,10 +136,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#69b072',
@@ -158,10 +156,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#7899c6',
@@ -469,10 +465,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#69b072',

View File

@@ -223,10 +223,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#69b072',
@@ -240,10 +238,8 @@ export default {
type: 'line',
legendHoverLink: false,
itemStyle: {
normal: {
lineStyle: {
width: 1
}
lineStyle: {
width: 1
}
},
color: '#7899c6',