lilei il y a 4 ans
Parent
commit
ecee61814d
1 fichiers modifiés avec 23 ajouts et 23 suppressions
  1. 23 23
      src/views/cleanManage/statisticalReport.vue

+ 23 - 23
src/views/cleanManage/statisticalReport.vue

@@ -56,9 +56,9 @@
       <a-card class="panel " title="各回收物类型清运数据">
         <a-row :gutter="24">
           <a-col :md="24" :lg="24">
-            <div style="display: flex;align-items: center;">
+            <div style="display: flex;align-items: center;flex-wrap: wrap;">
               <div v-for="(item, index) in qyTotalPieData" :key="index" class="module-list" :style="{ background: washTypePieColor[index] }">
-                <p>{{ item.name }}</p>
+                <div>{{ item.name }}</div>
                 <span>{{ item.value }} kg</span>
               </div>
             </div>
@@ -79,8 +79,7 @@
               yUnit="kg"
               :xAxisData="XdaysData1"
               :seriesData="hswTypeBarData"
-              :color="washTypePieColor"
-            />
+              :color="washTypePieColor" />
             <span v-if="isNoData1" class="noData">暂无数据</span>
           </a-col>
           <!-- 变化趋势 -->
@@ -92,8 +91,7 @@
               :xAxisRotate="resize"
               :xAxisData="XdaysData1"
               :seriesData="hswTypeLineData"
-              :color="washTypePieColor"
-            />
+              :color="washTypePieColor" />
             <span v-if="isNoData1" class="noData">暂无数据</span>
           </a-col>
         </a-row>
@@ -189,11 +187,12 @@ export default {
     qyTotalPieData () {
       const list = this.totalGroupRubbiData ? this.totalGroupRubbiData.cleanReportData : []
       const temp = []
-      if (list) {
-        list.map(item => {
+      if (list.length) {
+        this.rubbishType.map(item => {
+          const has = list.find(obj => obj.rubbishType == item.code)
           temp.push({
-            name: item.rubbishTypeDictValue,
-            value: Number(item.cleanWeight / 1000).toFixed(3)
+            name: item.dispName,
+            value: has ? Number(has.cleanWeight / 1000).toFixed(3) : 0
           })
         })
       }
@@ -263,7 +262,7 @@ export default {
       XdaysData: [], // 图表X轴时间集合
       XdaysData1: [],
       // 各类型占比
-      washTypePieColor: ['#ffaa00', '#00aa00', '#00aaff', '#ff55ff', '#1dc5d4', '#8465c7', '#ff5500', '#527aff'],
+      washTypePieColor: ['#ffaa00', '#aaaa00', '#00aaff', '#ff55ff', '#1dc5d4', '#8465c7', '#ff5500', '#00aa00'],
       couponColor: ['#ffaa00', '#ff5500', '#00aaff', '#ff55ff', '#1dc5d4', '#8465c7', '#55aa00', '#527aff'],
       // 清运量趋势
       clearnChartData: [
@@ -279,7 +278,8 @@ export default {
         }
       ],
       hswTypeBarData: [],
-      hswTypeLineData: []
+      hswTypeLineData: [],
+      rubbishType: []
     }
   },
   methods: {
@@ -304,6 +304,7 @@ export default {
         lookupCode: 'RUBBISH_TYPE'
       }).then(res => {
         const list = res.data.list
+        _this.rubbishType = list
         list.map(item => {
           // 柱状图
           _this.hswTypeBarData.push({
@@ -322,7 +323,7 @@ export default {
         })
         setTimeout(() => {
           _this.getGroupDateAndRubbishType(params)
-        }, 500)
+        }, 100)
       })
     },
     // 查询网点列表
@@ -405,8 +406,8 @@ export default {
       this.clearnChartData[0].data = []
       this.clearnChartData[1].data = []
       // 重置各回收物类型清运数据
-      this.hswTypeBarData.map(item => item.data = [])
-      this.hswTypeLineData.map(item => item.data = [])
+      this.hswTypeBarData.map(item => (item.data = []))
+      this.hswTypeLineData.map(item => (item.data = []))
     },
     // 根据查询条件获取所有数据
     getPageData () {
@@ -541,10 +542,10 @@ export default {
       border: none;
     }
   }
-.search-panel /deep/ .ant-select-selection {
-     max-height: 150px;
-     overflow: auto;
-    }
+  .search-panel /deep/ .ant-select-selection {
+    max-height: 150px;
+    overflow: auto;
+  }
   .panel {
     margin-top: 10px;
     background-color: #ffffff;
@@ -570,13 +571,12 @@ export default {
 
     .tab-card {
       float: right;
-
+      margin: 30px 0;
       .tab-card-item {
         padding: 5px 10px;
         border: 1px solid #eee;
         cursor: pointer;
       }
-
       .checked-item {
         border-color: #2d8cf0;
         color: #2d8cf0;
@@ -586,13 +586,13 @@ export default {
 
   .module-list {
     color: #ffffff;
-    height: 100px;
     padding: 10px;
-    border-radius: 15px;
+    border-radius: 10px;
     display: flex;
     align-items: center;
     flex-direction: column;
     margin: 5px;
+    min-width: 150px;
     span {
       font-weight: 600;
       font-size: 20px;