浏览代码

bug修改

1004749546@qq.com 4 年之前
父节点
当前提交
e47c931532
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/views/dataView/borard.vue

+ 2 - 1
src/views/dataView/borard.vue

@@ -434,7 +434,8 @@ export default {
         console.log(res, '垃圾产生量')
         if (res.status == 200) {
 		  Object.keys(this.rubbishWeightData).map(item => {
-			  this.rubbishWeightData[item] = this.formatter(Math.round((res.data.list.find(key => key.rubbishType == item).rubbishWeight) / 1000))
+			  let p = res.data.list.find(key => key.rubbishType == item)
+			  this.rubbishWeightData[item] = p ? this.formatter(Math.round(p.rubbishWeight / 1000)) : 0
 		  })
 		  this.rubbishWeightTotal = this.formatter(Math.round(res.data.total / 1000))
         } else {