From 8e72ebbb44dba3ec5cf6dd3cd2613e6e9aed31ef Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 22 Nov 2024 15:37:33 +0800
Subject: [PATCH] Merge branch 'main' of http://139.196.74.78:10010/r/zhyq/bigScreen
---
src/views/survey/components/box/dataContent.vue | 60 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/src/views/survey/components/box/dataContent.vue b/src/views/survey/components/box/dataContent.vue
index 11d83dc..be0c40d 100644
--- a/src/views/survey/components/box/dataContent.vue
+++ b/src/views/survey/components/box/dataContent.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:12:37
+ * @LastEditTime: 2024-11-20 19:01:15
* @FilePath: \bigScreen\src\views\survey\components\box\dataContent.vue
* @Description:
*
@@ -10,23 +10,25 @@
-->
<script setup>
// import { ref, reactive, onMounted, nextTick, inject } from 'vue'
-import { useEchartsResize } from "hooks/useEchartsResize";
-import { getRescueTeamStatistic } from "@/api/indParkInfo";
-import { nextTick } from "vue";
+import { useEchartsResize } from "hooks/useEchartsResize"
+import { getRescueTeamStatistic } from "@/api/indParkInfo"
+import { nextTick } from "vue"
-let $echarts = inject("echarts");
-const curEcharts = ref(null);
+let $echarts = inject("echarts")
+const curEcharts = ref(null)
-let myEcharts = reactive(null);
+let myEcharts = reactive(null)
-function getStatistic() {
+const echartsColors = ['#1E90FF', '#36A2EB', '#FFD700', '#FFA500', '#228B22', '#8FBC8F']
+
+function getStatistic () {
getRescueTeamStatistic().then((res) => {
- let xaxis_data = [];
- let yaxis_data = [];
+ let xaxis_data = []
+ let yaxis_data = []
res.data.data.forEach((element) => {
- xaxis_data.push(element.type);
- yaxis_data.push(element.num);
- });
+ xaxis_data.push(element.type)
+ yaxis_data.push(element.num)
+ })
myEcharts.setOption({
tooltip: {
@@ -85,6 +87,7 @@
color: "#fff",
},
axisLine: {
+ show: true,
lineStyle: {
color: "#fff",
},
@@ -97,6 +100,9 @@
axisLabel: {
color: "#fff",
},
+ splitLine: {
+ show: false,
+ }
},
],
series: [
@@ -104,26 +110,30 @@
name: "救援人数",
type: "bar",
barWidth: "30",
- data: yaxis_data,
- itemStyle: {
- color: "#70AFEA",
- },
+ data: yaxis_data.map((i, ind) => {
+ return {
+ value: i,
+ itemStyle: {
+ color: echartsColors[ind],
+ },
+ }
+ }),
},
],
- });
- });
+ })
+ })
}
nextTick(() => {
- myEcharts = $echarts.init(curEcharts.value);
- getStatistic();
-});
+ myEcharts = $echarts.init(curEcharts.value)
+ getStatistic()
+})
const echartsResize = () => {
- myEcharts && myEcharts.resize();
-};
+ myEcharts && myEcharts.resize()
+}
-useEchartsResize(echartsResize);
+useEchartsResize(echartsResize)
</script>
<template>
--
Gitblit v1.9.3