A 2022-07-14 22:08:34 +08:00
commit 5614ef750c
1 changed files with 53 additions and 52 deletions

View File

@ -54,18 +54,19 @@ export default {
methods: { methods: {
// //
getOption() { getOption() {
// //
let isAllZero = this.dataList.every(item => { let isAllZero = this.dataList.every(item => {
// console.log(item,"item") // console.log(item,"item")
return item.value == 0 return item.value == 0
}) })
console.log(isAllZero,"isAllZero") console.log(isAllZero, "isAllZero")
let option=null let option = null
if(isAllZero==true){ if (isAllZero == true) {
for(let i =0;i<this.dataList.length;i++){ for (let i = 0; i < this.dataList.length; i++) {
this.dataList[i].name = this.dataList[i].name+" 已完成工作项:"+this.dataList[i].value+"项" this.dataList[i].name = this.dataList[i].name + " 已完成工作项:" + this.dataList[i].value + "项"
} }
console.log(this.dataList,"this.dataListgroup") console.log(this.dataList, "this.dataListgroup")
option = { option = {
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
@ -113,9 +114,9 @@ export default {
} }
] ]
}; };
}else{ } else {
for(let i =0;i<this.dataList.length;i++){ for (let i = 0; i < this.dataList.length; i++) {
this.dataList[i].name = this.dataList[i].name+""+this.dataList[i].value+"人" this.dataList[i].name = this.dataList[i].name + "" + this.dataList[i].value + "人"
} }
option = { option = {
tooltip: { tooltip: {
@ -183,7 +184,7 @@ export default {
// //
updateEcharts() { updateEcharts() {
this.myChart.setOption(this.getOption(), true); this.myChart.setOption(this.getOption(), true);
console.log( this.dataList," this.dataList") console.log(this.dataList, " this.dataList")
} }
} }
} }