Browse Source

bug 修复

lilei 4 năm trước cách đây
mục cha
commit
30b4e8555d
1 tập tin đã thay đổi với 27 bổ sung27 xóa
  1. 27 27
      src/views/dataView/borard.vue

+ 27 - 27
src/views/dataView/borard.vue

@@ -49,7 +49,7 @@
             <div class="lajiliang">
               <div class="laji-title">垃圾产生量</div>
               <div class="laji-item">
-                <div class="cor1">可回收垃圾</div>
+                <div class="cor5">可回收垃圾</div>
                 <div>{{ rubbishWeightData.RECYCLING }} kg</div>
               </div>
               <div class="laji-item">
@@ -65,7 +65,7 @@
                 <div>{{ rubbishWeightData.GATHER_BUILDING }} kg</div>
               </div>
               <div class="laji-item">
-                <div class="cor5">有害垃圾</div>
+                <div class="cor1">有害垃圾</div>
                 <div>{{ rubbishWeightData.HARM }} kg</div>
               </div>
               <div class="laji-total">共计<span>{{ rubbishWeightTotal }}</span>kg</div>
@@ -434,20 +434,20 @@ export default {
       querySumWeight({}).then(res => {
         console.log(res, '垃圾产生量')
         if (res.status == 200) {
-		  Object.keys(this.rubbishWeightData).map(item => {
-			  const 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))
+          Object.keys(this.rubbishWeightData).map(item => {
+            const p = res.data.list.find(key => key.rubbishType == item)
+            this.rubbishWeightData[item] = p ? this.formatter(Math.round(p.rubbishWeight / 1000) * 2) : 0
+          })
+          this.rubbishWeightTotal = this.formatter(Math.round(res.data.total / 1000) * 2)
         } else {
           this.rubbishWeightTotal = 0
-		  this.rubbishWeightData = {
-			  'GATHER_OTHER': 0, // 其它垃圾
-			  'GATHER_KITCHEN': 0, // 厨余垃圾
-			  'GATHER_BUILDING': 0, // 建筑垃圾
-			  'HARM': 0, // 有害垃圾
-			  'RECYCLING': 0 // 可回收垃圾
-		  }
+          this.rubbishWeightData = {
+            'GATHER_OTHER': 0, // 其它垃圾
+            'GATHER_KITCHEN': 0, // 厨余垃圾
+            'GATHER_BUILDING': 0, // 建筑垃圾
+            'HARM': 0, // 有害垃圾
+            'RECYCLING': 0 // 可回收垃圾
+          }
         }
       })
     },
@@ -458,35 +458,35 @@ export default {
         let data = []
         if (res.status == 200 && res.data) {
           // this.initChart3(res.data)
-		  Object.keys(this.rubbishWeightData).map(item => {
-			  const p = res.data.find(key => key.rubbishType == item)
+          Object.keys(this.rubbishWeightData).map(item => {
+            const p = res.data.find(key => key.rubbishType == item)
             if (p) {
               data.push({
                 name: p.rubbishTypeDict,
                 value: p.rubbishWeight
               })
             }
-		  })
+          })
         } else {
           data = [{
-			  name: '可回收垃圾',
-			  value: 0
+            name: '可回收垃圾',
+            value: 0
           },
           {
-			  name: '其他垃圾',
-			  value: 0
+            name: '其他垃圾',
+            value: 0
           },
           {
-			  name: '厨余垃圾',
-			  value: 0
+            name: '厨余垃圾',
+            value: 0
           },
           {
-			  name: '建筑垃圾',
-			  value: 0
+            name: '建筑垃圾',
+            value: 0
           },
           {
-			  name: '有害垃圾',
-			  value: 0
+            name: '有害垃圾',
+            value: 0
           }
           ]
         }