From cf9d04b97ef0b8abb63e587e0898e301765ed4b9 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期一, 18 八月 2025 17:07:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 153 insertions(+), 0 deletions(-)
diff --git a/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue b/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue
new file mode 100644
index 0000000..70872cb
--- /dev/null
+++ b/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue
@@ -0,0 +1,153 @@
+<template>
+ <div class="comparative_pie" style="width: 100%;height: 600px;display: flex;overflow: scroll">
+ <div id="compAnalPie1" style="flex: 1;"></div>
+ <div id="compAnalPie2" style="flex: 1;"></div>
+ </div>
+</template>
+
+<script>
+ import * as echarts from 'echarts'
+ export default {
+ name: 'conparativeAnalysisPie',
+ props:{ dataList:''},
+ data(){
+ return{
+ closeRate:0,
+ openRate:0,
+ usedRate:0,
+ waitRate:0,
+ RateList:[]
+ }
+ },
+ created(){
+
+ },
+ watch:{
+ dataList(val){
+ this.RateList = val
+ console.log(val)
+ this.drawTu()
+ },
+ },
+ mounted() {
+ this.drawTu()
+ },
+ methods:{
+ drawTu(){
+ let pieCompChart1 = this.$echarts.init(document.getElementById('compAnalPie1'),'macarons');
+ let pieCompChart2 = this.$echarts.init(document.getElementById('compAnalPie2'),'macarons');
+ let pieCompChartOption1 = {
+ title: {
+ x: 'center',
+ subtext: '寮�鏈烘晥鐜�'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: "{a} <br/>{b} : {c} ({d}%)"
+ },
+ legend: {
+ orient: 'vertical',
+ x: 'left',
+ y: 'bottom',
+ data: ['寮�鏈虹巼', '鍏虫満鐜�']
+ },
+ calculable: true,
+ series: [{
+ name: '寮�鏈烘晥鐜�',
+ type: 'pie',
+ radius: '70%',
+ center: ['55%', '55%'],
+ itemStyle: {
+ normal: {
+ color: function (params) {
+ var colorList = ['#4169E1', '#A8A8A8'];
+ return colorList[params.dataIndex]
+ },
+ label: {
+ show: true,
+ position: 'top',
+ formatter: '{b}\n{c}'
+ }
+ }
+ },
+ data: [{value: 0, name: '寮�鏈虹巼'},
+ {value: 0, name: '鍏虫満鐜�'}]
+ }]
+ };
+ let pieCompChartOption2 = {
+ title: {
+ x: 'center',
+ subtext: '杩愯鏁堢巼'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: "{a} <br/>{b} : {c} ({d}%)"
+ },
+ legend: {
+ orient: 'vertical',
+ x: 'left',
+ y: 'bottom',
+ data: ['鍔犲伐鐜�', '寰呮満鐜�', '鍏虫満鐜�']
+ },
+ calculable: true,
+ series: [{
+ name: '杩愯鏁堢巼',
+ type: 'pie',
+ radius: '70%',
+ center: ['55%', '55%'],
+ itemStyle: {
+ normal: {
+ color: function (params) {
+ var colorList = ['#00ee00', '#FCCE10', '#A8A8A8'];
+ return colorList[params.dataIndex]
+ },
+ label: {
+ show: true,
+ position: 'top',
+ formatter: '{b}\n{c}'
+ }
+ }
+ },
+ data: [{value: 0, name: '鍔犲伐鐜�'},
+ {value: 0, name: '寰呮満鐜�'},
+ {value: 0, name: '鍏虫満鐜�'}]
+ }]
+ };
+ if(this.RateList != null){
+ this.closeRate =[]
+ this.openRate =[]
+ this.usedRate = []
+ this.waitRate = []
+ if(this.RateList.length>0){
+ this.closeRate=this.RateList[0].closeRate
+ this.openRate=this.RateList[0].openRate
+ this.usedRate=this.RateList[0].processRate
+ this.waitRate=this.RateList[0].waitRate
+ pieCompChartOption1.series[0].data = [{value:(this.openRate * 100).toFixed(2), name:'寮�鏈虹巼'},{value:(this.closeRate * 100).toFixed(2), name:'鍏虫満鐜�'}];
+ pieCompChartOption2.series[0].data = [{value:(this.usedRate * 100).toFixed(2), name:'鍔犲伐鐜�'},{value:(this.waitRate * 100).toFixed(2), name:'寰呮満鐜�'},{value:(this.closeRate * 100).toFixed(2), name:'鍏虫満鐜�'}];
+ pieCompChart1.setOption(pieCompChartOption1);
+ pieCompChart2.setOption(pieCompChartOption2);
+ }else{
+ pieCompChart1.setOption(pieCompChartOption1);
+ pieCompChart2.setOption(pieCompChartOption2);
+ }
+
+ }else{
+ pieCompChart1.setOption(pieCompChartOption1);
+ pieCompChart2.setOption(pieCompChartOption2);
+ }
+
+ pieCompChart1.setOption(pieCompChartOption1);
+ pieCompChart2.setOption(pieCompChartOption2);
+ window.addEventListener('resize', function() {
+ pieCompChart1.resize()
+ pieCompChart2.resize()
+ })
+ }
+ }
+ }
+</script>
+
+<style scoped>
+
+</style>
\ No newline at end of file
--
Gitblit v1.9.3