From 2d93721c3758621a6b9a7eff038a8d6eac4fda24 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 26 六月 2025 15:30:26 +0800 Subject: [PATCH] 1、调整设备打卡率页面查询区域样式 2、对比分析页面新增图表数据加载提示以及优化整体页面图表展示及代码 3、调整班次班制管理页面左侧新增班制后刷新列表逻辑以及右侧配置按钮展示条件 --- src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue | 128 +++++++++++++++++++++--------------------- 1 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue b/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue index 70872cb..f5db383 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/ComparativeAnalysisPie.vue @@ -1,49 +1,44 @@ <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 style="display: flex;height: 100%;overflow: auto"> + <div id="compAnalPie1" style="width:50%;height:600px"></div> + <div id="compAnalPie2" style="width:50%;height:600px"></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:[] + name: 'comparativeAnalysisPie', + props: { dataList: '' }, + data() { + return { + closeRate: 0, + openRate: 0, + usedRate: 0, + waitRate: 0, + RateList: [] } }, - created(){ - - }, - watch:{ - dataList(val){ + 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 = { + 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}%)" + formatter: '{a} <br/>{b} : {c} ({d}%)' }, legend: { orient: 'vertical', @@ -59,8 +54,8 @@ center: ['55%', '55%'], itemStyle: { normal: { - color: function (params) { - var colorList = ['#4169E1', '#A8A8A8']; + color: function(params) { + var colorList = ['#4169E1', '#A8A8A8'] return colorList[params.dataIndex] }, label: { @@ -70,18 +65,18 @@ } } }, - data: [{value: 0, name: '寮�鏈虹巼'}, - {value: 0, name: '鍏虫満鐜�'}] + data: [{ value: 0, name: '寮�鏈虹巼' }, + { value: 0, name: '鍏虫満鐜�' }] }] - }; - let pieCompChartOption2 = { + } + let pieCompChartOption2 = { title: { x: 'center', subtext: '杩愯鏁堢巼' }, tooltip: { trigger: 'item', - formatter: "{a} <br/>{b} : {c} ({d}%)" + formatter: '{a} <br/>{b} : {c} ({d}%)' }, legend: { orient: 'vertical', @@ -97,8 +92,8 @@ center: ['55%', '55%'], itemStyle: { normal: { - color: function (params) { - var colorList = ['#00ee00', '#FCCE10', '#A8A8A8']; + color: function(params) { + var colorList = ['#00ee00', '#FCCE10', '#A8A8A8'] return colorList[params.dataIndex] }, label: { @@ -108,37 +103,46 @@ } } }, - data: [{value: 0, name: '鍔犲伐鐜�'}, - {value: 0, name: '寰呮満鐜�'}, - {value: 0, name: '鍏虫満鐜�'}] + data: [{ value: 0, name: '鍔犲伐鐜�' }, + { value: 0, name: '寰呮満鐜�' }, + { value: 0, name: '鍏虫満鐜�' }] }] - }; - if(this.RateList != null){ - this.closeRate =[] - this.openRate =[] + } + 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); + 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); + } else { + pieCompChart1.setOption(pieCompChartOption1) + pieCompChart2.setOption(pieCompChartOption2) } - pieCompChart1.setOption(pieCompChartOption1); - pieCompChart2.setOption(pieCompChartOption2); + pieCompChart1.setOption(pieCompChartOption1) + pieCompChart2.setOption(pieCompChartOption2) window.addEventListener('resize', function() { pieCompChart1.resize() pieCompChart2.resize() @@ -146,8 +150,4 @@ } } } -</script> - -<style scoped> - -</style> \ No newline at end of file +</script> \ No newline at end of file -- Gitblit v1.9.3