From 0cce10d0db3ea3786edf4b322925057ad87814cf Mon Sep 17 00:00:00 2001
From: chenyong <chenyong@hnkhzn.com>
Date: 星期四, 15 五月 2025 09:16:19 +0800
Subject: [PATCH] 三楼大屏

---
 CodeManagement/BigScreenVue/src/views/indexs/left-bottom.vue |   98 +++++++++++++++++++++++-------------------------
 1 files changed, 47 insertions(+), 51 deletions(-)

diff --git a/CodeManagement/BigScreenVue/src/views/indexs/left-bottom.vue b/CodeManagement/BigScreenVue/src/views/indexs/left-bottom.vue
index c5bff26..4d9f6e9 100644
--- a/CodeManagement/BigScreenVue/src/views/indexs/left-bottom.vue
+++ b/CodeManagement/BigScreenVue/src/views/indexs/left-bottom.vue
@@ -13,11 +13,12 @@
 
 <script>
 import { currentGET } from "api/modules";
-import { ProLocationStatistics } from "@/api/http.js";
+import { Getproductionvolume } from "@/api/http.js";
 import * as echarts from 'echarts';
 let style = {
   fontSize: 24,
 };
+
 export default {
   data() {
     return {
@@ -201,7 +202,7 @@
          itemStyle: {
              color: '#feb01e'
          },
-         data: [43, 50, 41, 18, 28, 25, 26, 40],
+         data: [99, 50, 41, 18, 28, 25, 26, 0],
      }, {
          name: 'CO2',
          type: 'line',
@@ -300,40 +301,35 @@
     clearData() {
       if (this.timer) {
         clearInterval(this.timer);
-        this.timer = null;
+        this.timer = 3000;
       }
     },
     async getData() {
-      this.pageflag = true;
-      // currentGET("big2").then((res) => {
-      //     if (!this.timer) {
-      //         console.log("璁惧鎬昏2", res);
-      //     }
-      //     if (res.success) {
-      //         this.userOverview = res.data;
-      //            this.onlineconfig = {
-      //             ...this.onlineconfig,
-      //             number: [1]
-      //         }
-      //         this.config = {
-      //             ...this.config,
-      //             number: [7]
-      //         }
-      //         this.offlineconfig = {
-      //             ...this.offlineconfig,
-      //             number: [4]
-      //         }
-      //         this.laramnumconfig = {
-      //             ...this.laramnumconfig,
-      //             number: [10]
-      //         }
-      //         this.switper();
-      //     } else {
-      //         this.pageflag = false;
-      //         this.$Message.warning(res.msg);
-      //     }
-      // });
-      var rep = await ProLocationStatistics();
+        var rep1=await Getproductionvolume()
+        var rep=rep1.filter(it=>it.roadway.includes("JZ"))
+        // (1) 鎸夋棩鏈熷垎缁勬牳蹇冪畻娉�
+const groupedData = rep.reduce((acc, item) => {
+  // 鎻愬彇鏃ユ湡閮ㄥ垎锛堟牸寮忥細YYYY-MM-DD锛�
+  const dateKey = item.createDate.split(' ')[0]; // 鎴� item.createDate.substring(0,10)
+  
+  // 鍒涘缓鏃ユ湡鍒嗙粍瀹瑰櫒锛堝鏋滀笉瀛樺湪锛�
+  if (!acc[dateKey]) {
+    acc[dateKey] = {
+      date: dateKey,
+      tasks: []
+    };
+  }
+  
+  // 灏嗗綋鍓嶉」鍔犲叆瀵瑰簲鍒嗙粍
+  acc[dateKey].tasks.push(item);
+  return acc;
+}, {});
+
+// (2) 杞崲涓烘帓搴忓悗鐨勬暟缁�
+const sortedGroups = Object.values(groupedData)
+  .sort((a, b) => new Date(b.date) - new Date(a.date)); // 闄嶅簭鎺掑垪
+
+
       this.options = {
      backgroundColor: '#0a1256',
      //娴姩妗�
@@ -350,7 +346,7 @@
          itemWidth: 10,
          itemHeight: 10,
          icon: 'circle',
-         data: ['鎴愬搧鍏ュ簱', '鎴愬搧鍑哄簱', '鎴愬搧鍥炴']
+         data: ['瀹炴鍏ュ簱', '瀹炴鍑哄簱', '绌烘鍏ュ簱']
      },
      grid: {
          left: '8%',
@@ -369,7 +365,7 @@
              gte: 60,
              color: '#e5421b'
          }],
-         seriesName: '鎴愬搧鍏ュ簱',
+         seriesName: '瀹炴鍏ュ簱',
          seriesIndex: 2
      }, {
          type: 'piecewise',
@@ -382,7 +378,7 @@
              gte: 60,
              color: '#e5421b'
          }],
-         seriesName: '鎴愬搧鍑哄簱',
+         seriesName: '瀹炴鍑哄簱',
          seriesIndex: 1
      }, {
          type: 'piecewise',
@@ -395,7 +391,7 @@
              gte: 60,
              color: '#e5421b'
          }],
-         seriesName: '鎴愬搧鍥炴',
+         seriesName: '绌烘鍏ュ簱',
          seriesIndex: 0
      }],
      //x杞�
@@ -416,7 +412,7 @@
              show: false
          },
          //鍧愭爣杞存樉绀哄��
