diff --git a/src/views/charts/charts/chart-options.js b/src/views/charts/charts/chart-options.js index d715e38b..73215d9d 100644 --- a/src/views/charts/charts/chart-options.js +++ b/src/views/charts/charts/chart-options.js @@ -38,10 +38,8 @@ export const entityListLineOption = { type: 'line', legendHoverLink: false, itemStyle: { - normal: { - lineStyle: { - width: 2 - } + lineStyle: { + width: 2 } }, data: [], diff --git a/src/views/charts/charts/chart-relation-ship.js b/src/views/charts/charts/chart-relation-ship.js index 2c8ed62b..d1020f1f 100644 --- a/src/views/charts/charts/chart-relation-ship.js +++ b/src/views/charts/charts/chart-relation-ship.js @@ -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', diff --git a/src/views/charts/charts/options/line.js b/src/views/charts/charts/options/line.js index 9d4c792a..df4d1685 100644 --- a/src/views/charts/charts/options/line.js +++ b/src/views/charts/charts/options/line.js @@ -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: [], diff --git a/src/views/detections/Index.vue b/src/views/detections/Index.vue index 23ee4191..f3a668f1 100644 --- a/src/views/detections/Index.vue +++ b/src/views/detections/Index.vue @@ -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')) diff --git a/src/views/detections/options/detectionOptions.js b/src/views/detections/options/detectionOptions.js index a940c2b8..1cec708c 100644 --- a/src/views/detections/options/detectionOptions.js +++ b/src/views/detections/options/detectionOptions.js @@ -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: [], diff --git a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js index e632c359..34d38b72 100644 --- a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js +++ b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js @@ -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', diff --git a/src/views/entityExplorer/entityList/entityListMixin.js b/src/views/entityExplorer/entityList/entityListMixin.js index a4a67a51..72ef2f3e 100644 --- a/src/views/entityExplorer/entityList/entityListMixin.js +++ b/src/views/entityExplorer/entityList/entityListMixin.js @@ -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',