From 9df3b6f36a82aeef307402c68ca08a8dbabe5099 Mon Sep 17 00:00:00 2001
From: Jack <1638169491@qq.com>
Date: Sat, 13 Aug 2022 15:40:36 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(=E6=95=B0?=
=?UTF-8?q?=E5=AD=97=E5=B7=A5=E5=9C=B0)=EF=BC=9A=E6=96=B0=E5=A2=9EAI?=
=?UTF-8?q?=E5=88=86=E6=9E=90=20echart=20=E5=9B=BE=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../jlw/digitalSite/leftCenter.vue | 25 +++++++------------
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/src/views/projectAdmin/jlw/digitalSite/leftCenter.vue b/src/views/projectAdmin/jlw/digitalSite/leftCenter.vue
index 514cccf5..bcd8c0bc 100644
--- a/src/views/projectAdmin/jlw/digitalSite/leftCenter.vue
+++ b/src/views/projectAdmin/jlw/digitalSite/leftCenter.vue
@@ -3,7 +3,7 @@
-
+
@@ -13,6 +13,7 @@
import { getAITypeStatistics } from '@/assets/js/api/companyBigScreen.js'
import Card from '../components/Card.vue'
import JNestedRingChart from '../jChart/pie/JNestedRingChart.vue'
+import echarts from 'echarts4'
export default {
components: { Card, JNestedRingChart },
props: {
@@ -60,21 +61,15 @@ export default {
this.$set(this.aiWarning, 'total', totalAlarmNum)
this.$set(this.aiWarning, 'list', alarmList)
+ this.pieAnalyse()
}
})
},
// AI分析
pieAnalyse() {
- console.log(this.$refs.pieAnalyse)
let pieAnalyse = echarts.init(this.$refs.pieAnalyse, 'dark')
- let total = this.totalDangerAlarmType
- let dataArray = this.dangerAlarmTypeList.map(x => {
- return {
- value: x.alarmNum,
- name: x.alarmTypeName
- }
- })
- console.log(dataArray)
+ let dataArray = this.aiWarning.list.map(x => ({ value: x.alarmNum, name: x.alarmTypeName }))
+
pieAnalyse.setOption({
color: ['#49B6A0', '#C16C28', '#F4A968', '#4378D8', '#D94916', '#9FD6F4', '#24A79A', '#786FF0'],
animation: false,
@@ -102,7 +97,6 @@ export default {
backgroundColor: 'rgba(3,6,9,0)',
series: [
{
- // name: '总数',
type: 'pie',
center: ['25%', '50%'],
radius: ['70%', '95%'],
@@ -111,7 +105,7 @@ export default {
show: true,
position: 'center',
color: 'white',
- formatter: '{total|' + total + '}' + '\n\n' + '{active|预警总数}',
+ formatter: '{total|' + this.aiWarning.total + '}' + '\n\n' + '{active|预警总数}',
rich: {
total: {
fontSize: 17
@@ -139,10 +133,9 @@ export default {
position: relative;
width: 100%;
height: 100%;
- .pieAnalyse2 {
- position: absolute;
- top: 20%;
- left: 4%;
+ .pieAnalyse {
+ width: 100%;
+ height: 100%;
}
.image {
position: absolute;