-         data: ["04/19", "04/20", "04/21", "04/22", "04/23", "04/24", "04/25"]
+         data: [sortedGroups[6].date, sortedGroups[5].date, sortedGroups[4].date, sortedGroups[3].date,sortedGroups[2].date,sortedGroups[1].date,sortedGroups[0].date ]
      },
      //y杞�
      yAxis: {
@@ -446,31 +442,31 @@
 
      //
      series: [{
-         name: '鎴愬搧鍏ュ簱',
+         name: '瀹炴鍏ュ簱',
          type: 'line',
          symbolSize: [0, 0],
          itemStyle: {
              color: '#feb01e'
          },
-         data: [160, 156, 150, 180, 170, 200, 20],
+         data: [sortedGroups[6].tasks.filter(it=>it.taskType==200).length, sortedGroups[5].tasks.filter(it=>it.taskType==200).length, sortedGroups[4].tasks.filter(it=>it.taskType==200).length, sortedGroups[3].tasks.filter(it=>it.taskType==200).length, sortedGroups[2].tasks.filter(it=>it.taskType==200).length, sortedGroups[1].tasks.filter(it=>it.taskType==200).length, sortedGroups[0].tasks.filter(it=>it.taskType==200).length],
      }, {
-         name: '鎴愬搧鍑哄簱',
+         name: '瀹炴鍑哄簱',
          type: 'line',
          symbolSize: [0, 0],
          itemStyle: {
              color: '#1be57a'
          },
-         data: [80, 115, 120, 130, 91, 99,  20]
+         data: [sortedGroups[6].tasks.filter(it=>it.taskType==100).length, sortedGroups[5].tasks.filter(it=>it.taskType==100).length, sortedGroups[4].tasks.filter(it=>it.taskType==100).length, sortedGroups[3].tasks.filter(it=>it.taskType==100).length, sortedGroups[2].tasks.filter(it=>it.taskType==100).length, sortedGroups[1].tasks.filter(it=>it.taskType==100).length, sortedGroups[0].tasks.filter(it=>it.taskType==100).length]
      }, {
-         name: '鎴愬搧鍥炴',
+         name: '绌烘鍏ュ簱',
          type: 'line',
          symbolSize: [0, 0],
          itemStyle: {
              color: '#69dbf7'
          },
-         data: [70, 113, 118, 111, 89, 99,  32]
+         data: [sortedGroups[6].tasks.filter(it=>it.taskType==204).length, sortedGroups[5].tasks.filter(it=>it.taskType==204).length, sortedGroups[4].tasks.filter(it=>it.taskType==204).length, sortedGroups[3].tasks.filter(it=>it.taskType==204).length, sortedGroups[2].tasks.filter(it=>it.taskType==204).length, sortedGroups[1].tasks.filter(it=>it.taskType==204).length, sortedGroups[0].tasks.filter(it=>it.taskType==204).length]
      }, { //姘存尝绾圭偣
-         name: '鎴愬搧鍏ュ簱',
+         name: '瀹炴鍏ュ簱',
          type: 'effectScatter',
          symbolSize: [5, 5],
          rippleEffect: {
@@ -487,10 +483,9 @@
                  color: 'rgba(254,176,30,.3)'
              }])
          },
-         data: [160, 156, 150, 180, 170, 200,  20]
-
+         data: [sortedGroups[6].tasks.filter(it=>it.taskType==200).length, sortedGroups[5].tasks.filter(it=>it.taskType==200).length, sortedGroups[4].tasks.filter(it=>it.taskType==200).length, sortedGroups[3].tasks.filter(it=>it.taskType==200).length, sortedGroups[2].tasks.filter(it=>it.taskType==200).length, sortedGroups[1].tasks.filter(it=>it.taskType==200).length, sortedGroups[0].tasks.filter(it=>it.taskType==200).length],
      }, { //姘存尝绾圭偣
-         name: '鎴愬搧鍑哄簱',
+         name: '瀹炴鍑哄簱',
          type: 'effectScatter',
          symbolSize: [5, 5],
          rippleEffect: {
@@ -507,10 +502,10 @@
                  color: 'rgba(27,229,122,.3)'
              }])
          },
-         data: [80, 115, 120, 130, 91, 99,  20]
+         data:[sortedGroups[6].tasks.filter(it=>it.taskType==100).length, sortedGroups[5].tasks.filter(it=>it.taskType==100).length, sortedGroups[4].tasks.filter(it=>it.taskType==100).length, sortedGroups[3].tasks.filter(it=>it.taskType==100).length, sortedGroups[2].tasks.filter(it=>it.taskType==100).length, sortedGroups[1].tasks.filter(it=>it.taskType==100).length, sortedGroups[0].tasks.filter(it=>it.taskType==100).length]
 
      }, { //姘存尝绾圭偣
-         name: '鎴愬搧鍥炴',
+         name: '绌烘鍏ュ簱',
          type: 'effectScatter',
          symbolSize: [5, 5],
          rippleEffect: {
@@ -543,7 +538,7 @@
                  yAxis: 60
              }]
          },
-         data: [70, 113, 118, 111, 89, 99, 32]
+         data: [sortedGroups[6].tasks.filter(it=>it.taskType==204).length, sortedGroups[5].tasks.filter(it=>it.taskType==204).length, sortedGroups[4].tasks.filter(it=>it.taskType==204).length, sortedGroups[3].tasks.filter(it=>it.taskType==204).length, sortedGroups[2].tasks.filter(it=>it.taskType==204).length, sortedGroups[1].tasks.filter(it=>it.taskType==204).length, sortedGroups[0].tasks.filter(it=>it.taskType==204).length]
 
      }]
  };
@@ -551,6 +546,7 @@
     },
     //杞
     switper() {
+        
       if (this.timer) {
         return;
       }

--
Gitblit v1.9.3