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;