From b67f46b4a768b4cd72d4e463c5dffefe977ddeb7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 02 Dec 2024 22:04:27 +0800
Subject: [PATCH] 应急空间及全局图层去除废水处理站、污水池
---
src/views/survey/components/box/fireContent.vue | 152 ++++++++++++++++++++------------------------------
1 files changed, 62 insertions(+), 90 deletions(-)
diff --git a/src/views/survey/components/box/fireContent.vue b/src/views/survey/components/box/fireContent.vue
index 6afa14d..ca4e8d3 100644
--- a/src/views/survey/components/box/fireContent.vue
+++ b/src/views/survey/components/box/fireContent.vue
@@ -2,11 +2,11 @@
* @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: 2024-11-27 15:37:28
* @FilePath: \bigScreen\src\views\survey\components\box\fireContent.vue
- * @Description:
- *
- * Copyright (c) 2024 by shuishen, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2024 by shuishen, All Rights Reserved.
-->
<script setup>
import { useEchartsResize } from 'hooks/useEchartsResize'
@@ -15,7 +15,9 @@
let $echarts = inject('echarts')
const curEcharts = ref(null)
-let myEcharts = reactive(null)
+let myEcharts = reactive({
+ chart: ''
+})
let typeLevel = [
{
@@ -27,13 +29,14 @@
{
name: '一般',
itemStyle: {
- color: '#FFFF00'
+ color: '#FFC000'
}
},
{
name: '较大',
itemStyle: {
- color: '#FFC000'
+
+ color: '#F4090F'
}
},
{
@@ -44,118 +47,87 @@
}
]
-function getRiskSource () {
+function getRiskSource() {
getRiskSourceStatistic().then(res => {
- let xaxis_data = []
- let yaxis_data = []
- let seriesData = []
- res.data.data.forEach(element => {
- xaxis_data.push(element.riskLevel)
- yaxis_data.push({
- name: element.riskLevel,
- value: element.num
+ let data = res.data.data
+ let dataRsult = []
+ var total = 0
+ data.forEach(item => {
+ dataRsult.push({
+ name: item.riskLevel,
+ value: item.num,
+ itemStyle: typeLevel.find(i => i.name == item.riskLevel).itemStyle
})
-
- seriesData.push({
- name: element.riskLevel,
- type: 'bar',
- data: [],
- barWidth: '30',
- barGap: '-100%',
- itemStyle: typeLevel.find(i => i.name == element.riskLevel).itemStyle
- })
+ total = total + item.num
})
- seriesData = seriesData.map(item => {
- return {
- ...item,
- data: yaxis_data.map(i => {
- return i.name == item.name ? i.value : 0
- })
- }
- })
-
- myEcharts.setOption({
- legend: {
- data: xaxis_data,
- top: "5%",
- right: "5%",
+ myEcharts.chart.setOption({
+ title: {
+ text: "总数",
+ subtext: String(total),
textStyle: {
- color: '#fff'
- }
+ fontSize: 16,
+ color: "#fff",
+ lineHeight: 20,
+ },
+ subtextStyle: {
+ fontSize: 28,
+ color: "#fff",
+ },
+ textAlign: "center",
+ left: "62%",
+ // right: "43%",
+ top: "36%",
},
- tooltip: {
- axisPointer: {
- type: 'shadow'
- }
+ legend: {
+ orient: "vertical",
+ top: "40%",
+ left: "5%",
+ textStyle: {
+ color: "#fff",
+ },
},
grid: {
- top: '16%',
+ top: '6%',
left: '6%',
right: '6%',
bottom: '6%',
containLabel: true
},
- xAxis: [
- {
- type: 'category',
- data: xaxis_data,
- nameTextStyle: {
- color: '#fff'
- },
- axisLine: {
- lineStyle: {
- color: '#fff'
- }
- },
- axisTick: {
- alignWithLabel: true,
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- color: '#fff'
- },
- }
- ],
+ tooltip: {
+ trigger: 'item'
+ },
- yAxis: [
+ series: [
{
- type: 'value',
- nameTextStyle: {
- color: '#fff'
+ // name: 'Access From',
+ type: 'pie',
+ left: '-5%',
+ radius: ['45%', '75%'],
+ data: dataRsult,
+ left: "25%",
+ label: {
+ show: false,
},
- axisLine: {
- lineStyle: {
- color: '#fff'
- }
- },
- axisTick: {
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- color: '#fff'
+ labelLine: {
+ show: false,
},
}
- ],
- series: seriesData
+ ]
})
})
}
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)
@@ -167,4 +139,4 @@
</div>
</template>
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss" scoped></style>
--
Gitblit v1.9.3