From 17a81d641608545682e3f79f7c6090cac48fe81a Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 15 Sep 2025 18:10:01 +0800
Subject: [PATCH] feat:去除高亮
---
src/views/survey/components/box/fireContent.vue | 57 ++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/src/views/survey/components/box/fireContent.vue b/src/views/survey/components/box/fireContent.vue
index 0c30979..c6239bd 100644
--- a/src/views/survey/components/box/fireContent.vue
+++ b/src/views/survey/components/box/fireContent.vue
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-11-04 16:32:04
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-05 17:42:44
+ * @LastEditTime: 2025-01-12 01:00:02
* @FilePath: \bigScreen\src\views\survey\components\box\fireContent.vue
* @Description:
*
@@ -15,32 +15,33 @@
let $echarts = inject('echarts')
const curEcharts = ref(null)
-let myEcharts = reactive(null)
+let myEcharts = reactive({
+ chart: ''
+})
let typeLevel = [
{
- name: '低',
+ name: '其他',
itemStyle: {
- color: '#31B5FF'
+ color: '#ADADAD'
}
},
{
name: '一般',
itemStyle: {
- color: '#FFC000'
+ color: '#FFFF00'
}
},
{
name: '较大',
itemStyle: {
-
- color: '#F4090F'
+ color: '#FFA500'
}
},
{
name: '重大',
itemStyle: {
- color: '#FE0000'
+ color: '#FF0000'
}
}
]
@@ -49,17 +50,17 @@
getRiskSourceStatistic().then(res => {
let data = res.data.data
let dataRsult = []
- var total = 0;
+ var total = 0
data.forEach(item => {
dataRsult.push({
name: item.riskLevel,
value: item.num,
itemStyle: typeLevel.find(i => i.name == item.riskLevel).itemStyle
})
- total = total + item.num;
+ total = total + item.num
})
- myEcharts.setOption({
+ myEcharts.chart.setOption({
title: {
text: "总数",
subtext: String(total),
@@ -73,16 +74,18 @@
color: "#fff",
},
textAlign: "center",
- right: "43%",
+ left: "62%",
+ // right: "43%",
top: "36%",
},
+
legend: {
orient: "vertical",
- top: '8%',
- right: "8%",
+ top: "40%",
+ left: "5%",
textStyle: {
- color: '#fff'
- }
+ color: "#fff",
+ },
},
grid: {
@@ -103,7 +106,14 @@
type: 'pie',
left: '-5%',
radius: ['45%', '75%'],
- data: dataRsult
+ data: dataRsult,
+ left: "25%",
+ label: {
+ show: false,
+ },
+ labelLine: {
+ show: false,
+ },
}
]
})
@@ -111,15 +121,24 @@
}
nextTick(() => {
- myEcharts = $echarts.init(curEcharts.value)
+ myEcharts.chart = $echarts.init(curEcharts.value)
getRiskSource()
})
const echartsResize = () => {
- myEcharts && myEcharts.resize()
+ myEcharts.chart && myEcharts.chart.resize()
}
useEchartsResize(echartsResize)
+
+onUnmounted(() => {
+ if (myEcharts.chart) {
+ myEcharts.chart.clear()
+ myEcharts.chart.dispose()
+
+ myEcharts.chart = null
+ }
+})
</script>
<template>
--
Gitblit v1.9.3