Commit 089a9bd8 authored by caixingbing's avatar caixingbing

*

parent 92e4f152
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<el-table-column <el-table-column
prop="percent" prop="percent"
align="right" align="right"
label="占比"> label="占比(%)">
</el-table-column> </el-table-column>
<template slot="empty"> <template slot="empty">
<div style="padding: 30px 0"> <div style="padding: 30px 0">
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
if(res.code==200 && res.data){ if(res.code==200 && res.data){
let data = res.data, totalVal = data.map(item => item.value).reduce((prev, cur) => prev + cur) let data = res.data, totalVal = data.map(item => item.value).reduce((prev, cur) => prev + cur)
this.viewData = data.map(item => { this.viewData = data.map(item => {
let it = {name:item.name, value:item.value, percent:parseFloat(Number(Number(item.value)/Number(totalVal)*100).toFixed(2))+'%'} let it = {name:item.name, value:item.value, percent:parseFloat(Number(Number(item.value)/Number(totalVal)*100).toFixed(2))}
return it return it
}) })
if(this.viewData.length>0){ if(this.viewData.length>0){
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<el-table-column <el-table-column
prop="bl" prop="bl"
align="right" align="right"
label="占比"> label="占比(%)">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.bl }}</span> <span>{{ scope.row.bl }}</span>
</template> </template>
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
this.viewData = this.viewData.map(item => { this.viewData = this.viewData.map(item => {
let number = this.statistic[item.category]&&this.statistic[item.category][item.field]?this.statistic[item.category][item.field]:0 let number = this.statistic[item.category]&&this.statistic[item.category][item.field]?this.statistic[item.category][item.field]:0
let bl = number ? parseFloat(Number(Number(number)/Number(totalVal)*100).toFixed(2)) : 0 let bl = number ? parseFloat(Number(Number(number)/Number(totalVal)*100).toFixed(2)) : 0
let it = {name:item.name, value:number, tz: '', bl:bl+'%'} let it = {name:item.name, value:number, tz: '', bl:bl}
return it return it
}) })
this.viewData.sort((a, b) => { this.viewData.sort((a, b) => {
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
if(params.data.tz){ if(params.data.tz){
result+='<p style="color: rgba(35,35,35,0.8);padding: 0;margin: 0;" >'+ params.data.tz +'亿元</p>' result+='<p style="color: rgba(35,35,35,0.8);padding: 0;margin: 0;" >'+ params.data.tz +'亿元</p>'
} }
result+='<p style="color: rgba(35,35,35,0.8);padding: 0;margin: 0;">'+ params.data.bl+'</p>' result+='<p style="color: rgba(35,35,35,0.8);padding: 0;margin: 0;">'+ params.data.bl+'%</p>'
return result; return result;
}, },
extraCssText:'width:150px!important;', extraCssText:'width:150px!important;',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment