From 9fd0c222d23c4dcaca4eb056f819f1ed0395bbbf Mon Sep 17 00:00:00 2001 From: TiaStars Date: Wed, 5 Jun 2024 14:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/yingji/echarts/finishRate.vue | 33 ++++++++++++++++--------- src/views/yingji/home.vue | 21 +++++++++++++--- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/views/yingji/echarts/finishRate.vue b/src/views/yingji/echarts/finishRate.vue index e3d60a8..a2aaa49 100644 --- a/src/views/yingji/echarts/finishRate.vue +++ b/src/views/yingji/echarts/finishRate.vue @@ -44,18 +44,27 @@ export default { this.arr1.push({ value: value1.count, name: value1.lawAreas, - pt: value1.completionRate, + // pt: value1.completionRate, + pt: this.NumFilter(value1.completed,value1.count), }); } else { this.arr2.push({ value: value1.count, name: value1.lawAreas, - pt: value1.completionRate + // pt: value1.completionRate + pt: this.NumFilter(value1.completed,value1.count) }); } }); this.initChart(); }, + NumFilter(numOne,numTwo){ + // if(numOne == 0 || numTwo == 0) { + // return 0; + // } + let realVal = parseFloat((numOne / numTwo) * 100).toFixed(2) + return realVal; + }, initChart() { var chartDom = document.getElementById("cakeBox"); var myChart = echarts.init(chartDom); @@ -87,7 +96,7 @@ export default { trigger: "item", }, legend: { - width: "45%", + width: "35%", top: "25%", right: "8%", orient: "horizontal", @@ -95,26 +104,26 @@ export default { itemWidth: 10, itemHeight: 10, icon: "circle", + formatter: function (name) { + const item = option.legend.data.find((item) => item.name === name); + // return `{a|${name}}{b|${( item.value / arrA * 100)}%}`; + return `{a|${name}}{pt|${item.pt}%}`; + }, textStyle: { rich: { - a: { + 'a': { color: "#525966", width: 60, - padding: [0, 0, 0, 5], + // padding: [0, 0, 0, 5], }, - b: { + 'pt': { color: "#495B7D", fontWeight: "bold", - // width: 60, + width: 60, // padding: [0, 0, 0, 10], }, }, }, - formatter: function (name) { - const item = option.legend.data.find((item) => item.name === name); - // return `{a|${name}}{b|${( item.value / arrA * 100)}%}`; - return `{a|${name}}{b|${item.pt}%}`; - }, //将waiyuan的数据拿过来,就会只显示该外圆的数据 // data: [ // { value: 15, name: "张家港市" }, diff --git a/src/views/yingji/home.vue b/src/views/yingji/home.vue index 98f9b7d..817bfcc 100644 --- a/src/views/yingji/home.vue +++ b/src/views/yingji/home.vue @@ -130,7 +130,8 @@ header-align="center" > @@ -164,7 +165,8 @@ header-align="center" > @@ -234,7 +236,8 @@ header-align="center" > @@ -265,7 +268,8 @@ header-align="center" > @@ -420,6 +424,13 @@ export default { resetPwd() { this.isResetPwdDialog = true; }, + NumFilter(numOne,numTwo){ + if(numOne == 0 || numTwo == 0) { + return 0; + } + let realVal = parseFloat((numOne / numTwo) * 100).toFixed(2) + return realVal; + }, // 导出 handelExport() { this.download( @@ -455,8 +466,10 @@ export default { }, // 获取列表数据 getList() { + this.load1 = true; treeEnterprise(this.queryParams).then((response) => { // console.log(response); + this.load1 = false; this.tableData = response.data; this.newTable = response.data; });