计算首页的完成率

Lvtianfang
吕天方 7 months ago
parent 9d1cdc7fe5
commit 9fd0c222d2

@ -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: "" },

@ -130,7 +130,8 @@
header-align="center"
>
<template slot-scope="scope">
{{ scope.row.cdCompletionRate }}%
<!-- {{ scope.row.cdCompletionRate }}% -->
{{ NumFilter(scope.row.cdFinish,scope.row.cdExecutionPlan) }}%
</template>
</el-table-column>
<el-table-column prop="count" label="执法计划" header-align="center">
@ -164,7 +165,8 @@
header-align="center"
>
<template slot-scope="scope">
{{ scope.row.completionRate }}%
<!-- {{ scope.row.completionRate }}% -->
{{ NumFilter(scope.row.completed,scope.row.count) }}%
</template>
</el-table-column>
@ -234,7 +236,8 @@
header-align="center"
>
<template slot-scope="scope">
{{ scope.row.cdCompletionRate }}%
<!-- {{ scope.row.cdCompletionRate }}% -->
{{ NumFilter(scope.row.cdFinish,scope.row.cdExecutionPlan) }}%
</template>
</el-table-column>
<el-table-column prop="count" label="执法计划" header-align="center">
@ -265,7 +268,8 @@
header-align="center"
>
<template slot-scope="scope">
{{ scope.row.completionRate }}%
<!-- {{ scope.row.completionRate }}% -->
{{ NumFilter(scope.row.completed,scope.row.count) }}%
</template>
</el-table-column>
@ -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;
});

Loading…
Cancel
Save