|
@@ -61,14 +61,24 @@ export default {
|
|
|
},
|
|
|
getsumStatus(district, index) {
|
|
|
getsumStatus(district).then(res => {
|
|
|
- console.log(this.dictLabelList[index], res)
|
|
|
- let data = [{
|
|
|
- value: parseInt(res.data.weishigong), name: '未施工'
|
|
|
- }, {
|
|
|
- value: parseInt(res.data.shigongzhong), name: '施工中'
|
|
|
- }, {
|
|
|
- value: parseInt(res.data.jungong), name: '竣工'
|
|
|
- }]
|
|
|
+ let data;
|
|
|
+ if(res.data != null ){
|
|
|
+ data = [{
|
|
|
+ value: parseInt(res.data.weishigong), name: '未施工'
|
|
|
+ }, {
|
|
|
+ value: parseInt(res.data.shigongzhong), name: '施工中'
|
|
|
+ }, {
|
|
|
+ value: parseInt(res.data.jungong), name: '竣工'
|
|
|
+ }]
|
|
|
+ }else{
|
|
|
+ data = [{
|
|
|
+ value: 0, name: '未施工'
|
|
|
+ }, {
|
|
|
+ value: 0, name: '施工中'
|
|
|
+ }, {
|
|
|
+ value: 0, name: '竣工'
|
|
|
+ }]
|
|
|
+ }
|
|
|
let color = ['#FFC881', '#5DB3FF', '#80D9AE'];
|
|
|
let option = {
|
|
|
title: {
|
|
@@ -76,7 +86,6 @@ export default {
|
|
|
textStyle: {
|
|
|
color: 'rgb(0 0 0)',
|
|
|
fontSize: 18,
|
|
|
- // fontWeight: 'normal',
|
|
|
},
|
|
|
x: 'center',
|
|
|
y: '85%',
|
|
@@ -90,6 +99,10 @@ export default {
|
|
|
name: '',
|
|
|
type: 'pie',
|
|
|
radius: '50%',
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ formatter: '{b}:{c}',
|
|
|
+ },
|
|
|
data: data,
|
|
|
emphasis: {
|
|
|
itemStyle: {
|